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
Posts: 105
Registered: ‎06-23-2010
My Device: 9000
My Carrier: vodaphone

Problem with the 'subscribe" POST from the example...error code 400

All:

I have taken the code that comes with the PUSH SDK and compiled, signed etc and put it on the BB. Yes, I have signed up for the eval.

 

When I try to register on the handheld, the following POST returns '400' - invalid arguments:

 

http://pushapi.eval.blackberry.com/subscribe?username=<SAME AS THE APPID>&password=<password>&appid=<app_id>&address=255069fe&osversion=4.2.0&model=9000&field1=742;deviceside=false;ConnectionType=mds-xxxxxx

 

Clearly one of the parameters seems to be wrong, but I cannot figure out which ones.

 

Anyone have any pointers for me?

 

Thanks

 

 

 

-matt

Press Kudos if this helped - ;-)
Contributor
Posts: 15
Registered: ‎11-08-2010
My Device: Not Specified

Re: Problem with the 'subscribe" POST from the example...error code 400

i have the same problem too

 

i have installed the BB push sdk and the sample app.
i run the apps on the device simulator and try to register.
i already ran the mds-cs and tomcat server
(i can access rim website from my simulator browser)
but when i try to register the push i got an error :
Request to register failed. Caused by java.io.IOException:Network Operation [Subscribe] Failed. Make sure the content provider url is accessible.

what is the url for content provider?

Developer
Posts: 235
Registered: ‎11-08-2010
My Device: Not Specified

Re: Problem with the 'subscribe" POST from the example...error code 400

There are two registrations going on:

 

1) With the BlackBerry Push Service (RIM)

 

To register the device with the RIM push server you use a two step registration like:

http://pushapi.eval.blackberry.com/mss/PD_subReg?serviceid=<app id>

 

In the HTTP response you will get a param=xxxx that u need to echo back in a second register call:

http://pushapi.eval.blackberry.com/mss/PD_subReg?param=xxxx

 

2) With the Push Initiator (you - the content provider)

 

The registration URL you are using seems to be mixing up the two. If you replace pushapi.eval.blackberry.com with your own server's IP address that is hosting the SDK then that is a valid registration for 2) above:

 

https://<your server IP>/pushsdk/subscribe?username=<SAME AS THE APPID>&password=<password>&appid=<app_id>&address=

255069fe&osversion=4.2.0&model=9000&field1=742;deviceside=false;ConnectionType=mds-xxxxxx

 

I would choose a proper username instead of using your app id as the SDK pushes by subscriber id's.

 

 

Developer
Posts: 235
Registered: ‎11-08-2010
My Device: Not Specified

Re: Problem with the 'subscribe" POST from the example...error code 400

Btw, you must use a real device to do with registrations with - you can't use the simulator.

Contributor
Posts: 15
Registered: ‎11-08-2010
My Device: Not Specified

Re: Problem with the 'subscribe" POST from the example...error code 400

yes, i already using my device to register.

i'm using the Push API Sample 4.6 in my 9000.

here are the setting i used:

 

port: same as in registration detail on my email

app-id: same as in registration detail on my email 

BPAS url: http://pushapi.eval.blackberry.com

Content provider url: http://myofficeserver:8081/sample-app

app acknowledgment: checked

 

and i got an java.lang.illegalargument exception..

any idea to solve this problem?

Developer
Posts: 105
Registered: ‎06-23-2010
My Device: 9000
My Carrier: vodaphone

Re: Problem with the 'subscribe" POST from the example...error code 400

Not sure how on earth the two could be mixed up. This is STRAIGHT from the example provided by the SDK - no changes made...

 

to be clear: This is the client example from the SDK, no changes, nothing...

-matt

Press Kudos if this helped - ;-)
Highlighted
Contributor
Posts: 15
Registered: ‎11-08-2010
My Device: Not Specified

Re: Problem with the 'subscribe" POST from the example...error code 400

ok.
now i got this following error:

command 'register' failed with error: java.lang.exception :registration with BPAS was rejected by server

here are my setting
port: same as email
app id: same as email
BPAS: http://pushapi.eval.blackberry.com
content provider url: https://mydomain.com:8443/pushsdk
app ack: checked

i tried to change BPAS to https://pushapi.eval.blackberry.com but i got this error Registration with BPAS failed, caused by java.lang.illegalstateException: no application instance

i already double check my app id to the email that RIM send to me..

 

 

i solved the previous problem with changing the content provider url from https://domain.com/sample-app to https://domain.com/pushsdk