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
Contributor
Posts: 21
Registered: ‎03-18-2014
My Device: BB10
My Carrier: Verizon

Android port... receiving the notification

[ Edited ]

With much help from gbeukeboom I was able to port my Android app to Blackberry 10 and get it to register successfully with the Blackberry Push service.  The Android runtime on the BB10 intercepts the app's attempts at Google registration and replaces the registration ID with an 8 digit Blackberry identifier.

 

I believe I have our server pushing to the device but now I'm not seeing any notifications coming in.  Am I to assume that the runtime works the same way and the device knows to channel the incoming notification via the Android code for catching an incoming notification?  I have a C2DMBaseReceiver class with an "OnMessage" method, but it's not firing after I send a notification to the device.  How does the notification "catch" work?

Contributor
Posts: 21
Registered: ‎03-18-2014
My Device: BB10
My Carrier: Verizon

Re: Android port... receiving the notification

My server is receiving "1001\" desc=\"The request has been accepted for processing.\" when I do the BIS push, so it seems like it's going out.  It just doesn't seem to be getting to the device.

 

When it came to registering, it seemed to me that it was undocumented that the runtime looked for the following line of code:  "final String token = intent.getStringExtra("registration_id");"

 

Is there a similar,specific line of code that it's looking for for an incoming notification?

Retired
Posts: 74
Registered: ‎07-22-2008
My Device: BlackBerry Z10
My Carrier: N/A

Re: Android port... receiving the notification

Hi there,

 

As long as the standard android configuration file is added as indicated in the doc below, you should be able to receive pushes in the app.  Can you please verify this in your app?

 

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

 

Thanks,
Pratik Sapra
Gaming & Apps Consultant
Developer Relations
@pratiksapra
Contributor
Posts: 21
Registered: ‎03-18-2014
My Device: BB10
My Carrier: Verizon

Re: Android port... receiving the notification

Yes, the config file is present.  The device is registering correctly with the 8 character Blackberry ID (which I assume it wouldn't do without the config file).  What we need help with is how to troubleshoot the incoming notification.  As I've stated, we appear to be sending the notification correctly but nothing comes in on the device. 

 

Can someone on the Blackberry side see more than just the "1001\" desc=\"The request has been accepted for processing.\" message?  Is there any more information about what I can expect to see while debugging the code on the device side?  Does the incoming notification work similar to the registration in that the runtime looks for certain Android code and then intercepts it and replaces it with Blackberry functionality?  If so, which code?