04-16-2013 09:05 AM - edited 04-16-2013 09:07 AM
I am trying to create a nodejs library to push stuff to a BB10 device. But it seems harder then expected and I don't find the documentation very usefull.
How do I see it?
1) My application asks the PushService for a token. The application gets a token back and sends the token to my NodeJS server. Right?
2) Because my server now knows the token of the device, he can send push messages to it by posting data to the PushService.
But how to post that data to the PushService?
I got this url from by registering with BlackBerry:
I changed the XXX to my own personal Content Provider ID. When I try to post something to that url with basic authentication, the server returns a 404 not found. Is the url corrupt or is it something I'm missing?
Solved! Go to Solution.
04-16-2013 09:22 AM
Are you using WebWorks to develop your application on the device?
There are developer guides to help you in that regard found here:
How are you trying to send out the push itself? You need to use PAP XML in your post. And, it does use basic authentication so it should not be giving you a 404 error if you are hitting the correct URL. What happens when you try to hit the URL through the browser?
We offer a Push Service SDK to help develop a Push Initiator to send out pushes, but that is written in Java so I'm not sure if it meets your needs. There are other developers out there using other languages for their Push Initiator so you might have to look around.
04-16-2013 09:30 AM
No I am using Cascades to do that. When I browse to the URL provided by blackberry (https://cpXXX.pushapi.eval.blackberry.com) and I change the XXX to my 4 digit CPID, I also get a 404 not found response. Should I mail them because it seems that the url provided, or my CPID is not correct...
04-16-2013 09:39 AM
Just to compare, what happens when you hit the general URL from your browser?
Or, you could send me a private message with your exact URL and I can try from my browser.
04-16-2013 09:54 AM
If you are using chrome and you go to network, you will see that it's a 404. I also have a blank page, but I guess on https, a 404 just returns a blank page...
Really really weird stuff...
04-16-2013 10:07 AM
Yes, you're right. I've never really noticed. But, your own specific PPG URL should be fine.
Remember to use http when registering from your app on the BlackBerry itself.
And, use the https version when sending out pushes.
04-17-2013 07:37 AM - edited 04-17-2013 07:42 AM
I try to send a push message to the https url but without any luck. This is the body of the message
--PMasdfglkjhqwert Content-Type: application/xml; charset=UTF-8 <?xml version="1.0"?> <!DOCTYPE pap PUBLIC "-//WAPFORUM//DTD PAP 2.1//EN" "http://www.openmobilealliance.org/tech/DTD/pap_2.1
.dtd"> <pap> <push-message push-id="1366197948976" source-reference="APPLICATION_ID"> <address address-value="DEVICE_TOKEN" /> <quality-of-service delivery-method="unconfirmed" /> </push-message> </pap> --PMasdfglkjhqwert Content-Encoding: binary Content-Type: text/html Push-Message-ID: 1366197948976 test --PMasdfglkjhqwert--
I send this to my PPG URL on port 443 (https). Is this correct?
Where I change the XXX to my personal CPID number. I use the following headers
Content-Type: multipart/related; boundary=PMasdfglkjhqwert; type=application/xml Authorization: Basic AUTH_TOKEN
Am I missing something?