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

Android™ Runtime Development

Reply
New Contributor
ale_m
Posts: 8
Registered: ‎02-25-2013
My Device: Blackberry 10 Dev Alpha
My Carrier: Claro
Accepted Solution

[Google Cloud Messaging] Not getting a registration id.

Hi people, we are having some issues registering our device so we can get push notifications.
Here's our scenario:
-We have a Blackberry 10 Dev Alpha device with OS version: 10.0.9.388
-Already registered to the push service
-Created android.cfg and changed values with the ones received from Blackberry :
<android>
  <push>
     <appid>appid received from blackberry after registration to push service</appid>
     <ppgurl>http://xxxxxx.pushapi.eval.blackberry.com</ppgurl>
     <tokenprefix>bb-</tokenprefix>
  </push>
</android>

-Added manifest permissions.
-We deploy the app using a Debug Token.
-Device is connected to Blackberry network (we can add contacts, chat through BBM, etc.)
-Structure of the generated .bar file seem to be ok. (.apk, manifest -permissions are ok too-, android.cfg)

GCM is working fine on Android devices, but, when we debug it on BlackBerry dev alpha device, register method from GCMRegistrar class is not registering our device and getRegistrationId method is always returning an empty string.
There is no exception being thrown, so we don't know what is failing in the register method.
Is there a way to see some logs? We tried to connect to the device through SSH but we don't know where to find some logs about this (if there are any) .

We have gone through all of what is discussed in this topic but still can't get it working.

Thanks in advance.

Please use plain text.
Contributor
fiksik
Posts: 10
Registered: ‎02-14-2013
My Device: Z10
My Carrier: MTS

Re: [Google Cloud Messaging] Not getting a registration id.

Yeah, we're having the same problem..Could someone help us please?
Please use plain text.
New Contributor
ale_m
Posts: 8
Registered: ‎02-25-2013
My Device: Blackberry 10 Dev Alpha
My Carrier: Claro

Re: [Google Cloud Messaging] Not getting a registration id.

From what i've got from stackoverflow, Blackberry does no magic with our GCM implementation, and we must code a specific blackberry module to register our device.
If this is true, should we use the blackberry java sdk or is there another way?

Please use plain text.
New Contributor
Spasms
Posts: 8
Registered: ‎02-25-2013
My Device: Z10
My Carrier: Rogers

Re: [Google Cloud Messaging] Not getting a registration id.

I have followed the same steps and run into the exact same issue. All information I've found regarding registering a BB10 device for notifications is for apps using WebWorks, Cascades, AIR, etc. We are porting out apps from Android and using the Android SDK and Java JDK 7. Is there a PushService jar available to handle this process?

 

It seems the only issue is finding a way to get the BlackBerry device PIN (notification token) through the normal JDK. Assuming the client side android.cfg is all we need in place to listen for and receive notifications. I have no yet verified this part.

Please use plain text.
New Contributor
ale_m
Posts: 8
Registered: ‎02-25-2013
My Device: Blackberry 10 Dev Alpha
My Carrier: Claro

Re: [Google Cloud Messaging] Not getting a registration id.

We also thought that the android.cfg was the only thing we needed but some people on stackoverflow told me that it was not so simple and that i have to implement a "blackberry module" like we did with gcm. So can someone confirm if we need to use Blackberry sdk or if there is another way to get the registration id/pin and send it to the server?
Please use plain text.
New Contributor
ale_m
Posts: 8
Registered: ‎02-25-2013
My Device: Blackberry 10 Dev Alpha
My Carrier: Claro

Re: [Google Cloud Messaging] Not getting a registration id.

Good news.

After updating OS version from 10.0.9.388 to 10.0.10.263, our GCM implementation started working (advice by people from Blackberry Support team).
We got the registration id after calling GCMRegistrar.register and now we are getting notifications!
So there is no need to use Blackberry SDK or any other third party library.

If you are porting your android app to blackberry, make sure your android.cfg is well formed and with valid data received from Blackberry mail after registration for push services.
Also check if push notification permission are in the manifest file in your repackaged .bar file.

Nothing else has to be done, no extra coding was needed in our case!

Hope it helps.

Please use plain text.
New Contributor
Spasms
Posts: 8
Registered: ‎02-25-2013
My Device: Z10
My Carrier: Rogers

Re: [Google Cloud Messaging] Not getting a registration id.

That is excellent news, thanks. I'm updating now.

 

However, does this mean that if we release our app now that push notifications will not work since nobody out there is on 10.0.10 yet?

 

Also, is there an equivalent update for the PlayBook or is this dev alpha build only for BB10 devices like the Z10?

Please use plain text.
New Contributor
ale_m
Posts: 8
Registered: ‎02-25-2013
My Device: Blackberry 10 Dev Alpha
My Carrier: Claro

Re: [Google Cloud Messaging] Not getting a registration id.

Do you know with which OS version are the Z10 coming out?

Since we received this dev alpha prototype device like 3 months ago, we thought that maybe we have an old beta os version, and that z10 devices would come out with the newest version available installed.

Don't know about PlayBook, but there is a 2.1.0.1526 os version available...

Please use plain text.
New Contributor
Spasms
Posts: 8
Registered: ‎02-25-2013
My Device: Z10
My Carrier: Rogers

Re: [Google Cloud Messaging] Not getting a registration id.

The Z10 ships with 10.0.9.2372

Please use plain text.
New Contributor
ale_m
Posts: 8
Registered: ‎02-25-2013
My Device: Blackberry 10 Dev Alpha
My Carrier: Claro

Re: [Google Cloud Messaging] Not getting a registration id.

Well our version was older than that. The os that our device had wasn't even completed (ie: it didn't have sms app installed).

Let me know if after update, notifications started working for you.

Please use plain text.