04-24-2012 09:45 AM
I have to implement push notifications on client-side using net.rim.blackberry.api.push. As far as I understood, there is no way to pass some device- or user-specific data during registration (I mean registerApplication() in PushApplicationRegistry) so my push initiator won't be able to send notifications only to some specific devices, not to all registered with given app id. Is that right?
On the other hand, I know that using server-side library net.rim.pushsdk I can specify some addresses to which notification will be sent. They are stored in PushMessageControl instance which is passed to method net.rim.pushsdk.pap.PapServiceImpl.push() . Could you please explain me what these addresses are and how can I send them from client when registering for notifications?
Or maybe I'm totally lost in all this stuff...
Thanks in advance
Solved! Go to Solution.
05-01-2012 09:07 AM
Here is a simple code to push to BIS.
List<String> addresses = new ArrayList<String>();
PushMessageControl pushMessageControl = new PushMessageControl(idGenerator, APP_ID, addresses);
Content content = new TextContent(data);
PapService papService = new net.rim.pushsdk.pap.PapServiceImpl();
PushSDKProperties properties = getProperties();
HttpClientImpl client = new HttpClientImpl();
PushResponse response = papService.push(APP_ID, password, APP_ID,pushMessageControl, content);
Just add the PIN(s) you want to send to into the addresses list.