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

Reply
Developer
kanaksony
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
Please use plain text.
Developer
simon_hain
Posts: 15,806
Registered: ‎07-29-2008
My Device: Z10 LE
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
Please use plain text.
Developer
kanaksony
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
Please use plain text.
Developer
simon_hain
Posts: 15,806
Registered: ‎07-29-2008
My Device: Z10 LE
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
Please use plain text.
Developer
kanaksony
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
Please use plain text.
Developer
simon_hain
Posts: 15,806
Registered: ‎07-29-2008
My Device: Z10 LE
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
Please use plain text.
Developer
kanaksony
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
Please use plain text.