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

Web and WebWorks Development

Reply
Contributor
bryantliu
Posts: 10
Registered: ‎10-22-2012
My Carrier: BB 10 developer
Accepted Solution

Can not create push service object

Hi:

 

I've been stuck on this for weeks.

 

i have followed all the steps, but

when i run this line,

 

blackberry.push.PushService.create(ops, successCallback, failCallback, simChangeCallback, pushTransportReadyCallback);

 

it always return faillCallBack, and the error code is 500 - Error: An internal error occurred while calling blackberry.push.PushService.create. Try restarting the application. 

 

does anybody have any ideas?

 

Thanks.

Please use plain text.
BlackBerry Development Advisor (Retired)
mdandrea
Posts: 311
Registered: ‎08-08-2012
My Carrier: Rogers

Re: Can not create push service object

Hi,

 

Just a couple of questions to help me try to figure out what's going on. :smileyhappy:

 

1. Are you on the latest OS version (i.e. 10.0.9.1675)?

2. Are you using the latest WebWorks SDK (i.e. 1.0.4.5)?

3. Just curious, are you testing using the Push Capture sample app or with your own?

 

Thanks,

 

Matt

Please use plain text.
Contributor
bryantliu
Posts: 10
Registered: ‎10-22-2012
My Carrier: BB 10 developer

Re: Can not create push service object

OK,

 

1. i'm using the latest 10.0.9.253

2. yes.

3. i tried both.

 

and i have some more questions.

 

1. do i need a sim card ( i tried with or without sim cards)

2. i'm wondering whether the author of debug token has to match the author of push registrant.

 

i can't track any of the infos, the error code i can only get is 500.

 

 

thanks

Please use plain text.
BlackBerry Development Advisor (Retired)
mdandrea
Posts: 311
Registered: ‎08-08-2012
My Carrier: Rogers

Re: Can not create push service object

[ Edited ]

Push works both over Wi-Fi and with a SIM card inserted.

 

Oh, just thought of what the issue most likely is for you. 

 

When you request signing keys, you need to make sure you get the special permission to use push.

 

When did you request signing keys and a BlackBerry Push Service account?  This new push permission is recent, so old signing keys won't have it.

 

If you have an active BlackBerry Push Service account and didn't receive an email with steps on how to add the push permission to your existing keys, then please email BlackBerryPushServices@rim.com.  Let them know you have a Push Services account and would like the Push permission added to your keys.  Also, provide them the email address associated with your current code signing keys. That should be enough to get you the permission within a day or two.

 

Let me know if you run into any issues.

 

Matt

Please use plain text.
Contributor
bryantliu
Posts: 10
Registered: ‎10-22-2012
My Carrier: BB 10 developer

Re: Can not create push service object

ok, i see

thank you very much.

Please use plain text.
Regular Contributor
annuk
Posts: 82
Registered: ‎09-26-2012
My Carrier: NA

Re: Can not create push service object

Hi Matt,

 

While creating the channel for push services, i get the following error.

"INVALID_PPG_URL"

 

I am using a production account for sending pushes. I am able to send mesages to OS 7 devices.

My code:

function startNotification(){
	alert("startNotification");
	var ops = { invokeTargetId :'sample.pushreceiver.invoke.push', 
           appId :'xxx-xxxxxeeDe7t97no8a168i651h586o38424h6', 
            ppgUrl :'http://pushapi.na.blackberry.com'};
	
	try {
		alert(blackberry);
		alert(blackberry.push);
	    blackberry.push.PushService.create(ops, 
	        successCallback, 
	        failCallback, 
	        simChangeCallback, 
	        pushTransportReadyCallback);
	} catch (err) {
		alert(err);
	    console.log("Create was called more than once with different " 
	        + "values for options.invokeTargetId or options.appId.");
	    console.log(err);
	}

	
}

 Where am i going worng?

Regards,

Annuk

Please use plain text.
BlackBerry Development Advisor (Retired)
mdandrea
Posts: 311
Registered: ‎08-08-2012
My Carrier: Rogers

Re: Can not create push service object

Hi Annuk,

 

The PPG URL you have looks right to me.

 

A couple of things though:

1. Are you using the latest OS update?

https://developer.blackberry.com/blackberry10devalpha/devalpha_update.html

There was a bug in an earlier verison of the OS that should be fixed now in 10.0.09.2320.

2. Your invokeTargetId has to be changed to something unique to your application if you plan on signing your app.  You would have to change it in your "ops" and also your config.xml.  This is discussed in the README.md file of the sample https://github.com/blackberry/BB10-WebWorks-Samples/tree/master/pushCapture.

 

Thanks,

 

Matt

 

Please use plain text.