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
BlackBerry Development Advisor (Retired)
mdandrea
Posts: 311
Registered: ‎08-08-2012
My Device: BlackBerry Z10
My Carrier: Rogers

Re: BES10 Push Question

Why does it say <?wap-pap-ver supported-versions="2.1"?> in the built message but 2.0 in the code?  It should be 2.0.

Also, X-Wap-Application-Id should be a header in your content that you're pushing.  For some reason, it's not there in the built message you show.

 

There also are some restrictions on the new line characters you have to use and where to put them in the PAP request as well.  I'll double check those for you first thing tomorrow morning.

Please use plain text.
Contributor
jeffery_chen
Posts: 18
Registered: ‎04-05-2013
My Device: Z10
My Carrier: Blackberry

Re: BES10 Push Question

Oh yeah, the 2.1 thing was something I saw on a blog post, I forgot to change it before I copied and pasted it. The built message is correct, and is the one i sent to BES. As for the X-Wap-Application-Id, I added it using the HttpWReq.Headers.Add("X-Wap-Application-Id",appid);. Should I add it one way or both?

 

In terms of the new line characters, I had a feeling that they might be a problem. However, I couldn't find any particular resource which helps me identify the places where I should put the new line characters.

 

Thanks for your help.

Please use plain text.
BlackBerry Development Advisor (Retired)
mdandrea
Posts: 311
Registered: ‎08-08-2012
My Device: BlackBerry Z10
My Carrier: Rogers

Re: BES10 Push Question

The X-Wap-Application-Id header is only needed in the content of the push.

 

I think the PAP spec outlines where new line characters are needed, but it can be tricky so I went back to our SDK code to see what was done to help give you an example.

 

Here's an example with the new line characters explicitly shown to help you to know where to put them.

 

 --some_boundary\r\n

Content-Type: application/xml; charset=UTF-8\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='some_push_id' deliver-before-timestamp='2013-04-11T10:19:55Z'>\n
<address address-value='some_PIN' />\n
 <quality-of-service delivery-method='confirmed'/>\n
 </push-message>\n
 </pap>\r\n
 --some_boundary\r\n
Content-Type: text/plain\r\n
Push-Message-ID: some_push_id\r\n

X-Wap-Application-Id: some_app_id\r\n\r\n
Test Content\r\n
--some_boundary--\r\n

 

Hope that helps!

 

Matt

Please use plain text.
Contributor
jeffery_chen
Posts: 18
Registered: ‎04-05-2013
My Device: Z10
My Carrier: Blackberry

Re: BES10 Push Question

Fantastic, the newline characters were the problem. Thanks! 

Please use plain text.
Contributor
jeffery_chen
Posts: 18
Registered: ‎04-05-2013
My Device: Z10
My Carrier: Blackberry

Re: BES10 Push Question

Hi Matt. I am getting a 2002 error. Which is "The specified PIN is not recognized." I double checked my device PIN and the appid, and both are correct. My device is also registered on the BES server. I am not sure why I am getting the error. 

 

This is my server log. 

PapServlet: request from [XX.XX.XXX.XXX 608 bytes] >
<2013-04-11 11:31:28.662 EDT>:[3756]:<xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>:<DEBUG>:<LAYER = SCM, , EVENT = PAP request, content-type = multipart/related;type="application/xml";boundary=asdfasdfasdfasdf, connection = Keep-Alive, expect = 100-continue, host = servername:smileytongue:ort, content-length = 608>
<2013-04-11 11:31:28.673 EDT>:[3757]:<xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>:<DEBUG>:<LAYER = SCM, Mapping PAP request to push request for pushID:abcdefg>
<2013-04-11 11:31:28.674 EDT>:[3758]:<xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>:<DEBUG>:<LAYER = SCM, PushServlet: POST request from [UNKNOWN @ XX.XX.XXX.XXX] to [PAPDEST=DEVICE_PIN&PORT=7874&REQUESTURI=/]>
<2013-04-11 11:31:28.674 EDT>:[3758]:<xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>:<DEBUG>:<push id: abcdefg>
<2013-04-11 11:31:28.675 EDT>:[3759]:<xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>:<DEBUG>:<LAYER = SCM, submitting push message with id:abcdefg>
<2013-04-11 11:31:28.681 EDT>:[3760]:<xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>:<DEBUG>:<LAYER = SCM, PAP push-id abcdefg returned status code 2002>

 

