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
ekke
Posts: 1,556
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone

Re: standalone server-side example based on the new blackberry push service

[ Edited ]

thanks to mdicesare it was easy for me to make push service SDK working:

 

* using Low Level API

* using Java SE without Springsource

 

I can

 

* push to devices

* query for status etc

 

at the moment I'm waiting for RIM adding my base-notification-url to develop all kinds of delivery from Plus Service

 

3 things are open:

 

* sending Subscription RESUME and SUSPEND and QUERY Subscriptions

  is it possible using low level API (components common + pap)

 

BTW:

I'm developing an Open Source Solution (Eclipse Public License EPL)

to provide an easy-to-use dynamic server for Push Services and also TCP Socket connections

based on OSGI (Eclipse Equinox)

 

will post the info to bthe forums if its fully working

then you only need Eclipse and MySQL to make it run - no Springsource or so

Admin-UI of Push Server will be possible thru BlackBerry SmartPhones or Vaadin as Web UI or Eclipse Riena as Eclipse RCP or RAP

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner http://vimeo.com/ekkescorner/videos
bb10-development: http://appbus.org Twitter: @ekkescorner
Developer
ekke
Posts: 1,556
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone

Re: standalone server-side example based on the new blackberry push service

[ Edited ]

one part resolved :smileyhappy:

 

 

SubscriptionQueryResponse sqr = null;
SubscriptionQueryServiceImpl sqs = new SubscriptionQueryServiceImpl();
	sqs.setHttpClient(client);
	sqs.setPushSDKProperties(pushProperties);
	try {
		sqr = sqs.querySubscriptionStatus(PUSH_APP_ID, PUSH_APP_PW, addressList.toSet());
	} catch (PushSDKException e) {
		logger.error("PushSDKException *SubQuery*", e);
	} catch (SubQueryFailureException e) {
		logger.error("SubQueryFailureException *SubQuery*", e);
	} catch (UnauthorizedException e) {
		logger.error("UnauthorizedException *SubQuery*", e);
	} catch (IllegalArgumentException e) {
		logger.error("IllegalArgumentException *SubQuery*", e);
	}
	logger.debug("sub query results {}", sqr.getResults().toString());

I can use SubscriptionQueryServiceImpl from Query Component 

 

...trying if I also will find a way for resume/suspend/deregister subscribers from server-side using low-level API

 

 

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner http://vimeo.com/ekkescorner/videos
bb10-development: http://appbus.org Twitter: @ekkescorner
Developer
ekke
Posts: 1,556
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone

Re: standalone server-side example based on the new blackberry push service

OK - resolved all open issues

if knowing how to do -  it's easy ;-)

 

httpResponse = client.transmitGET(
					pushProperties.getSubscriptionResumeUrl()+"<your-pin>", 
	"", // no contentType needed 
	PUSH_APP_ID, //username your secret app-id
	PUSH_APP_PW, // password 
	null); // no headers needed

...
// same to suspend
pushProperties.getSubscriptionSuspendUrl()
...
// and to deregister
pushProperties.getSubscriptionDeregistrationUrl()
...
// some useful response returncodes:
// rc-200 successfull 
// rc-10007 PIN not found 
// rc-10012 PIN already suspended

now waiting for my base notification url set by RIM - then I'm ready using PushServiceSDK low-level from Java SE 

 

 

 

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner http://vimeo.com/ekkescorner/videos
bb10-development: http://appbus.org Twitter: @ekkescorner
Contributor
peterdeka
Posts: 39
Registered: ‎04-06-2011
My Device: Bold 9780

Re: standalone server-side example based on the new blackberry push service

I have tried to use the java code for the low level push but i thinks i'm missing some references because it fails to start. can someone help me in setting the project proprieties in eclipse? which jars do i have to import? other things or refrences to set up?

thanks

Contributor
zirconias
Posts: 10
Registered: ‎07-17-2012
My Device: curve 9360

Re: standalone server-side example based on the new blackberry push service

hi, thanks for sharing your knowledge with us,

 

i'm getting an error when  trying to use  the low level api,

net.rim.pushsdk.commons.PushSDKException: Unable to parse the response from this command because the content-type header field returned was not the expected: 'application/xml'. This may occur if the URL being accessed is wrong or the service at the URL is not available. Actual content-type returned was: text/html;charset=UTF-8

 the line generating this error :

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

 i forced the type  by :

ContentType contentType=new ContentType("TEXT_PLAIN");

 also :  i wonder if  i  can send  just  string  to bb device, i don't want it to be a browser push but just a simple string sent to device on specifiqu port:

 

thanks for helping us