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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

BlackBerry Push Development

Reply
Developer
massimo_olive
Posts: 235
Registered: ‎11-08-2010

Java Class for Pushing (low level)

I thought I would post some code to show how I use the Push SDK low level JARs to push content. Other than List and ArrayList the rest of the classes are all from the SDK:

 

IdGenerator idGenerator = new IdGeneratorImpl();

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

addresses.add("<put device PIN here>");

 

PushMessageControl pushMessageControl = new PushMessageControl(idGenerator,

pushAppId, addresses);

Content papContent = new TextContent("Information I want to push here");

 

PushResponse response = papService.push(pushAppId, password, pushAppId, pushMessageControl, papContent);

 

 

Please use plain text.
Developer
massimo_olive
Posts: 235
Registered: ‎11-08-2010

Re: Java Class for Pushing (low level)

IdGenerator idGenerator = new IdGeneratorImpl();

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

addresses.add("<put device PIN here>");

 

PushMessageControl pushMessageControl = new PushMessageControl(idGenerator,

pushAppId, addresses);

Content papContent = new TextContent("Information I want to push here");

 

PapService papService = PapBeanLocator.getPapService();

PushResponse response = papService.push(pushAppId, password, pushAppId, pushMessageControl, papContent);



Please use plain text.