Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

BlackBerry Push Development

Reply
New Contributor
Spasms
Posts: 8
Registered: ‎02-25-2013
My Device: Z10

Android Runtime Push Notification Device Registration

I have ported my app from Android to the BlackBerry Android 2.3.3 Runtime. The only problem with the port is that Google Cloud Messaging service is not compatible. I have started implemting a BlackBerry push solution but there is not much info regarding apps ported from Android to BB10.

 

My question is how do I get the device PIN from the Android or Java SDK to register my BB10 device for push?

 

I am testing on a Z10 with OS 10.0.9.2372. I've heard upgrading to the dev alpha build will make GCM (GCMRegistrar.register) compatible. But even if I did upgrade to 10.0.10 dev alpha build and got notifications working, when we release the app, the device registration wouldn't work for PlayBook or any users on Z10 who have the factory OS install.

 

Is there any known solution to get notifications working on BB10 apps ported from Android... or are we forced to release the app without notifications?

Retired
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10

Re: Android Runtime Push Notification Device Registration

Have you checked out the documentation for push on http://developer.blackberry.com/android? It covers all changes that would be needed.

You will also need to apply for a BlackBerry Push Services account.

Push is no supported on the PlayBook currently.
Garett
@garettBeuk
--
Goodbye everybody!
Retired
mdandrea
Posts: 311
Registered: ‎08-08-2012
My Device: BlackBerry Z10

Re: Android Runtime Push Notification Device Registration

Hi,

 

GCM should be able to successfully work for you.

 

Here is a document outlining what you need to do to get push notifications to work with your Android ported app:

http://developer.blackberry.com/android/apisupport/creating_push-enabled_android_apps.html

 

Thanks,

 

Matt

New Contributor
Spasms
Posts: 8
Registered: ‎02-25-2013
My Device: Z10

Re: Android Runtime Push Notification Device Registration

I should have mentioned that I have already followed all of those steps. I've registered for push eval, the app is ported to Android Runtime and works perfectly.

 

However, my client side GCM service says it can't obtain a registration id (push token) because the GCM service is unavailable. This is on the Z10 with OS 10.0.9.2372

 

Thanks

Retired
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10

Re: Android Runtime Push Notification Device Registration

Do you have the necessary permissions specified? You need the consumer push and device identifying information permissions.

Are you testing using a signed build or a debug build? If the latter it may be worthwhile to delete your debug token then create a new one to ensure the push permission is available.
Garett
@garettBeuk
--
Goodbye everybody!
New Contributor
Spasms
Posts: 8
Registered: ‎02-25-2013
My Device: Z10

Re: Android Runtime Push Notification Device Registration

Creating a new debug token seemed to work. I also found this site that explains how to debug with adb and see the logcat output of the ported BB10 bar running on my Z10.

 

It looks like the registration went through to the PPG properly. However, I'm seeing some errors relating to the BroadcastReceiver now:

 

02-26 16:05:44.803: D/ShrimpController(13197523): onMessageReceived() @shrimp

02-26 16:05:44.803: D/ShrimpController(13197523): msg::registerComplete
02-26 16:05:44.803: D/ShrimpController(13197523): packageName::xxx
02-26 16:05:44.803: D/ShrimpController(13197523): errno:n:10110
02-26 16:05:44.803: D/ShrimpController(13197523): errstring::
02-26 16:05:44.803: D/ShrimpController(13197523): registerComplete
02-26 16:05:44.803: D/QNXShrimpClient(13197523): onRegister()
02-26 16:05:44.804: E/QNXShrimpClient(13197523): com.google.android.c2dm.intent.REGISTER error(10110) = ""
02-26 16:05:44.808: V/GCMBroadcastReceiver(15651023): onReceive: com.google.android.c2dm.intent.REGISTRATION
02-26 16:05:44.808: V/GCMBroadcastReceiver(15651023): GCM IntentService class: xxx.GCMIntentService
02-26 16:05:44.808: V/GCMBaseIntentService(15651023): Acquiring wakelock
02-26 16:05:44.819: E/BroadcastReceiver(15651023): BroadcastReceiver trying to return result during a non-ordered broadcast
02-26 16:05:44.819: E/BroadcastReceiver(15651023): java.lang.RuntimeException: BroadcastReceiver trying to return result during a non-ordered broadcast

 

I will attempt pushing some notifications to the device from our server now that it has been registered.

 

Thanks

New Contributor
ale_m
Posts: 8
Registered: ‎02-25-2013
My Device: Blackberry 10 Dev Alpha

Re: Android Runtime Push Notification Device Registration

[ Edited ]

Hey spasms, i have the same exceptions but it seems that in background it keeps retrying 'till the registration is done.
If you have a OnRegistered method or something like that, put a break point there and you will see that, although that exception is being thrown, the registration will be succesfull.

Retired
mdandrea
Posts: 311
Registered: ‎08-08-2012
My Device: BlackBerry Z10

Re: Android Runtime Push Notification Device Registration

It looks like from your logs you're getting a 10110 error code back which means PPG_SERVER_ERROR.

It typically means something is wrong with your PPG URL.

This means the registration would not have been successful for you.

 

Matt

 

Contributor
kikyoung
Posts: 10
Registered: ‎03-15-2013
My Device: BlackBerry 10 Dev Alpha B

Re: Android Runtime Push Notification Device Registration

[ Edited ]

Does anyone work with GCM?? I also have same problem.. Please give me any clues... Did you find the way to get push pin using Android API?

Retired
mdandrea
Posts: 311
Registered: ‎08-08-2012
My Device: BlackBerry Z10

Re: Android Runtime Push Notification Device Registration

You have to make sure you first register to use the BlackBerry Push Service here:

https://www.blackberry.com/profile/?eventId=8121

 

And then, make sure that when you send pushes to BlackBerries, you send them to the BlackBerry PPG servers instead of the Google ones.

 

Matt