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
New Contributor
Posts: 6
Registered: ‎07-21-2014
My Device: 9700
My Carrier: MTN
Accepted Solution

Blackberry Push Client Registration rejected by server

Hello everyone,

 

I successfully registered for the blackberry push service evaluation and received the appropriate credentials.

 

However, whenever I try to register my the push service client I developed using a real device, I receive a "Rejected By Server error".

 

I only got my credentials 5 days ago so, I don't think it has expired.

 

I am using a blackberry 9700 OS 6 for testing this.

 

The Client I wrote is a variation of the sample Push service client.

 

here is the registration code.

public void register() throws Exception {
		ApplicationDescriptor ad = ApplicationDescriptor.currentApplicationDescriptor();
		//byte serverType = PushApplicationDescriptor.SERVER_TYPE_BPAS;
		PushApplicationDescriptor pad = new PushApplicationDescriptor( PushConfig.APP_ID, PushConfig.PORT,
				PushConfig.REG_URL, PushApplicationDescriptor.SERVER_TYPE_BPAS, ad );
		// check whether already registered or registration pending
        PushApplicationStatus pushApplicationStatus = PushApplicationRegistry.getStatus( pad );
        byte pasStatus = pushApplicationStatus.getStatus();
        System.out.println("Starting Registration");
        if( pasStatus == PushApplicationStatus.STATUS_ACTIVE ) {
            Subscriber subscriber = new Subscriber();
            subscriber.subscribe();//register again but don't block.
            System.out.println("successful registration");
            return;
            
        } else if( pasStatus == PushApplicationStatus.STATUS_PENDING ) {
            // we already scheduled registration, wait for its result
        	print("Registration pending");
        } else {
            // not registered yet, register
        	System.out.println("not registered yet");
            PushApplicationRegistry.registerApplication( pad );
        }
		parseRegistrationResult();
	}

 In the onStatusChange() I have this:

public void onStatusChange(PushApplicationStatus pushAppStatus) {
		byte bpsStatus = pushAppStatus.getStatus();
        byte regReason = pushAppStatus.getReason();
        String error = pushAppStatus.getError();

        boolean simChanged = false;
        _regStatus = bpsStatus;

        switch( bpsStatus ) {
            case PushApplicationStatus.STATUS_ACTIVE:
            	Subscriber subscriber = new Subscriber();
				String result = "";
				
				subscriber.subscribe(); //initiate subscription
				result = subscriber.getResult();
				print("result is "+ result);
				if(result == "s") {
					print("Whoop!")
				} else {
					print("we failed");
				}
                break;
            case PushApplicationStatus.STATUS_FAILED:
            	print("registration failed");
            	displayMessage("registration failed");
            case PushApplicationStatus.STATUS_NOT_REGISTERED:
                switch( regReason ) {
                    case PushApplicationStatus.REASON_SIM_CHANGE:
                        simChanged = true;
                        break;
                    case PushApplicationStatus.REASON_REJECTED_BY_SERVER:
                    	print("Rejected By server");
                    	displayMessage("Rejected by server " + error);
                    	break;
                    case PushApplicationStatus.REASON_NETWORK_ERROR:
                    	print("network error");
                    	displayMessage("Network error");
                    case PushApplicationStatus.REASON_INVALID_PARAMETERS:
                        // registration failed
                        break;
                }
                break;
            case PushApplicationStatus.STATUS_PENDING:
            	print("still pending");
            	displayMessage("still pending");
                break;
        }

	}
	

 Please, what am I doing wrong? 

is there a possibility that the eval server is malfunctionning?

New Contributor
Posts: 6
Registered: ‎07-21-2014
My Device: 9700
My Carrier: MTN

Re: Blackberry Push Client Registration rejected by server

Hello, any help?

BlackBerry Development Advisor
Posts: 835
Registered: ‎07-15-2008
My Device: Passport
My Carrier: Bell

Re: Blackberry Push Client Registration rejected by server

Can you send me your Push server URL and I'll log this issue with the Push team.

Tim Windsor
Open Source Technical Lead
New Contributor
Posts: 6
Registered: ‎07-21-2014
My Device: 9700
My Carrier: MTN

Re: Blackberry Push Client Registration rejected by server

I will send. a
ASAP
BlackBerry Development Advisor
Posts: 835
Registered: ‎07-15-2008
My Device: Passport
My Carrier: Bell

Re: Blackberry Push Client Registration rejected by server

Okay, I opened an issue for it.

Tim Windsor
Open Source Technical Lead
New Contributor
Posts: 6
Registered: ‎07-21-2014
My Device: 9700
My Carrier: MTN

Re: Blackberry Push Client Registration rejected by server

Thanks!
BlackBerry Development Advisor
Posts: 835
Registered: ‎07-15-2008
My Device: Passport
My Carrier: Bell

Re: Blackberry Push Client Registration rejected by server

We've been working on some changes to the environment, but we'll need to get some additional data to track logs when you try again. Can you send me the following to my email account (twindsor@blackberry.com):

 

  • Time when you attempt to register (and timezone)
  • PIN of the device
  • Application ID used
  • Do you have a SIM card?

Also make sure that you are using http (not https) to register.

Tim Windsor
Open Source Technical Lead
New Contributor
Posts: 6
Registered: ‎07-21-2014
My Device: 9700
My Carrier: MTN

Re: Blackberry Push Client Registration rejected by server

Okay. I will send you the details ASAP
New Contributor
Posts: 6
Registered: ‎07-21-2014
My Device: 9700
My Carrier: MTN

Re: Blackberry Push Client Registration rejected by server

I have sent you a mail containing the details you requested
BlackBerry Development Advisor
Posts: 835
Registered: ‎07-15-2008
My Device: Passport
My Carrier: Bell

Re: Blackberry Push Client Registration rejected by server

Issues fixed now

Tim Windsor
Open Source Technical Lead