Rotsos
Apple Fan
Profile
Posts: 33
Reg: Jan 30, 2013
Limassol
3,430
09/26/14 12:26 AM (9 years ago)

Android Push Notifications error

I have downloaded the Android files from buzztouch and I have filled the project id in the manifest , like I was supposed to, but when I try to register for push notification the app crashes. I believe the reason is that the variable SENDER_ID in BT_gcmConfig.jav is expecting a string but instead an Integer is passed. The relevant error I get is the following: "Caused by: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String" It seems that the function getGCMProjectNumber() in BT_gcmConfig.jav is not really returning a string to the SENDER_ID variable. I tried to fix the problem by hardcoding the value of SENDER_ID which worked fine for registering the device for push notifications but failed when I tried to send a notification. More specifically the app crashes a few seconds after the notification is received with the following errors: 09-25 12:00:38.625: E/AndroidRuntime(24897): FATAL EXCEPTION: IntentService[GCMIntentService-292686335146-1] 09-25 12:00:38.625: E/AndroidRuntime(24897): java.lang.IllegalMonitorStateException: object not locked by thread before notify() 09-25 12:00:38.625: E/AndroidRuntime(24897): at java.lang.Object.notify(Native Method) 09-25 12:00:38.625: E/AndroidRuntime(24897): at com.carrefour.BT_gcmIntentService.generateNotification(BT_gcmIntentService.java:152) 09-25 12:00:38.625: E/AndroidRuntime(24897): at com.carrefour.BT_gcmIntentService.onMessage(BT_gcmIntentService.java:89) 09-25 12:00:38.625: E/AndroidRuntime(24897): at com.google.android.gcm.GCMBaseIntentService.onHandleIntent(GCMBaseIntentService.java:223) 09-25 12:00:38.625: E/AndroidRuntime(24897): at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65) 09-25 12:00:38.625: E/AndroidRuntime(24897): at android.os.Handler.dispatchMessage(Handler.java:99) 09-25 12:00:38.625: E/AndroidRuntime(24897): at android.os.Looper.loop(Looper.java:137) 09-25 12:00:38.625: E/AndroidRuntime(24897): at android.os.HandlerThread.run(HandlerThread.java:60) Has anybody else encountered the same issue?
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
09/26/14 10:58 AM (9 years ago)
Yeah, it's an issue for sure. I emailed David a while back with the details of my probing around and lacking up the core to make it work. Seems to only effect certain devices. I'll check when I get some time to see if I can find the fix again. Or just paste what I've got in one of my recent projects where I know it's working. I'm about to convert my recent major app to Android, and that will be a significant component.
 
Rotsos
Apple Fan
Profile
Posts: 33
Reg: Jan 30, 2013
Limassol
3,430
like
10/01/14 10:31 AM (9 years ago)
Any solutions for this issue? I need to submit my app urgently and I need to have this working before I do that. @Chris1 can you please try to find the fix?
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
10/01/14 10:33 AM (9 years ago)
Sorry, I have a ton on my plate right now. It will probably be a couple weeks or more before I get to this.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.