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
Retired
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10

Re: push service is not working

@user17

 

Are you using the production or eval server/service? If production then you should push to a URL such as:

https://cpXXX.pushapi.eval.blackberry.com

 

Note that this is HTTPS and the 'XXX' should be replaced by the CP ID provided when registering.

 

If pushing to Eval then you should push to:

 https://pushapi.eval.blackberry.com

 

Still HTTPS in this case.

 

Let us know if the server now starts receiving these pushes as expected (leave the device side out for now). Once that is confirmed we can start troubleshooting why the device is not receiving the data (including verifying BIS access).

 

Regards,

Garett
@garettBeuk
--
Goodbye everybody!
Trusted Contributor
user17
Posts: 145
Registered: ‎01-23-2012
My Device: 9300

Re: push service is not working

Hi Garett Beukeboom,

 

                     Thank you for your response, Iam using eval service https://pushapi.eval.blackberry.com

So still iam getting error while registering time. I used https://cpXXX.pushapi.eval.blackberry.com

that time also i getting error " Request to register failed. Caused by java.lang.illegalArgumentException".

 

@ Chris,

             could you please provide your code....

 

 

Thanks in advance.

Retired
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10

Re: push service is not working

Could you post the snippet of code resulting in this error message?

Garett
@garettBeuk
--
Goodbye everybody!
Trusted Contributor
user17
Posts: 145
Registered: ‎01-23-2012
My Device: 9300

Re: push service is not working

Hi gbeukeboom,

           

                      I using the code from push sdk,I don't know exact which code i have to give many files i am using in that. In their  pushconfig file Iam setting the values;

 

       private int port = portno;
       private String appId = "appId";
       private String bpsUrl = "https://pushapi.eval.blackberry.com";
       private String contentProviderUrl = "content provider url";
       private boolean isEnterprise;

 

In ContentProviderProtocol file contains:
        
        String url = PushConfig.getContentProviderUrl();
        final String cmdName;
        switch( cmd )
        {
            case CMD_SUBSCRIBE:
                url += SUBSCRIBE_URL;
                cmdName = "Subscribe";
                break;
            case CMD_UNSUBSCRIBE:
                url += UNSUBSCRIBE_URL;
                cmdName = "Unsubscribe";
                break;
            case CMD_SUSPEND:
                url += SUSPEND_URL;
                cmdName = "Suspend";
                break;
            case CMD_RESUME:
                url += RESUME_URL;
                cmdName = "Resume";
                break;
            default:
                return;
        }
        // append username, password and other parameters
        url += USERNAME_PARAM + username;
        url += PASSWORD_PARAM + password;
        url += APP_ID_PARAM + PushConfig.getAppId();
        url += PIN_PARAM + Integer.toHexString( DeviceInfo.getDeviceId() );
    //#ifdef HANDHELD_VERSION_42
        url += OS_PARAM + "4.2.0";
    //#else
        url += OS_PARAM + DeviceInfo.getSoftwareVersion();
    //#endif
        url += MODEL_PARAM + DeviceInfo.getDeviceName();
        url += TYPE_PARAM + ( isEnterprise ? CLIENT_TYPE_ENTERPRISE : CLIENT_TYPE_PUBLIC );
        
        // append a user defined parameter
        url += USER_DEFINED_PARAM + new Random().nextInt( 1000 );

        String response;
        try {
            response = PushUtils.request( url, tx );
        } catch( IOException e ) {
            // subscription failed
            if( !tx.isCancelled() ) {
                Logger.warn( "Content Provider network command [" + cmdName + "] failed, caused by " + e.getMessage() );
                throw new IOException( "Network operation [" + cmdName + "] failed. Make sure that Content Provider URL is accessible." );
            }
            return;
        }
        
        checkResult( response );
   

 

Please give me instruction is it any worng, or any other code better than this please help me.

 

 

Thank you

 

 

 

 

 

Retired
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10

Re: push service is not working

From the device side everything should be done using HTTP, not HTTPS.

From the server-side everything should be done using HTTPS, not HTTP.

 

Please switch the bpsUrl to HTTP then see if it allows you to subscribe successfully. If this still fails then please message me all other values you are setting for the registration (appId, port, isEnterprise etc).

Garett
@garettBeuk
--
Goodbye everybody!
Trusted Contributor
user17
Posts: 145
Registered: ‎01-23-2012
My Device: 9300

Re: push service is not working

Hi All,

 

             I tested with different contentprovider url  in that only 1 url is working that means using that url i can register the username and password in bb push server. Sometime this also not working , I don't know  why it happening like this?

I checked every url in device browser that time i can access that url.

 

 

 

Thanks

Retired
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10

Re: push service is not working

Could you provide some details on what you mean by "not working"? 

What different content provider URLs would you be testing? There should only be 1 that you need to use and it would have been provided when you received your registration email.

Garett
@garettBeuk
--
Goodbye everybody!
Trusted Contributor
user17
Posts: 145
Registered: ‎01-23-2012
My Device: 9300

Re: push service is not working

Hi gbeukeboom,

 

                      Thank you for your response, Iam using serverside push config page as content provider URL for eg:

'http://abc.xyz.com/index.php?Service=blackberrySendPushMessage' is using as content provider url , using this i can register and unregister also i can send push message . after sometimes if i use same content provider url it is not registering on bb push server one case, another case is : if i used another content provider url for registeration it is not working. why this happening?    I hope you got my scenario.

 

 

Thanks

Retired
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10

Re: push service is not working

I'm afraid you will need to provide clarification. 

 

Where are you using this URL?

What is happening when it does not work? Are there exceptions?

Are you trying to subscribe the same device multiple times?

 

Overall what are you trying to do (send a message to the target device? subscribe the device?)? What is happening?

Garett
@garettBeuk
--
Goodbye everybody!
Trusted Contributor
user17
Posts: 145
Registered: ‎01-23-2012
My Device: 9300

Re: push service is not working

Hi gbeukeboom,

 

                     I will tell you the scenarios:

 

                           Iam using push services for different projects, In first project it is working fine ; second project also i got push credentials, if iam using for these details to register push server iam getting like this message: 'Request to register failed. Caused by java.io.IOException: Network operation [Subscribe] failed. Make sure that Content Provider URL is accessible'; so i used i first project content provider url that time it is registering push server; i can send the push message also. so why second project content provider url is not working while registering time?; i can access second content provider url through device browser.

 

eg : private String contentProviderUrl = "http://abc.abc.com/index.php?Service=blackberrySendPushMessage";

 

Thanks