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: 70
Registered: ‎05-04-2009
My Device: Blackberry 9800/Blackberry 9530/Blackberry 9700/Blackberry 8530
My Carrier: T-Mobile/Wifi
Accepted Solution

Push API sample code needed

[ Edited ]

Mark, Would you be able to post an example of a request to make a push notification to push.eval.blackberry.com I figured out the client side on the handheld I just need to learn how to push the notification to the client.

If you find this post useful please give kudo's
Developer
Posts: 70
Registered: ‎05-04-2009
My Device: Blackberry 9800/Blackberry 9530/Blackberry 9700/Blackberry 8530
My Carrier: T-Mobile/Wifi

Re: Push API sample code needed

Pretty much I'm looking for a sample PAP push to push.eval.blackberry.com. I understand there is a browser push but I want to do a push to a java application

If you find this post useful please give kudo's
BlackBerry Development Advisor
Posts: 15,700
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Push API sample code needed

Currently all sample code for the BlackBerry Push Service is included with the BlackBerry Push SDK.  We do not have further samples available at this time.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
Posts: 70
Registered: ‎05-04-2009
My Device: Blackberry 9800/Blackberry 9530/Blackberry 9700/Blackberry 8530
My Carrier: T-Mobile/Wifi

Re: Push API sample code needed

Can you point me in the right direction I've looked all over the jar files included and cannot find a HTTP request thats posts to push.eval.blackberry.com

If you find this post useful please give kudo's
Developer
Posts: 19
Registered: ‎05-28-2009
My Device: Not Specified

Re: Push API sample code needed

Just shoot an email to blackberry developer support they will provide you a sample code. I did the same.

Developer
Posts: 70
Registered: ‎05-04-2009
My Device: Blackberry 9800/Blackberry 9530/Blackberry 9700/Blackberry 8530
My Carrier: T-Mobile/Wifi

Re: Push API sample code needed

Ah ok, I figured the forums would get me a quicker response since RIM does monitor them.

If you find this post useful please give kudo's
Contributor
Posts: 13
Registered: ‎02-18-2010
My Device: 8910
My Carrier: China Mobile

Re: Push API sample code needed

after the installation,

the sample server source code is here:
BPSS\pushsdk\sample-app\sample-app-1.0.0.5-sources.jar
check SampleApplication.java for push data using API net.rim.pushsdk.push.PushBeanLocator.

Developer
Posts: 70
Registered: ‎05-04-2009
My Device: Blackberry 9800/Blackberry 9530/Blackberry 9700/Blackberry 8530
My Carrier: T-Mobile/Wifi

Re: Push API sample code needed

That still doesn't help, The server that will be sending the push results is PHP, I have no access to install Tomcat or anything Java. So I need to build a PHP push server using PHP and CURL.

If you find this post useful please give kudo's
Developer
Posts: 70
Registered: ‎05-04-2009
My Device: Blackberry 9800/Blackberry 9530/Blackberry 9700/Blackberry 8530
My Carrier: T-Mobile/Wifi

Re: Push API sample code needed

After doing a bit of packet sniffing I was able to figure out the request and port it over to a PHP script but push.eval.blackberry.com is reporting "Error

The content you have requested is not available

PD_pushRequest command is not currently in service!"

 

<?php
// create a new cURL resource
$ch = curl_init();

$data = '--mPsbVQo0a68eIL3OAxnm'. "\r\n" .
'Content-Type: application/xml; charset=UTF-8' . "\r\n\r\n" .
'<?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="4V7oyJQezIR-1269707554176" deliver-before-timestamp="2010-03-27T16:32:44Z" source-reference="309-R34M5hf50MMc2m55">
<address address-value="push_all"/>
<quality-of-service delivery-method="unconfirmed"/>
</push-message>
</pap>' . "\r\n" .
'--mPsbVQo0a68eIL3OAxnm' . "\r\n" .
'Content-Type: text/plain' . "\r\n" .
'Push-Message-ID: 4V7oyJQezIR-1269707554176' . "\r\n\r\n" .
'It is currently, 11:32:34 AM on Saturday March 27, 2010!' . "\r\n" .
'--mPsbVQo0a68eIL3OAxnm--' . "\n\r";

// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, "http://push.eval.blackberry.com/mss/PD_pushRequest");
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_USERAGENT, "BlackBerry Push Service SDK/1.0");
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_USERPWD, "");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: multipart/related; boundary=mPsbVQo0a68eIL3OAxnm; type=application/xml"));
curl_setopt($ch, CURLOPT_VERBOSE, true);

// grab URL and pass it to the browser
curl_exec($ch);

// close cURL resource, and free up system resources
curl_close($ch);
?>

 

If you find this post useful please give kudo's
Developer
Posts: 142
Registered: ‎08-02-2009
My Device: Z10
My Carrier: T-Mobile

Re: Push API sample code needed

Possibly the URL is

http://pushapi.eval.blackberry.com/mss/PD_pushRequest

I am trying to port the push to .net/C# but I am hardly searching all the URL's to subscribe, push etc...

 

Do you got these URL's?