Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.ClassCastException receiving foregrounded FCM ttl and sent_time #110

Open
jkotchoff opened this issue Jul 8, 2018 · 2 comments

Comments

@jkotchoff
Copy link

Env: Ti SDK 7.1.1.GA, Android 7.0. Tested with android module v4.1.0 and v4.1.1

Is the php FCM example on the module homepage working when an app is foregrounded? When I run it with the app backgrounded and sending to a single device token, the title and body of the notification is correctly received and shown in my Android system tray. When I run it with the app foregrounded, I receive the following stack trace:

[WARN]  Bundle: Key google.sent_time expected String but value was a java.lang.Long.  The default value <null> was returned.
[WARN]  Bundle: Attempt to cast generated internal exception:
[WARN]  Bundle: java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.String
[WARN]  Bundle: 	at android.os.BaseBundle.getString(BaseBundle.java:995)
[WARN]  Bundle: 	at com.google.android.gms.gcm.zza.zzu(Unknown Source)
[WARN]  Bundle: 	at com.google.android.gms.gcm.GcmListenerService.handleIntent(Unknown Source)
[WARN]  Bundle: 	at com.google.firebase.iid.zzc.run(Unknown Source)
[WARN]  Bundle: 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
[WARN]  Bundle: 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
[WARN]  Bundle: 	at java.lang.Thread.run(Thread.java:761)
[WARN]  Bundle: Key google.ttl expected String but value was a java.lang.Integer.  The default value <null> was returned.
[WARN]  Bundle: Attempt to cast generated internal exception:
[WARN]  Bundle: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
[WARN]  Bundle: 	at android.os.BaseBundle.getString(BaseBundle.java:995)
[WARN]  Bundle: 	at com.google.android.gms.gcm.zza.zzu(Unknown Source)
[WARN]  Bundle: 	at com.google.android.gms.gcm.GcmListenerService.handleIntent(Unknown Source)
[WARN]  Bundle: 	at com.google.firebase.iid.zzc.run(Unknown Source)
[WARN]  Bundle: 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
[WARN]  Bundle: 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
[WARN]  Bundle: 	at java.lang.Thread.run(Thread.java:761)
[DEBUG] D/ti.goosh.IntentService: Push notification received from: 230344656513
[DEBUG] D/ti.goosh.IntentService: Notification key : google.sent_time => 1531022880351 (java.lang.Long)
[DEBUG] D/ti.goosh.IntentService: Notification key : google.ttl => 2419200 (java.lang.Integer)
[DEBUG] D/ti.goosh.IntentService: Notification key : google.message_id => 0:1531022880353590%0163e4800163e480 (java.lang.String)
[DEBUG] D/ti.goosh.IntentService: Notification key : notification => Bundle[{alert=This is a message sent from my http server, title=From server side}] (android.os.Bundle)
[DEBUG] D/ti.goosh.IntentService: Notification key : collapse_key => com.test.testapp (java.lang.String)
[WARN]  W/ti.goosh.IntentService: Show Notification: FALSE
[INFO]  Android onPushReceived
[INFO]  data received: {"inBackground":false,"data":"{\"c.i\": \"null\"}"}
[INFO]  data: "{\"c.i\": \"null\"}"
[WARN]  Could not process push notification```
@nrpverma
Copy link

@jkotchoff did u find anything? I'm also getting the same error.

@jkotchoff
Copy link
Author

@jkotchoff did u find anything? I'm also getting the same error.

I gave up on this module due to the lack of response on this issue. I switched over to:
titanium-firebase-cloud-messaging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants