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: 17,012
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany
Accepted Solution

Sample Code for Client Software (simplified)

After digging through the whole sample application RIM provides i thought i'd provide a simplified sample code. Short notice: posting the connection suffix is not allowed on the forums. You can check the sample app from RIM if you did not already find it somewhere else. please see the KB article here, it is up for review if you want to contribute (albeit the code is mainly in the attached files): http://supportforums.blackberry.com/t5/BlackBerry-Push-Development/Simplified-BIS-Push-client-sample...
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 17,012
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Sample Code for Client Software (simplified)

the article has been published: http://supportforums.blackberry.com/t5/BlackBerry-Push-Development/Simplified-BIS-Push-client-sample...
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 58
Registered: ‎01-14-2010
My Device: 9000
My Carrier: Rogers

Re: Sample Code for Client Software (simplified)

I am little confused on the client registering with the BIS-Push Server. According to the code sample an http register request is made to the BIS-Push Server with only the app id, os version and model number. Since the client is registering itself should it provide the BB PIN too so that the server has a unique way of identifying with user is registering?

Developer
Posts: 17,012
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Sample Code for Client Software (simplified)

i think the BIS infrastructure identifies the device without needing the pin. when you register with your content provider you need the device pin.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Highlighted
Developer
Posts: 43
Registered: ‎10-03-2008
My Device: Not Specified

Re: Sample Code for Client Software (simplified)

This code has been working very well for us for a while, but it doesn't seem to be working on OS 6.x devices for us, only on 5.0 and earlier. Anyone else seeing this?

New Developer
New Developer
Posts: 13
Registered: ‎02-01-2009
My Device: Not Specified

Re: Sample Code for Client Software (simplified)

Simon - 

 

Any reason why you chose to use the PushLib43 instead of PushLib50 for the example?

Developer
Posts: 17,012
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Sample Code for Client Software (simplified)

 


akc wrote:

Simon -

 

Any reason why you chose to use the PushLib43 instead of PushLib50 for the example?


 

the difference is small, you can easily adjust. most of our products are not OS5+ as customers, especially in the corporate environment, are sometimes hesistant to upgrade.

(i respectfully declined the question about developing on JDE 3.6 though)

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Super Contributor
Posts: 306
Registered: ‎08-10-2010
My Device: Not Specified

Re: Sample Code for Client Software (simplified)

hi 

thanks for your simplified code.

with the help of your code i successfully register my devices to the BIS server

 

but my question is

in your code you use ServerSocketConnection which block the application until its connection is open

in blackberry demo app they not use the ServerSocketConnection.

you also use PushInputStream class which is not used in demo app.why you use ServerSocketConnection

 

i want to develop  enterprise application in which Push Notification is added.so what i have to implement ServerSocketConnection or use the technology given in the PushSDK demo.

 

 

hope for the Positive response

thanks



Visitor
Posts: 1
Registered: ‎07-01-2011
My Device: 9800
My Carrier: Vodafone

Re: Sample Code for Client Software (simplified)

Hi Simon,

 

I tried myself to port this to work for 5.0+ devices, couldn't get ahead much since i am an absolute beginner. Could you help me port this to 5.0+? I want to get it working on an app for 6.0 but i hope 5.0+ should work for 6.0 too. Any help would be highly appreciated.

 

Thanks

Ranganath

New Contributor
Posts: 8
Registered: ‎07-12-2011
My Device: Blackberry Torch 9800

Re: Sample Code for Client Software (simplified)

Hi can you please tell me how to register to content provider from the BB device.