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
New Developer
kavita038
Posts: 40
Registered: ‎12-17-2011
My Device: Blackberry 9550

Client side application for push

Hello All,

 

Can anyone plz provide me sample code for client side application for JDE 5.0?

Server side code would be written in PHP.

 

I have installed push sdk, but where to find the source code to implement push service in my application?

Don't know from where to start?

 

Any help would be highly appreciated.

 

Thanks In Advance.

 

Retired
mdandrea
Posts: 311
Registered: ‎08-08-2012
My Device: BlackBerry Z10

Re: Client side application for push

Hi!

 

For the server-side part (your Push Initiator), here's some documentation on the Push Service SDK:

http://docs.blackberry.com/en/developers/subcategories/?userType=21&category=Push+Service

Note that the APIs are in Java.

 

For the client-side part (your push-enabled application), are you looking to write something for BlackBerry 10 or which version of the BlackBerry OS exactly?

 

Thanks,

 

Matt

 

 

Retired
marco_dicesare
Posts: 76
Registered: ‎08-08-2012
My Device: BlackBerry Z10

Re: Client side application for push

Sample code for writing a client side application for JDE 5.0 is provided with the Push Service SDK download:

 

eg: <PushServiceSDK-insatll dir>\pushsdk-low-level\sample-push-enabled-app\sample-push-enabled-app-1.1.0.17-sources.jar

 

If you are looking for PHP code for your server-side application you can search these forums there are a few posts by other community memebers that have sample code you can use. The Push Service SDK currently is only available for Java server-side applications. If you are looking for the server-side API to the BlackBerry Push Service to implement yourself in PHP see: BlackBerry Push Access Protocol

 

New Developer
kavita038
Posts: 40
Registered: ‎12-17-2011
My Device: Blackberry 9550

Re: Client side application for push

Thanks @mdandrea and @marco_dicesare for reply.

 

 I don't need server side code, its implemented already. My requirement is to write only client side implementation for BB 5.0 to 7.1 (as i mentioned in my post above , JDE 5.0).

For this I searched the forums and implemented these classes from this link

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

 

Are These two classes are sufficient ?

 

 For PUSH_PORT = "My port"; BPAS_URL = "http://pushapi.eval.blackberry.com";

 APP_ID = "your secret key"; CONNECTION_SUFFIX = ";deviceside=false;ConnectionType=seekrit string";

 

I enetred push port and app id provided by rim.  BPAS_URL is at it is (I haven't changed it) .I tried

1)  CONNECTION_SUFFIX = ";deviceside=false";

2)  CONNECTION_SUFFIX = ";interface=wifi"; (in case wifi was available )

both .

ConnectionType=seekrit string" don't know about this value.

 

after calling registerBpas() it throws IoException at httpconnection opening.

 

Can u plz guide what to do? these two classes are sufficient or i need to include low level apis?

 

 

Retired
mdandrea
Posts: 311
Registered: ‎08-08-2012
My Device: BlackBerry Z10

Re: Client side application for push

Can you show me the full stack trace for the IOException?  That might help to debug what is going on.

 

Thanks,

 

Matt

Retired
marco_dicesare
Posts: 76
Registered: ‎08-08-2012
My Device: BlackBerry Z10

Re: Client side application for push

@kavita038 - I can't comment on those two classes you pulled from the link; they very well may wor. I would recommend you look at the source code for the client sample application I referred to you above. It has been written and tested against different versions of BBOS.

 

Sample code for writing a client side application for JDE 5.0 is provided with the Push Service SDK download:

 

 <PushServiceSDK-insatll dir>\pushsdk-low-level\sample-push-enabled-app\sample-push-enabled-app-1.1.0.17-sources.jar

Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: Client side application for push

Is there a REST interface to the push initiator that can be used?

Retired
marco_dicesare
Posts: 76
Registered: ‎08-08-2012
My Device: BlackBerry Z10

Re: Client side application for push

You write the push initiator so you can define whatever interface you want between your hand held application and server-side application. The SDK sample apps show just using vanilla HTTP requests.

 

The interface between the push intiator and BlackBerry Push Service is PAP XML only at this time.

 

Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: Client side application for push

So the BB Push server does not have a REST interface? We have to host our own server code to push a message to an app on the device? Just want to make certain I understand this correctly?
Retired
marco_dicesare
Posts: 76
Registered: ‎08-08-2012
My Device: BlackBerry Z10

Re: Client side application for push

You must write an application (server-side) that initiates the push request messages to the BlackBerry Push Service.