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
Regular Contributor
mdicesare
Posts: 78
Registered: ‎04-28-2010
My Device: BlackBerry 10 Dev Alpha
My Carrier: Rogers

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

It's not the portal username and password you want to use to push. Those credentials are used to login to the RIM hosted administration website where you can manage your push application attributes.

 

In the content of entering your push application details in the DebugPortal, the Id and Username fields will be the same value - namely the Application Id you got in the email from RIM. It just so happens the application ID and username are the same values in BIS push; they can be different for BES push hence the two different form fields in the DebugPortal. And the password to use is the Pwd: not the Portal Pwd:. Again the Portal Pwd: is used to login to the RIM hosted admin pages.

 

If you are using the right username and password the next thing you need to make sure is the IP of the server you are pushing from is the IP RIM has registered for you.

 

Hope that helps.

 

 

 

 

 

Please use plain text.
New Contributor
jhnlmn
Posts: 7
Registered: ‎04-29-2010
My Device: Various
My Carrier: Various

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

[ Edited ]
Thank you for explaining about the multiple names and password.

I tried to add the application again: used "Application ID" as Id and Username,
then "Pwd" as Password, then "Push Port" as Push listen port in debug-portal.
I assume that other fields, such as Name, Version, Description and
Added by (username) are not as important - that is an incorrect value in these
fields should not cause "Unauthorized" error, right?
 
Then I selected Push, entered "Push Id"="bbpush" - this is the name I used
when invoking registration in the client application.
"Push Application"="Name" - this is the name I entered when adding new application
in debug-portal.
"Addresses"="push_all"
"Or text"="Test"
Then clicked Push and got the same error "Unauthorized to push to URL"

> the next thing you need to make sure is the IP of the server you are pushing from is the IP RIM has registered for you.
 
Well, this is a tricky thing. Like most development machines, my server is behind a NAT router.
So, I gave the IP of that router when registering for Push.
I assume that when my server creates an HTTP connection to RIM server, the RIM
server will see the IP of my router as the source.
On the other hand, if BB Push application is sending the IP address of the local host in a header,
then it will be a different (local) address.
I guess, this may cause the Unauthorized problem.
  
So, if you have any insight on how the BB push server is implemented,
please, tell us whether is it OK to use a NAT router or not (the Docs are silent on this matter).
  
Thank you
Please use plain text.
Regular Contributor
mdicesare
Posts: 78
Registered: ‎04-28-2010
My Device: BlackBerry 10 Dev Alpha
My Carrier: Rogers

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

Looks like you setup the Push Application correctly in the Debug Portal. One thing I want to confirm the password you used is the Password: field under the 'Server' category of the email, right? Ensure you are *not* using the Portal Pwd:. And application id should be of the from xxx-xxxxxxxxxxx (alpha numeric) 

 

When you pushed the push id should be some random alpha numeric string (you can leave it blank and the SDK will autogenerate one for you). It is not the name you used when invoking registration in the client application. The name you used when you invoked the registration in the client application becomes your "subscriber id". When you push you can then push to your subscriber id or in your case you did a 'push_all' which works too. Either way that won't cause you Unauthorized error.

 

I am not sure about the NAT router. Ultimately, you need to find out what your IP is when it arrives at the RIM push infrastructure. That IP must match the Source IP: field in the registration confirmation email RIM sent you. I don't believe there is any trickery with the HTTP header.

 

 

Please use plain text.
New Contributor
jhnlmn
Posts: 7
Registered: ‎04-29-2010
My Device: Various
My Carrier: Various

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

> One thing I want to confirm the password you used is the Password: field under the 'Server' category of the email, right?

Yes

> Ultimately, you need to find out what your IP is when it arrives at the RIM push infrastructure.

I have no way of viewing logs from RIM push infrastructure.

I can only do the following check: visit
http://www.viewmyip.com/
using a Web browser on the same machine, where I run BB Push application.
Observe
Your IP Address is: xx.xx.xx.xx
Which is exactly the same IP address as "Source IP" in my BB Push registration E-Mail.

May be HTTPS has some different behavior from HTTP, like client authentication? Just guessing.

Thank you

Please use plain text.
Regular Contributor
mdicesare
Posts: 78
Registered: ‎04-28-2010
My Device: BlackBerry 10 Dev Alpha
My Carrier: Rogers

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

Sorry I can't help you more. Sounds like you need someone from RIM to help you investigate further what is wrong. They can probably check logs on their side to give you more info. I wonder if someone here knows who to email for help.

Please use plain text.
New Contributor
janbb
Posts: 5
Registered: ‎06-23-2009
My Device: Not Specified

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

I understand that RIM assign the port to each application. Do I need to specifiy the port in my server application? If I do, how? Thanks.

Please use plain text.
Regular Contributor
mdicesare
Posts: 78
Registered: ‎04-28-2010
My Device: BlackBerry 10 Dev Alpha
My Carrier: Rogers

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

Yes, port is assigned by RIM. The port is really only required for your device side application so it knows what port to listen on for pushed messages.

 

The server side application does not need the port number. The SDK keeps that information for archive/read-only purposes only so if you ever forget what port RIM assigned you it is kept somewehre in electronic persistent storage.

 

 

Please use plain text.
New Contributor
vibhuis
Posts: 8
Registered: ‎06-15-2010
My Device: 8800
My Carrier: mtn

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

Hi,

 

Am facing the same problem.  The Unauthorized exception. If some one over here sorted it out please let me know.

 

I confirmed am using the correct username and password. And also my ip is correctly registered with eval system.

 

Thanks in Advance

Please use plain text.
Contributor
efung
Posts: 11
Registered: ‎05-06-2010
My Device: Bold 9700
My Carrier: Rogers

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

Just wanted to followup to mdicesare's post as it was very helpful in getting our standalone implementation working. That sample code should have been part of the official documentation! As another forum post I read pointed out, the papnotify sample does not come with source.

 

It seems that PushSDKPropertiesImpl() requires that the PushSDK.properties file be in the classpath, so make sure you include that in your web application's WAR file. What I did was override the values at runtime like this:

 

PushSDKPropertiesImpl properties = new PushSDKPropertiesImpl();

properties.setPpgAddress( String.format("https://%s/mss/PD_pushRequest", myHostname) );


 

Please use plain text.
New Contributor
raorepalle
Posts: 4
Registered: ‎01-14-2011
My Device: Not Specified

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

Hi I am new to blackberry development. Can you please share me the server and client code for Blackberry push notification? I have done for Android and Blackberry. Trying for Blackberry now. Planing to do for Windows Mobile as well in near feature. 

 

Please help me for this. Thanks in Advance.

 

Thanks,

Rao

raorepalle@gmail.com

Please use plain text.