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

Java Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Developer
Posts: 571
Registered: ‎04-11-2009
My Device: BB 10 Dev Alpha
Accepted Solution

Blackberry Push : Server Side application requisites

Hi all,

 

I want to know about Server Side application requirements.
 

  1. I have some Notifications in my application. 
  2. My application use to pull the data from some webservices after specific Interval, or manual Pull (refresh).
  3. This data is in form of JSON, which I parse and then use it to show notification in my app.
  4. Now, if I change this Pulling to "Blackberry Push Notifications", what changes will I need to do at Server side.
  5. If I am right, I will need to make a Server side Java application. And then, this application will communicate with My Webservices to fetch the required data. After getting the data, this application will push the data (along the device PIN to which Push Notification need to be send ) to PPG by configuring Push Services SDK.

"Please clear me If I am wrong here.."


 

Uptill I have done :

 

  1. I have registered for Push Notification by filling Blackberry Push Evaluation Form. And, waiting for response from RIM. 
  2. Downloaded the Push Service SDK v1.1.0 , and installed successfully.

 

Regards,
Kanak Sony
------------------------------------------------------------------------------------------
http://dodevelopnshare.wordpress.com/ | http://www.linkedin.com/profile/view?id=188131481&trk=tab_pro
Developer
Posts: 17,025
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Blackberry Push : Server Side application requisites

you can leave the pull architecture of your app, just switch it to triggered (by push) instead of timed.

the server part has to send a message in PAP format to an address on the bis infrastructure RIM gives you.
----------------------------------------------------------
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: 571
Registered: ‎04-11-2009
My Device: BB 10 Dev Alpha

Re: Blackberry Push : Server Side application requisites

Thanks Simon for your quick response.

 

I have got some sample code from Push development forum:

 

public class ServerPushSample {
 
    
    private static String password = "xxxxxx";
	private static String targetURL = "https://pushapi.eval.blackberry.com/mss/PD_pushRequest";
	private static final String APP_ID = "xxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
        
        	public static void main(String[] args) throws PushSDKException, BadMessageException, UnauthorizedException {
		try{
                        //Arraylist that will hold list of all devices to which is Push needs to be send
			List<String> pins = new ArrayList<String>();
                        //add our Device PIN Number
			pins.add("Kanak");
                        //generate unique ids
			IdGenerator idGenerator = new IdGeneratorImpl();
                        //An instance of the Push PAP request message control using uniqueId, appid, and list of PINs
			PushMessageControl pushMessageControl = new PushMessageControl(idGenerator, APP_ID, pins);
			//Content to be pushed
                        Content content = new TextContent("My First Test Notification Text");
			//PapService instance which is  initialized by PapServiceImpl, required to
                        //send PAP 2.1/2.0 XML to a Push Proxy Gateway (PPG) and parse the PAP XML responses.
                        PapService papService = new net.rim.pushsdk.pap.PapServiceImpl();
                        PushSDKProperties properties = getProperties();
			HttpClientImpl client = new HttpClientImpl();
			client.setPushSDKProperties(properties);
			papService.setHttpClient(client);
			papService.setPushSDKProperties(properties);
		try{
			PushResponse response = papService.push(APP_ID, password, APP_ID, pushMessageControl, content);
			System.out.println("response : "+response.getDescription());
		}catch(NullPointerException ex){
			ex.printStackTrace();
		}

		} catch (Exception e) {
			e.printStackTrace();
		}
	}
                
                private static PushSDKProperties getProperties() {
			PushSDKProperties p = new PushSDKPropertiesImpl();
			p.setPpgAddress(targetURL);
			p.setUsingPublicPush(true);
			p.setHttpIsPersistent(false);
			p.setHttpConnectionTimeout(60000);
			p.setHttpReadTimeout(120000);
			p.setUsingXmlParserDtdValidation(false);
		return p;
	}

}

 

   Is it a right PAP format?

Regards,
Kanak Sony
------------------------------------------------------------------------------------------
http://dodevelopnshare.wordpress.com/ | http://www.linkedin.com/profile/view?id=188131481&trk=tab_pro
Developer
Posts: 17,025
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Blackberry Push : Server Side application requisites

yes
----------------------------------------------------------
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: 571
Registered: ‎04-11-2009
My Device: BB 10 Dev Alpha

Re: Blackberry Push : Server Side application requisites

Thanks for confirming Simon, I have some large data more tha 8 KB and images too, which I need to push on my device, how can I do that?

Regards,
Kanak Sony
------------------------------------------------------------------------------------------
http://dodevelopnshare.wordpress.com/ | http://www.linkedin.com/profile/view?id=188131481&trk=tab_pro
Developer
Posts: 17,025
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Blackberry Push : Server Side application requisites

as i already said, push a short message and let the client pull the data.
push is to notify, not necessarily to bring all the data to the device.
----------------------------------------------------------
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: 571
Registered: ‎04-11-2009
My Device: BB 10 Dev Alpha

Re: Blackberry Push : Server Side application requisites

ok. got it thanks a lot..

Regards,
Kanak Sony
------------------------------------------------------------------------------------------
http://dodevelopnshare.wordpress.com/ | http://www.linkedin.com/profile/view?id=188131481&trk=tab_pro