Is there anything else I have to subscribe to on the device besides being on BES for me to be able to receive PUSH notifications?

 

Thanks,

 

Jeff

 

Please use plain text.
BlackBerry Development Advisor (Retired)
mdandrea
Posts: 311
Registered: ‎08-08-2012
My Device: BlackBerry Z10
My Carrier: Rogers

Re: BES10 Push Question

Sorry Jeff.  

The address tag was wrong in the example I sent you (I was adapting a BIS example).

 

Try this for your address tag in your request:

<address address-value="WAPPUSH=some_pin/TYPE=USER@rim.net"/>

 

Replace some_pin with your device's PIN.

 

Thanks,

 

Matt

Please use plain text.
Contributor
jeffery_chen
Posts: 18
Registered: ‎04-05-2013
My Device: Z10
My Carrier: Blackberry

Re: BES10 Push Question

Thanks  Matt. Btw, is there a special format for the appid as well?. Currently I am entering an alphanumeric string. 

 

-Jeff

Please use plain text.
BlackBerry Development Advisor (Retired)
mdandrea
Posts: 311
Registered: ‎08-08-2012
My Device: BlackBerry Z10
My Carrier: Rogers

Re: BES10 Push Question

No, it should just be whatever you see for the application package identifier for the app on the Manage Applications screen for BES 10.

Please use plain text.
Contributor
jeffery_chen
Posts: 18
Registered: ‎04-05-2013
My Device: Z10
My Carrier: Blackberry

Re: BES10 Push Question

That's strange. I am getting an exception on my server logs:

 

SendPushMessages Exception: Application with ID = alphanumeric_string not found for destination: device_pin>

PAP push-id abcdefg returned status code 3012>

 

Don't know if app ids are all the same lenghts, but my application id is 27 characters long. 

I double checked the app id and it is the one found on the manage applications screen. 

 

I found this page http://docs.blackberry.com/en/admin/deliverables/50897/cs_push_request_bes_pap_900476_11.jsp . 

I know it's for BES 6, but a lot of it are similar, however, it left the X-Wap-application-Id part blank except the /. I have tried putting the / behind and infront of the app id, to no avail. 

 

Thanks,

Jeff

Please use plain text.
BlackBerry Development Advisor (Retired)
mdandrea
Posts: 311
Registered: ‎08-08-2012
My Device: BlackBerry Z10
My Carrier: Rogers

Re: BES10 Push Question

The error you're geting - 3012 means this (pulling the error code description from our SDK):

 

/**
* <b>This is an enterprise/BDS status code only.</b> The PPG could not deliver the message because there is no application
* with the application id specified. The BDS server will validate the application id being pushed to is in fact installed on
* the device. For an enterprise (BDS) push, you must use the application package identifier as the application id or if you
* want to use a content provider custom application id you must turn off application id validation by configuring the
* property <code>push.application.validation=false</code> located in the <code>rimpublic.properties</code> of the BDS/MDSCS. <br/>
* <b>Status code:</b> 3012

* @since 1.2
*/
public static final StatusCode PUSH_APPLICATION_NOT_INSTALLED = new StatusCode("3012",
"The PPG could not deliver the message because there is no application with the application id specified.");

 

BES 10 behaves slightly different for push than BES 6 did so you can't really go by those docs.

 

Could you send me a screenshot in a private message of the spot you're getting the application ID from?

 

Thanks,

 

Matt

 

Please use plain text.