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
Bullety
Posts: 138
Registered: ‎08-02-2009
My Device: Z10
My Carrier: T-Mobile

Re: Push API sample code needed

Dear  JGao12345678,

 

Please take a look at page three, the second post is my one with the solution for your authentication problem:

http://supportforums.blackberry.com/t5/BlackBerry-Push-Development/Push-API-sample-code-needed/td-p/...

 

Simply call the SetBasicHttpAuthentication method and you will be fine.

You do not need to change your URL.

 

We did fix the rest already in the PM's, didn't we?

 

 

Best regards,

 

Bullety

Please use plain text.
New Developer
JGao12345678
Posts: 46
Registered: ‎07-05-2010
My Device: 9630
My Carrier: Telus

Re: Push API sample code needed

Hi Bullety,

 

Thank you for your help.

I used your code to sent PAP push to the RIM PPG (URL: https://pushapi.eval.blackberry.com/mss/PD_pushRequest) throught the static IP registered in RIM, I got the Access Forbiden (403) error.

 

First, I install RIM Push SDK in my server and I check my server can run well.

Then, I do registration using my Blackberry device, I can get the OK as return result.

I can get the device information at https/myserver/debug-portal/subscriber_query.do.

Subscriber query results 

Subscriber ID        Address  Status 
601-6c65MRr795DOnM51 22xxxxxx ACTIVE 

 And then, I send the PAP push to my device via RIM BIS using your code. I use same Application ID as user and the Pwd as password to do device register and sending PAP push.

Finally, I get Access Forbiden (403) error.

Could you tell me step by step that how to get the response status is OK after you send the PAP push to the https://pushapi.eval.blackberry.com/mss/PD_pushRequest.

 

Thanks again for your help.

Please use plain text.
New Developer
JGao12345678
Posts: 46
Registered: ‎07-05-2010
My Device: 9630
My Carrier: Telus

Re: Push API sample code needed

By the way, who is kudos? how to do appreciation to him?

Please use plain text.
Developer
Bullety
Posts: 138
Registered: ‎08-02-2009
My Device: Z10
My Carrier: T-Mobile

Re: Push API sample code needed

[ Edited ]

Did you implement the HttpAuthentication as I described it here:

 

    public static void SetBasicAuthHeader(WebRequest req, String userName, String userPassword)
{
string authInfo = userName + ":" + userPassword;
authInfo = Convert.ToBase64String(Encoding.Default.GetBytes(a uthInfo));
req.Headers["Authorization"] = "Basic " + authInfo;
}

 

If you use the code you sent me via PM, you use this method, so everything should be fine there.

 

Could you please debug all exceptions thrown, with all data you get, and all data from the innerException (if available).

Please put all this data here so that we can check this.

 

Could you please also try to open the URL in your standart browser and see what message you get there?

 

 

 

To the Kudo's:

 

To the left of this post, you will see my Account name and some stats.

 

Underneath that, there is a white star on a black background.

 

Please click this star beside every post with which I or someone else helped you.

 

We can then see that this post helped you and get the so called Kudo's (points).

 

The guys with many Kudo points helped many times - that's the principe.

Please use plain text.
New Developer
JGao12345678
Posts: 46
Registered: ‎07-05-2010
My Device: 9630
My Carrier: Telus

Re: Push API sample code needed

Thank you for your help.

I implemented the HttpAuthentication as you described.

I also try to use the Java to do same thing. I got the Bad Request (400) error.

 

I need to install visual studio on my server. In that case, I can debug step by step.

Please use plain text.
Developer
Bullety
Posts: 138
Registered: ‎08-02-2009
My Device: Z10
My Carrier: T-Mobile

Re: Push API sample code needed

Yes, that would be the best - or you do send your request over an proxy on your server as I described in the other thread.

 

Then you can debug your application from whereever you are.

Please use plain text.
New Developer
JGao12345678
Posts: 46
Registered: ‎07-05-2010
My Device: 9630
My Carrier: Telus

Re: Push API sample code needed

Tomorrow, I will try to using proxy to through server to send the PAP push to RIM Push server.

Please use plain text.
Developer
bert2002
Posts: 172
Registered: ‎05-01-2010
My Device: Z10
My Carrier: O2

Re: Push API sample code needed

 


JGao12345678 wrote:

Should I do the registration, before I do PAP push request?

For the registration, the url is

"http://pushapi.eval.blackberry.com/mss/PD_subReg?serviceid=########&osversion=5.0.0&model=9700".

 


 

Hi,

 

is the serviceid the applicationid that I got from RIM?

 

kind regards

 

bert2002



----------------------------------------------------------
find my widgets -> http://blackberry.itbert.de
Please use plain text.
Developer
raquibulbari
Posts: 137
Registered: ‎09-30-2009
My Device: Torch 9800

Re: Push API sample code needed

yes serviceid is appid

----------------------
Press like if you find a message helpful
---------
Please use plain text.
New Developer
JGao12345678
Posts: 46
Registered: ‎07-05-2010
My Device: 9630
My Carrier: Telus

Re: Push API sample code needed

Yes. you are right.

 

The serviceid is the applicationid that you got from RIM.

Please use plain text.