01-15-2013 08:29 AM
I am trying to create push server for sending push notifications on Blackberry devices using BIS in C#. I have registered for eval and received an email with all the related information.
Also, I got some samples for the PAP xml generated for sending notification to device.
But whenever I send that request, I get "Unauthorised" in response.
The request looks like:
--PMasdfglkjhqwert123 Content-Type: application/xml; UTF-8<?xml version="1.0"?>
<!DOCTYPE pap PUBLIC "-//WAPFORUM//DTD PAP 2.1//EN" "http://www.openmobilealliance.org/tech/DTD/pap_2.1
<push-message push-id="1358164672884" source-reference="app id received in email"
<address address-value="device pin"/>
Does the url i am sending this request to is correct ? The url is : https://cpxxxx.pushapi.eval.blackberry.com/mss/PD_
Also, Plz tell me the steps for implementing Push server for BB.
Is Tomcat necessary in case of C# (.NET)?
What i know is first the device registers to RIM. (we r able to register)
Then the details are passed to push server for registering content provider. (How to do this?)
Then the request is made to send notification on device (when needed). (got the request format, but don't understant why I am getting "Unauthorised").
Its urgent and I am not getting any sample or link.
Thanks in advance.
Solved! Go to Solution.
01-15-2013 08:35 AM
You need to perform basic authentication. http://en.wikipedia.org/wiki/Basic_access_authenti
Are you providing the Authorization header with your App ID and password as part of your HTTP request?
01-15-2013 08:43 AM - edited 01-15-2013 08:45 AM
Thanks for reply.
Yes i am providing "Authorization" header in request header. The value is something like
Basic <base64string of appID and password>
Plz tell what is the Content Provider registration part and how we can do it ?
01-15-2013 08:46 AM
The registration piece needs to be done, but that doesn't explain why you are getting Unauthorized on a push.
Are you sure your Authorization header is set correctly?
Do you have a colon ( in between the App ID and password before you base64 encode the whole string?
01-15-2013 08:50 AM
Yes, there is a colon in between AppID and Password before encoding string to Base64.
Also the word "Basic" + space is added after the above string is encoded to Base64. Right?
Is there some chance of difference in the encoded strings by C# and Java ?
Also plz check the url in original post which I am using for sending request. Is it Ok ?
01-15-2013 08:56 AM
The URL you are sending the push to looks correct.
And, no, there is no difference in the encoded strings between C# and Java.
Just curious, how long ago did you register with eval? Could your application be expired maybe?
01-15-2013 09:00 AM - edited 01-15-2013 09:05 AM
I am recieving response now. It was some problem in Base64 encoding. Plz let me know what should be the "deliver-before-timestamp" in request.
Ok, I am receiving a success now.
Some problem in Base64 encoding.
Is it mean that device should receive a Notification ?
Bcoz I am not receiving any.
Or there is some more to go ?
01-15-2013 09:05 AM
It's a date. It's the date the push should be delivered before. If the push has not been delivered before that timestamp is reached, then the push will expire.
Typically, we recommend setting it to one to two hours after the current time.
But, you can set it to what you'd like.
01-15-2013 09:31 AM
In order to receive pushes, you have to register to the BlackBerry Push Service from your push-enabled application running on your BlackBerry itself. Did you write your own app to receive pushes or are you using a sample one?
01-15-2013 11:57 PM - edited 01-16-2013 04:31 AM
Now I am getting a success at push server in response of that PAP request.
also, I am able to register Blackberry device, by my own app.
But no push notification received on device. I implemented push notification receiving code.
But no notification received on device.
Also, plz let me know how we get the "Boundary" value in PAP push request ?