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
Developer
Posts: 270
Registered: ‎12-13-2010
My Device: PlayBook 16GB, BB10 Dev Alpha
My Carrier: o2 (de)

BB10 not receiving my pushes

Hi guys,

 

I signed up for the push service evaluation period and played around with the BB10 code sample and the PHP code I found here.

 

Things seem to work on both sides:

1.) My server application returns:

Response CODE: 1001
Response DESC: The request has been accepted for processing.

2.) My client (running on the dev alpha, built with WebWorks 10.0.1.6) says "Successfully registered" using the "Public/BIS" setting, my app ID and the PPG URL containing CPID.

 

But: nothing happens in terms of: I don't get any notification when the app is running and it won't start if it's closed.

 

Is there any method to "debug" this?

 

Do you have any idea?

 

Thanks.

- - -
My approved apps @ App World
Developer
Posts: 270
Registered: ‎12-13-2010
My Device: PlayBook 16GB, BB10 Dev Alpha
My Carrier: o2 (de)

Re: BB10 not receiving my pushes

For clarification, here's my config:

 

BB10 push client config:

  • Public/BIS
  • unchecked Push Service SDK
  • Application ID: xxxx-xxxx17e4D45t955o76com0860M59l53xxxx (x-ed out some numbers/letters)
  • PPG URL: http://cpXXXX.pushapi.eval.blackberry.com (with XXXX being my 4 digit CPID)
  • Registered (successfully)

