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: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Does PAP push on BES10.1 work at all with BB10 10.1?

I've been methodically working my way through all three types of push (BIS pap, BES pap, and "RIM push") and have mostly got things working. Only one big issue left, which is the question in the thread's subject.

 

With a PAP push on BES (url ending with /pap and using a multipart/related MIME message with a <pap> element etc), I can deliver only to my Dev Alpha C running the latest 10.2 beta. Has anyone got it working with 10.1 and, if so, any idea what you're doing "special", or different from what I am below, to make it work?

 

In the MDS logs I can actually see it claiming it's sending two pushes but it arrives at my app only on the one device, despite identical code running on the two of them. I would say clearly this is an indication something is wrong with the way the application id is being sent through the various stages of the push though I could be wrong about that.

 

<DEBUG>:<LAYER = SCM, Pushing message to: [----c6ac, ----3a4d]>
<DEBUG>:<LAYER = SCM, Number of active push connections:1>

Following those lines above, the log shows activity only for the 3a4d PIN, which is the DAC running 10.2.

 

Both devices are configured identically on the server... associated with the same user. They're running identical code.

 

Here's my full post, with all CRLF and LF shown as \r\n and \n (and any actual line breaks are here merely for readability). All private data is replaced inside (# these markers #).

 

POST /pap HTTP/1.1\r\n
Host: (#hostname-here#):9080\r\n
Content-Length: 1047\r\n
Accept-Encoding: gzip, deflate, compress\r\n
Accept: */*\r\n
User-Agent: pusher.py v1.0.7\r\n
Content-Type: multipart/related; boundary=xxxx----Boundary----xxxx; type=application/xml\r\n
Authorization: Basic (#auth-data-here#)=\r\n
\r\n
--xxxx----Boundary----xxxx\r\n
Content-Type: application/xml\r\n
\r\n
<?xml version="1.0"?>\r\n
<!DOCTYPE pap PUBLIC "-//WAPFORUM//DTD PAP 2.0//EN" "http://www.wapforum.org/DTD/pap_2.0.dtd" [<?wap-pap-ver supported-versions="2.0"?>]>\r\n
<pap>\r\n
<push-message push-id="20130902023844-000$" source-reference="(#PackageName.PackageId#)" deliver-before-timestamp="2013-09-03T02:38:44Z">\n
<quality-of-service delivery-method="unconfirmed"/>\n
<address address-value="WAPPUSH=(#email%40hostname#)/TYPE=USER@rim.net"/>\n
</push-message>\n
</pap>\r\n
--xxxx----Boundary----xxxx\r\n
Push-Message-ID: 20130902023844-000$\r\n
X-Wap-Application-Id: (#PackageName.PackageId#)\r\n
\r\n
(PAYLOAD HERE)\r\n
--xxxx----Boundary----xxxx--\r\n

Here's the PPG's response:

HTTP/1.1 202 Accepted
Server: Apache-Coyote/1.1
Via: MDS_10.1.1.6
Content-Type: application/xml
Content-Length: 461
Date: Mon, 02 Sep 2013 02:38:45 GMT

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE pap PUBLIC "-//WAPFORUM//DTD PAP 2.0//EN" "http://www.wapforum.org/DTD/pap_2.0.dtd" [<?wap-pap-ver supported-versions="2.0"?>]>
<pap product-name="Research In Motion Ltd. MDSCS">
    <push-response 
        reply-time="2013-09-02T02:38:45Z" 
        sender-name="(#server#)" 
        sender-address="http://(#server#):9080/pap" 
        push-id="20130902023844-000$">

        <response-result code="1001"/>
    </push-response>
</pap>

And in case it helps anyone, the portion of the headers on the receiving side on 10.2 as read from my app's log. (In the next version I iterate over the headers to show them all but here the 512-character buffer limit in slog2 truncated the list.)

Push id:  "20130902022414-000$" 
Data length:  313 
Header count  11 
payload: "20130902022414-000$" 
headers: QMap(("Connection", QVariant(QString, "close") ) 
    ( "Content-Length" ,  QVariant(QString, "313") ) 
    ( "OST / HTTP/1.1" ,  QVariant(QString, "POST / HTTP/1.1") ) 
    ( "Push-Message-ID" ,  QVariant(QString, "20130902022414-000$") ) 
    ( "X-Wap-Application-Id" ,  QVariant(QString, "(#PackageName.PackageId#)") ) 
    ( "X-Wap-Push-OTA-Version" ,  QVariant(QString, "0") ) 
    ( "delivery-method" ,  QVariant(QString, "unconfirmed") ) 
    ( "host" ,  QVarian...

 


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Does PAP push on BES10.1 work at all with BB10 10.1?

Oh, very interesting. I updated the client to dump all the headers to the log for the received push, and it seems to me it reveals something. A bug in BES10? A mistake on my part in how the PAP push is configured? You tell me.

 

Data length:  313 
Header count  11 
payload: "20130902144059-000$" 
"Connection" :  QVariant(QString, "close") 
"Content-Length" :  QVariant(QString, "313") 
"OST / HTTP/1.1" :  QVariant(QString, "POST / HTTP/1.1") 
"Push-Message-ID" :  QVariant(QString, "20130902144059-000$") 
"X-Wap-Application-Id" :  QVariant(QString, "(#PackageName.PackageId#)") 
"X-Wap-Push-OTA-Version" :  QVariant(QString, "0") 
"delivery-method" :  QVariant(QString, "unconfirmed") 
"host" :  QVariant(QString, "(#server#):9080") 
"push-id" :  QVariant(QString, "20130902144059-000$") 
"x-rim-deviceid" :  QVariant(QString, "----c6ac") 
"x-rim-devicepin" :  QVariant(QString, "----3a4d") 

Note the last two headers... what the heck? Those are my two PINs, for both devices on that user's account. The "x-rim-deviceid" one has the PIN for the device with 10.1, which did not receive the push.  The "x-rim-devicepin" one has the PIN for the 10.2 device which got this push.

 

How can that be a good thing?


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Does PAP push on BES10.1 work at all with BB10 10.1?

If I push by PIN only to that one device ----3a4d then I get the same PIN in both fields:

"x-rim-deviceid" :  QVariant(QString, "----3a4d") 
"x-rim-devicepin" :  QVariant(QString, "----3a4d") 

I should also note that attempting to push only to the other PIN, the one running 10.1, I get a 3012 error. That may not be related to 10.1 vs 10.2, though... I have only the one 10.2 device with which to test this. I guess I could downgrade it to 10.1 and compare the results... maybe it would still get the push, in which case I could eliminate the OS version as being involved. This is probably just about BES10...


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Does PAP push on BES10.1 work at all with BB10 10.1?

And for comparison, when using RIM push to send to both devices (via the shared email address).

"Connection" :  QVariant(QString, "close") 
"Content-Length" :  QVariant(QString, "313") 
"OST / HTTP/1.1" :  QVariant(QString, "POST / HTTP/1.1") 
"X-Wap-Application-Id" :  QVariant(QString, "(#PackageName.PackageId#)") 
"accept" :  QVariant(QString, "*/*") 
"accept-encoding" :  QVariant(QString, "gzip, deflate, compress") 
"delivery-method" :  QVariant(QString, "unconfirmed") 
"host" :  QVariant(QString, "(#server#):9080") 
"push-id" :  QVariant(QString, "20130902151805-000$") 
"user-agent" :  QVariant(QString, "pusher.py v1.1.0") 
"x-rim-deviceid" :  QVariant(QString, "----c6ac") 
"x-rim-devicepin" :  QVariant(QString, "") 

Note that the x-rim-devicepin is empty in this case, but the x-rim-deviceid field is actually from the OTHER device.

 

Actually the above is what appears in the headers on BOTH devices, so again there's an issue with the PIN and, I suspect, it's related to why push doesn't work properly in all cases on BB10, at least with /pap.


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Retired
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: Does PAP push on BES10.1 work at all with BB10 10.1?

Pushing via email address may be the culprit here, if you need to push to multiple devices associated with the same user then PIN is the recommended (albeit less easy) way to go.

 

With BES if the push gets successfully delivered to one device (when using email for addressing) it is seen as successful. I have not heard of the BES simply not even attempting to push to the second device, but will check with some internal folks that have more experience on the BES side of push.

Garett
@garettBeuk
--
Goodbye everybody!
Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Does PAP push on BES10.1 work at all with BB10 10.1?

Hmm... from what you're saying then, not only would email be an issue (if you wanted all of a user's devices to get the push), but so would using a User Group name (as in $SomeUserGroup).

Something to keep in mind for sure. Is this documented anywhere aside from your post?

Also note that as I said above, pushing by PIN to the 10.2 device works, but pushing by PIN to the 10.1 device doesn't. "I should also note that attempting to push only to the other PIN, the one running 10.1, I get a 3012 error."

The info about email is helpful, but something tells me there's more to this issue than just that. Seeing both PINs show up in the push that the one device receives, in different headers, seems pretty odd as well.

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Retired
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: Does PAP push on BES10.1 work at all with BB10 10.1?

The way push to emails with multiple associated devices functions was taken, in part, from the way that pushes to groups works, except with groups it's the opposite, if one person in a group fails (ex with a 403) then they all fail.

 

The Enterprise side of app dev is still in progress, so not listed anywehere else that I'm aware of just yet.

 

I did confer with a colleague that has tested the same scenario and he was able to get the push to both devices, so there may be an odd issue with the one device/configuration that is causing the problem moreso than the architecture.

Garett
@garettBeuk
--
Goodbye everybody!