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
Highlighted
Regular Contributor
Posts: 57
Registered: ‎09-22-2010
My Device: Not Specified

Client-side Push registration

I don't know if this is the right place for creating this thread ... but here goes:

 

I am trying to register to Push service from the client device itself, not by using a Push-Initiator server that normally does that registration through net.rim.pushsdk.subscription.web.SubscribeServlet. The main reason to do like this is because the server side is already too busy and complicated ... (previously I checked if I can register to PPG successfuly by using the sample-push-initiator and that was successful as I could also receive Push messages).

 

So this is mainly a "check-if-you-can-do" task ... So far I have registered the application to PushApplicationRegistry:

 

String appId = "<app_id>";
int port = 21241;
ApplicationDescriptor appDesc = ApplicationDescriptor.currentApplicationDescriptor();
						PushApplicationDescriptor pad = new PushApplicationDescriptor(appId, port, null, PushApplicationDescriptor.SERVER_TYPE_NONE, appDesc);
						PushApplicationRegistry.registerApplication(pad);

 and when PushApplication#onStatusChange is called with STATUS_ACTIVE I am performing an Http GET with Basic Auth to the following address: https://pushapi.eval.blackberry.com/mss/PD_subReg?serviceid=my_service_id&osversion=7.0.0.585&model=...

 

The Http request is done in the browser with a RestClient addon installed to see exactly what headers are arriving.

I am getting a 200 OK from that URL - actually that URL I got from this post. The response body is below:

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<title>Pushdata Service</title>
	<body bgcolor="white" leftmargin="0" marginheight="0" marginwidth="0" topmargin="0">
		<form enctype="application/x-www-form-urlencoded" method="get">
			<!-- Header -->
			<!-- static error header library -->
			<br clear="none"/>
			<!-- Errorcode -->
			<!-- dynamic @[errorcode] token -->
			<font color="#777777" size="1" style="verdana">Error </font>
			<br clear="none"/>
			<br clear="none"/>
			<!-- Errorbody -->
			<!-- dynamic @[errorbody] token -->
			<font color="#777777" size="1" style="verdana">The content you have requested is not available</font>
			<br clear="none"/>
			<!-- Error message -->
			<!-- dynamic @[errormsg] token -->
			<br clear="none"/>
			<font color="#777777" size="1" style="verdana">PD_subReg command is not currently in service!</font>
			<br clear="none"/>
			<br clear="none"/>
			<!-- Footer -->
			<!-- static error footer library -->
			<br clear="none"/>
		</form>
	</body>
</html>

 I think I am not using a proper URL or something like that .... and I also see no documentation on doing the registration this way.

 

Did anybody attempted and succeeded in performing Push registrations in this way?

Regular Contributor
Posts: 57
Registered: ‎09-22-2010
My Device: Not Specified

Re: Client-side Push registration

Above attempt is for BIS only ... For BES I expect to make small modifications.

Regular Contributor
Posts: 57
Registered: ‎09-22-2010
My Device: Not Specified

Re: Client-side Push registration

The problem is that Push messages do not arrive to the client device. When pushing them the PPG replies with:

 

<?xml version="1.0"?>
<!DOCTYPE pap PUBLIC "-//WAPFORUM//DTD PAP 2.1//EN" "http://www.openmobilealliance.org/tech/DTD/pap_2.1.dtd"><pap><push-response push-id="1331038085909" sender-address="http://pushapi.eval.blackberry.com/mss/PD_pushRequest" sender-name="RIM Push-Data Service" reply-time="2012-03-06T12:48:05Z"><response-result code="1001" desc="The request has been accepted for processing."></response-result></push-response></pap>

 

Regular Contributor
Posts: 57
Registered: ‎09-22-2010
My Device: Not Specified

Re: Client-side Push registration

How necessary is having that service in the middle after all? ... since the push can be done in a script after all.

Regular Contributor
Posts: 57
Registered: ‎09-22-2010
My Device: Not Specified

Re: Client-side Push registration

Well, it's not necessary when it comes to receiving push messages only - probably push messages status are lost.

I am not using at all that content server as I am sending a generated device id to the server I am using in the end (written in Pearl).