PHP push server:

  • URL: https://pushapi.eval.blackberry.com/mss/PD_pushRequest
  • Basic authentification (tested & working properly, otherwise I'd get an error message)
  • Consignee: <address address-value="push_all"/> (also tested with single device PIN and device PIN + %3A100/TYPE=USER@rim.net)
  • Cheapo method: <quality-of-service delivery-method="unconfirmed"/>
  • And deliver-before-timestamp is set to now + 60 minutes.

I did not use the port # given in my push services registration e-mail anywhere.

 

Perhaps these pieces of information help...

- - -
My approved apps @ App World
Retired
Posts: 311
Registered: ‎08-08-2012
My Device: BlackBerry Z10
My Carrier: Rogers

Re: BB10 not receiving my pushes

Hey!

 

We just checked the eval push logs and it looks like your pushes are being delivered to the device. They just don't seem to be making it to your application for some reason. We'll have to investigate some more to see if this issue is unique to you.

 

In the meantime, could you please send a confirmed push (change the delivery method to "confirmed"). This will allow us to know if the push is even reaching your application.

 

One thing to note about the address tag. Using a value of "push_all" means a push will be sent to all devices that have apps on them that have reigstered with your application ID (I'm guessing it's just one for now). Just something to note for the future.

 

You also mentioned trying the device PIN. Although this works for now, it might change in the future, so you really should be using the "token" you get back from the createChannel call in your WebWorks push-enabled application.
https://developer.blackberry.com/html5/apis/blackberry.push.pushservice.html#createChannel

 

You're right about the port. It doesn't matter for BlackBerry 10 anymore.

 

Thanks,

 

Matt

Developer
Posts: 270
Registered: ‎12-13-2010
My Device: PlayBook 16GB, BB10 Dev Alpha
My Carrier: o2 (de)

Re: BB10 not receiving my pushes

Thanks for your reply and investigations.

 

I switched to the confirmed delivery method as advised. Nothing changed so far.

Additionally I tried to query the status (<statusquery-message>) of one of my messages, but since I'm on the free service I always get a

"The request was refused. Status Query is not supported by your Push Service."

 returned.

 

Oh, and when it comes to using PINs for addressing devices in the request, you should consider updating the "BlackBerry Push Access Protocol Development Guide" found here.

- - -
My approved apps @ App World
Retired
Posts: 311
Registered: ‎08-08-2012
My Device: BlackBerry Z10
My Carrier: Rogers

Re: BB10 not receiving my pushes

I looked up your confirmed push in the eval logs and it looks like it can't reach the application for some reason (the error code is 4502). It is getting to the device though.

 

What OS version do you have on your Dev Alpha? Have you upgraded it recently?  Push definitely wasn't fully supported for these devices until recently. 

 

Good catch for those docs.  We'll work on updating those to be clear about the use of tokens for BlackBerry 10.

 

Thanks,

 

Matt

Developer
Posts: 270
Registered: ‎12-13-2010
My Device: PlayBook 16GB, BB10 Dev Alpha
My Carrier: o2 (de)

Re: BB10 not receiving my pushes

My Dev Alpha is on 10.0.6.386, the most recent update that came out a couple of weeks ago.

 

Is it possible to check if my app registered successfully with the server? The app says "Creating push channel" > "Successfully registered" not only for my cpXXXX (with my four digit CPID), but also for every other ID like "cpXXX" (the value from my push services registration email).

 

Oh and one thing I noticed: the token I get returned from a successful registration is identical to my device PIN. Is that subject to change, too? Or something specific to the evaluation server?

- - -
My approved apps @ App World
Retired
Posts: 311
Registered: ‎08-08-2012
My Device: BlackBerry Z10
My Carrier: Rogers

Re: BB10 not receiving my pushes

Yep, sounds like you have the correct OS build.  I'm going to try to see if I can reproduce the issue myself.

 

With the eval environment, although the URL you hit is different based on your content provider ID, the underlying eval database will be the same for everyone.  Your app and device are successfully registered to receive pushes.  It's just a matter of getting to the bottom of why the push doesn't get to the app.  It wouldn't have been able to even get to the device itself if the registration hadn't been successful.

 

Yep, the token currently matches the device PIN at the moment, but this is subject to change in the future.

 

Matt

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

Re: BB10 not receiving my pushes

I just tried with a Dev Alpha device and I am able to successfully receive pushes.

But, after receiving the pushes, I can't seem to swip out of the app. 

Seems to be a weird quirk on the Dev Alpha devices.

 

Can you try keeping the app open and in the foreground when you send the push to it?

And, let me know what happens.

 

Thanks,

 

Matt

 

Developer
Posts: 270
Registered: ‎12-13-2010
My Device: PlayBook 16GB, BB10 Dev Alpha
My Carrier: o2 (de)

Re: BB10 not receiving my pushes

Weird. My app does not receive pushes wheather it's running or not.

I'm basically using a slightly modified version of the WebWorks sample code.

 

My additions / changes to the codebase include:

  • console log outputs to verify the correct initialization, registration and returned token
  • a changed app ID ('chrome2bb' instead of 'pushsample')
  • a custom invoke target id ('com.chrome2bb.app'), which I updated in config.xml and common.js (line 115)
  • my own author ID in the config.xml

Fact is: the event listener (common.js, line 484) gets added, but the onInvoke callback (line 506) is never executed.

 

Could one of my changes have messed things up? I couldn't avoid these (and just use the example code), because signing fails with the following error message (and debug tokens don't work for me for some mystical reason):

Oh Snap! Build request failed with message: [ERROR] Error: Code signing request failed because the Invoke-Target-Key [sample.pushcapture.invoke.target] has been previously used in a different package. [ERROR] Error: fail: 1Error: fail: 1 [ERROR] Native Packager exception occurred

I could mail you my code if you think that helps and DM me your email address...

- - -
My approved apps @ App World
Retired
Posts: 311
Registered: ‎08-08-2012
My Device: BlackBerry Z10
My Carrier: Rogers

Re: BB10 not receiving my pushes

Your additions / changes look correct to me.  Just curious, what app ID are you referring to that was previously "pushsample"?

 

Yes, that signing error is expected.  The documentation will be updated shortly to be clearer about changing the invoke target ID in your app if doing signing.  Basically, the signer enforces that every app has a unique invoke target ID to avoid the possibilty of getting another app's invoke event.

 

Just to rule any of your changes out, if you just change the invoke target ID in config.xml and common.js (and leave the rest of the sample unchanged), do you still not receive pushes?

 

I still have a couple of ideas about what might be going on.  I will try them out today and let you know by tomorrow morning.

 

Thanks,

 

Matt