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: 4
Registered: ‎07-17-2012
My Device: 9520
My Carrier: T-Mobile
Accepted Solution

Not receiving push message

I am using BIS push.

I get <response-result code="1001" desc="The request has been accepted for processing."> when I send message on server side. I get status success while blackberry.push.openBISPushListener and also registraion reponse code of rc=200.

But I dont receive any push on my device.  
 
My server side code

This is my PAP message that I post to https://cpXXX.pushapi.na.blackberry.com/mss/PD_pushRequest

--ASDFaslkdfjasfaSfdasfhpoiurwqrwmContent-Type: application/xml; charset=UTF-8

<?xml version="1.0"?>
<!DOCTYPE pap PUBLIC "-//WAPFORUM//DTD PAP 2.1//EN" "http://www.openmobilealliance.org/tech/DTD/pap_2.1.dtd">
<pap>
<push-message push-id="1342518013536" deliver-before-timestamp="2012-07-17T11:40:13Z" source-reference="XXX-617k3e20yRDmXXXf316r70M4cc13202kXXXX"><address address-value="XXeXXbXa"/><quality-of-service delivery-method="unconfirmed"/></push-message>
</pap>
--ASDFaslkdfjasfaSfdasfhpoiurwqrwm
Content-Type: text/plain
Push-Message-ID: 1342518013536

Test message 2
--ASDFaslkdfjasfaSfdasfhpoiurwqrwm--


This is the response message that I get from https://cpXXX.pushapi.na.blackberry.com/mss/PD_pushRequest

<?xml version="1.0"?>
<!DOCTYPE pap PUBLIC "-//WAPFORUM//DTD PAP 2.1//EN" "http://www.openmobilealliance.org/tech/DTD/pap_2.1.dtd"><pap><push-response push-id="1342518013536" sender-address="http://cpXXX.pushapi.na.blackberry.com/mss/PD_pushRequest" sender-name="RIM Push-Data Service" reply-time="2012-07-17T09:42:46Z"><response-result code="1001" desc="The request has been accepted for processing."></response-result></push-response></pap>

=============================================================================

My client side code

On registration I get rc=200 . So I think my BB device has registered successfully

var port = 21000;
var serverURL = "http://pushapi.na.blackberry.com";
var appID = "XXX-617k3e20yRDmXXXf316r70M4cc13202kXXXX";
var max = 100;
var wakeUpPage = "../push.html";

function listenToPush() {
    try {
        var ops = {port : port, appId : appID, serverUrl : serverURL, wakeUpPage : wakeUpPage, maxQueueCap : max};
        blackberry.push.openBISPushListener(ops, onData, onRegister, onSimChange);
    } catch (e) {
        alert("Error starting BISPushListener: "+e);
    }     
}

function onData(data) {
    alert(data.payload);
    try {
        // Some code
        return 0; //indicate acceptance of payload for reliable push
    } catch (e) {
        alert("Error on receive BISPushListener: "+e);
    }
}

function onRegister(status) {
    if (status == 0) {
        alert("success");
    } else if (status == 1) {
        alert("network error");
    } else if (status == 2) {
        alert("rejected by server");
    } else if (status == 3) {
        alert("invalid parameters");
    } else if (status == -1) {
        alert("general error");
    } else {
        alert("unknown status");
    }
}

function onSimChange() {
    // Some code
}


Thanks,
PLEASE HELP, BEEN STUCK AT THIS STAGE FOR AGES NOW

New Contributor
Posts: 4
Registered: ‎07-17-2012
My Device: 9520
My Carrier: T-Mobile

Re: Not receiving push message

I am now registering on http://pushapi.na.blackberry.comhttp://cpXXX.pushapi.na.blackberry.com"

 

I am now getting push messages