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
Contributor
nl4pv
Posts: 10
Registered: ‎02-19-2013
My Device: All of them
My Carrier: All of them

Push notifications with Urban Airship

Hi,

 

Just wondering if anyone has successfully setup an Android app with push notification using Urban Airship? I can see my z10 is getting the push. However, an alert is not generated.

 

I can see the following error in adb logcat output. I replaced some things with xxx's. But, it's all irrelevant.

 

Any ideas why no alert?

 

D/ShrimpController(12103682): onMessageReceived() @shrimp
D/ShrimpController(12103682): res::getMsg
D/ShrimpController(12103682): packageName::com.xxx
D/ShrimpController(12103682): dat::xxx
D/ShrimpController(12103682): res:getMsg
E/ShrimpController(12103682): Expecting push message to contain JSON data
D/QNXShrimpClient(12103682): onMessage() for package: com.xxx

D/dalvikvm(17969374): GC_CONCURRENT freed 1930K, 42% free 3925K/6727K, external
3572K/4460K, paused 7ms+76ms
E/BroadcastReceiver(17969374): BroadcastReceiver trying to return result during
a non-ordered broadcast
E/BroadcastReceiver(17969374): java.lang.RuntimeException: BroadcastReceiver try
ing to return result during a non-ordered broadcast
E/BroadcastReceiver(17969374):  at android.content.BroadcastReceiver.checkSynchr
onousHint(BroadcastReceiver.java:451)
E/BroadcastReceiver(17969374):  at android.content.BroadcastReceiver.setResult(B
roadcastReceiver.java:343)
E/BroadcastReceiver(17969374):  at com.urbanairship.push.GCMPushReceiver.onRecei
ve(Unknown Source)
E/BroadcastReceiver(17969374):  at android.app.ActivityThread.handleReceiver(Act
ivityThread.java:1798)
E/BroadcastReceiver(17969374):  at android.app.ActivityThread.access$2400(Activi
tyThread.java:117)
E/BroadcastReceiver(17969374):  at android.app.ActivityThread$H.handleMessage(Ac
tivityThread.java:981)
E/BroadcastReceiver(17969374):  at android.os.Handler.dispatchMessage(Handler.ja
va:99)
E/BroadcastReceiver(17969374):  at android.os.Looper.loop(Looper.java:123)
E/BroadcastReceiver(17969374):  at android.app.ActivityThread.main(ActivityThrea
d.java:3687)
E/BroadcastReceiver(17969374):  at java.lang.reflect.Method.invokeNative(Native
Method)
E/BroadcastReceiver(17969374):  at java.lang.reflect.Method.invoke(Method.java:5
07)
E/BroadcastReceiver(17969374):  at com.android.internal.os.ZygoteInit$MethodAndA
rgsCaller.run(ZygoteInit.java:867)
E/BroadcastReceiver(17969374):  at com.android.internal.os.ZygoteInit.main(Zygot
eInit.java:625)
E/BroadcastReceiver(17969374):  at dalvik.system.NativeStart.main(Native Method)

I/PushIntentReceiver(17969374): Received intent: Intent { act=com.urbanairship.p
ush.PUSH_RECEIVED cmp=com.xxx/com.xxx.services.
pushnotifications.PushIntentReceiver (has extras) }
I/PushIntentReceiver(17969374): Received push notification. Alert: null [Notific
ationID=0]
I/PushIntentReceiver(17969374): Push Notification Extra: [MIME-Version : 1.0]
I/PushIntentReceiver(17969374): Push Notification Extra: [x-rim-deviceid : xxx]
I/PushIntentReceiver(17969374): Push Notification Extra: [Content-Length : 4]
I/PushIntentReceiver(17969374): Push Notification Extra: [OST / HTTP/1.1 : POST
/ HTTP/1.1]
I/PushIntentReceiver(17969374): Push Notification Extra: [data : word]
I/PushIntentReceiver(17969374): Push Notification Extra: [X-RIM-PUSH-SERVICE-ID
: xxx]
I/PushIntentReceiver(17969374): Push Notification Extra: [Connection : close]
I/PushIntentReceiver(17969374): Push Notification Extra: [Content-Type : text/pl
ain]

 

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

Re: Push notifications with Urban Airship

Hi nl4pv,

Did you solve your problem?
Please use plain text.
Contributor
nl4pv
Posts: 10
Registered: ‎02-19-2013
My Device: All of them
My Carrier: All of them

Re: Push notifications with Urban Airship

No progress. Any ideas?

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

Re: Push notifications with Urban Airship

No...

We're also getting:

 

BroadcastReceiver trying to return result during a non-ordered broadcast

 Don't know why. The app successfully receives notifications on Android, but no success on BB 10 device...

We've followed the steps from http://developer.blackberry.com/android/apisupport/creating_push-enabled_android_apps.html

Do you know how to check on the UA side whether the app is registered to receive notifications via BB Push Service?

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

Re: Push notifications with Urban Airship

Same problem here.

Please use plain text.
BlackBerry Development Advisor
mwhiteman
Posts: 159
Registered: ‎11-21-2008
My Device: BlackBerry 10
My Carrier: Rogers

Re: Push notifications with Urban Airship

Hello,

 

Looking into the logs, it does seem that you are getting the push. The data is just 'word' correct? I also noticed you have not set an alert/notification. 

 

I/PushIntentReceiver(17969374): Received push notification. Alert: null [NotificationID=0]

 

what is your application expecting to recieve?

 

As an example, have you tried sending {Alert: "some text", NotificationId: #}

 

Matt Whiteman
Product Manager, Android, BlackBerry Java & Simulators
Please use plain text.
Contributor
nl4pv
Posts: 10
Registered: ‎02-19-2013
My Device: All of them
My Carrier: All of them

Re: Push notifications with Urban Airship


mwhiteman wrote:

 ...

As an example, have you tried sending {Alert: "some text", NotificationId: #}

 


 

To clarify, I am using Urban Airship to enable push notifications in my apps. 

 

With our Java based Blackberry apps (OS 7.x and lower) alerts are displayed.

With our Android apps, alerts are displayed.

With our BB10 packaged Android apps, the alerts are not displayed.

 

So, I'm thinking it could be possible that there is a bug in the Urban Airship client library code.

Is there some doc you could link to that describes what a properly formated push payload should look like?

 

Also, could you comment on the  

java.lang.RuntimeException: BroadcastReceiver try ing to return result during a non-ordered broadcast error we are receiving? Could that be related?

 

Thanks!

Please use plain text.
Contributor
nl4pv
Posts: 10
Registered: ‎02-19-2013
My Device: All of them
My Carrier: All of them

Re: Push notifications with Urban Airship

Also, has anyone tried following up with Urban Airship?

 

I posted this here:

https://support.urbanairship.com/customer/portal/questions/824812-android-app-on-blackberry-z1-

 

We might get some more traction if more people raise the issue.

Please use plain text.
BlackBerry Development Advisor
mwhiteman
Posts: 159
Registered: ‎11-21-2008
My Device: BlackBerry 10
My Carrier: Rogers

Re: Push notifications with Urban Airship

I received a note from fiksik that recommended to enable GCM support on Urban Airship. Although these are Push messages for BlacKBerry, the data needs to be formatted for Android.

 

Cheers,

Matt

 

Matt Whiteman
Product Manager, Android, BlackBerry Java & Simulators
Please use plain text.
Contributor
nl4pv
Posts: 10
Registered: ‎02-19-2013
My Device: All of them
My Carrier: All of them

Re: Push notifications with Urban Airship

I have GCM setup.

fiksik, it would be great if you could post how you got things working.

Please use plain text.