dodevelopnshare

Blackberry Push Technology

9 Comments

What is Push Technology?

http://en.wikipedia.org/wiki/Push_technology

An Overview of Push Technology in Blackberry Platform

https://developer.blackberry.com/services/push/

Some important information related to Push APIs

http://supportforums.blackberry.com/t5/BlackBerry-Push-Development/Push-SDK-using-low-level-APIs/td-p/1173007

Basically, we need a Client-Side Application tolisten for Push Messages and a Server-side Application to fire Push Messages.

Server Side Push Application 

private static String password = “Your password here”;

private static String targetURL = “https://pushapi.eval.blackberry.com/mss/PD_pushRequest”;

private static final String APP_ID = “your app id here”;

public static void main(String[] args) throws PushSDKException, BadMessageException, UnauthorizedException {

org.apache.commons.codec.binary.Base64 b6;

//net.rim.pushsdk.acknowledgement.NotificationProcessorServiceImpl nsi;

IdGenerator idGenerator = new IdGeneratorImpl();

List<String> addresses = new ArrayList<String>();

String data = “this is a test message – 2”;

System.out.println(“Data is: ” + data);

addresses.add(“your PIN here”);

PushMessageControl pushMessageControl = new PushMessageControl(idGenerator, APP_ID, addresses);

Content content = new TextContent(data);

PapService papService = new net.rim.pushsdk.pap.PapServiceImpl();

PushSDKProperties properties = getBBProperties();

HttpClientImpl client = new HttpClientImpl();

client.setPushSDKProperties(properties);

papService.setHttpClient(client);

papService.setPushSDKProperties(properties);

PushResponse response = papService.push(APP_ID, password, APP_ID, pushMessageControl, content);

System.out.println(response.getDescription());

}

private static PushSDKProperties getBBProperties() {

PushSDKProperties p = new PushSDKPropertiesImpl();

p.setPpgAddress(targetURL);

p.setHttpIsPersistent(false);

p.setHttpConnectionTimeout(60000);

p.setHttpReadTimeout(120000);

p.setUsingXmlParserDtdValidation(false);

return p;

}

Client Side Application

http://supportforums.blackberry.com/t5/BlackBerry-Push-Development/Simplified-BIS-Push-client-sample/ta-p/693857

Advertisements

Author: Kanak Sony

I am Kanak, and I am a Developer, Most projects I have worked upon are developed using JAVA Technology. I have a great interest in BlackBerry Mobile Development. My activity included all areas of the software life-cycle - requirements analysis, design, implementation, maintenance and project management. This is all about work. In my free time I like to share with my family & Friend(s).

9 thoughts on “Blackberry Push Technology

  1. First of all Thanks for sharing these resources. Its really very needful.

    I have registered for push development and got the mail from RIM.
    In mail there is a field –
    PPG Base URL**
    https://pushapi.eval.blackberry.com

    and you have written in server side application-
    private static String targetURL = “https://pushapi.eval.blackberry.com/mss/PD_pushRequest”;

    Can you please let me know that Should I use ‘https://pushapi.eval.blackberry.com’ got from RIM or ‘https://pushapi.eval.blackberry.com/mss/PD_pushRequest’ you used.

    In client side application also what should be used for field –
    BPAS_URL = “http://pushapi.eval.blackberry.com”;

    Thanks in advance for your assistance.

  2. Thanks for sharing these resources. They are very helpful.
    I have also registered for Push notification and got mail from RIM.
    Can you please let me know what should I use in place of targetURL?
    Should i use targetURL = “https://pushapi.eval.blackberry.com/mss/PD_pushRequest” as you used or PPG Base URL** = “https://pushapi.eval.blackberry.com” got in mail from RIM

    and in client side application, in pushAgent class-
    BPAS_URL = “http://pushapi.eval.blackberry.com” is written;
    But in mail for client application following url is written
    PPG Base URL** – “http://cpXXX.pushapi.eval.blackberry.com”

    What you used for field ‘CONNECTION_SUFFIX’?

    Thanks in advance for your assistance.

  3. Hi ,
    Even i have received a mail with client application follwoing url
    PPG Base URL** – “http://cpXXX.pushapi.eval.blackberry.com”

    Please let us know how to use this

    Thanks

  4. Hi latha,

    What you have recieved in mail from RIM is an “eval URL”. Read your mail carefully, you will find –

    ** For evaluation use only.
    PPG Base URL** – “http://cpXXX.pushapi.eval.blackberry.com”

    On “eval” you must not prefix with your cpid. So, the BPAS URL will be –

    BPAS_URL = “http://pushapi.eval.blackberry.com”

    The only things you need in your BlackBerry app to register for the push service are:

    (1.) Push Application ID (e.g. 1234-c870l6c924r1i298O4o33cc5391y0e75134)
    (2.) Push Port (e.g. 12345)
    (3.) BlackBerry Push Server URL (e.g. http://pushapi.eval.blackberry.com)

    I hope it helps.

    • Thanks for the information.It really helped me.
      I have also receive a Push port . Should i use the same push port for registering via Client ?
      As i have an already existing port can i use it ?
      Please let me know .

      THanks

      • Yes, you should use the same port received in your mail from RIM. As, I haven’t tried with any other ports. You should give it a try and share your experience here. All the best..!!

  5. Hello Expert ,
    My BlackBerry Push Service validation is expired . Also now i am not receiving any confirmation on the new request . Is there any way where i can request for production details

  6. In this post,you are provide the information related to the push API.Basically, we need a Client-Side Application tolisten for Push Messages and a Server-side Application to fire Push Messages.
    Thanks for this.
    For more information please visit here advanced blackberry push notifications

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s