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 Developer
Posts: 30
Registered: ‎03-17-2014
My Device: 9220
My Carrier: Blackberry
Accepted Solution

getting Response Code=10011 while trying to Register for the PUSH NOTIFICATION

Hi, New to BlackBerry

       I'm sure lot of issues on this pushNotification have been addressed before but yet after considering all the possible errors may happen areas i get the response code,rc= 10011 from the server.  

i am using Blackberry 9220, version=7.1.0.746.. have also installed pushNotification SDK too. Just the problem is registering with the BB server for pushnotification.

i'm using below details for request

URL: http://cp4602.pushapi.eval.blackberry.com /mss/PD_subReg?serviceid=4602-B50706eeeeR75O604MM3774i215303a8513 &osversion=7.1.0.746&model=9220;deviceside=false;ConnectionType=mds-pub

i have used the same details i got from BlackBerry after registering.

 

 

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

Re: getting Response Code=10011 while trying to Register for the PUSH NOTIFICATION

Are you receiving this response on the client or server? After which line of code is the error being returned?

Garett
@garettBeuk
--
Goodbye everybody!
New Developer
Posts: 30
Registered: ‎03-17-2014
My Device: 9220
My Carrier: Blackberry

Re: getting Response Code=10011 while trying to Register for the PUSH NOTIFICATION

Hi and thank you for reverting back,

         the response code is from the server received on the client side.. i get the rc=10011 error code when i hit the BlackBerry server for Pushnotification registry and i am just reading the response from the server..  i get rc as 200 which means i am able to hit the server but the response i get is 10011... i looked it up on google and it has something to do with OS version  or model number.. i just dont get it how can that be a problem at all. 

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

Re: getting Response Code=10011 while trying to Register for the PUSH NOTIFICATION

Are you using the sample push app?

https://developer.blackberry.com/native/downloads/fetch/BlackBerryOS_JavaSamplePushEnabledApp-1.0.0....

 

That would be a good place to start prior to trying a custom implementation.

Garett
@garettBeuk
--
Goodbye everybody!
New Developer
Posts: 30
Registered: ‎03-17-2014
My Device: 9220
My Carrier: Blackberry

Re: getting Response Code=10011 while trying to Register for the PUSH NOTIFICATION

I haven't changed much of the code as i have used the same codes in the link you sent.. Its just the TestApp i am trying on. I hope you got my problem clearly now, in the PushUtils.java there is a request method in which we are requesting opening an URL... the response of that is rc=10011.. 

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

Re: getting Response Code=10011 while trying to Register for the PUSH NOTIFICATION

Could you try the sample without changing any of the code? 

 

Does this device have a BlackBerry Data Plan?

Is it a real device or simulator?

Garett
@garettBeuk
--
Goodbye everybody!
New Developer
Posts: 30
Registered: ‎03-17-2014
My Device: 9220
My Carrier: Blackberry

Re: getting Response Code=10011 while trying to Register for the PUSH NOTIFICATION

I am using same code.. no changes.. and its real device BlackBerry 9220 which is connected to the wifi.  here is the code with no major changes.

 

 

public class PushUtils implements LocalResource {

private final static ResourceBundle res = ResourceBundle.getBundle(
BUNDLE_ID, BUNDLE_NAME);

/**
* Declines push message with given reason
*/
/*
* public static void decline(PushInputStream pis, int reason) { try {
* pis.decline(reason); } catch (IOException e) { } }
*/

/**
* Safely closes connection and streams
*/
public static void close(Connection conn, InputStream is, OutputStream os) {
if (os != null) {
try {
os.close();
} catch (IOException e) {
}
}
if (is != null) {
try {
is.close();
} catch (IOException e) {
}
}
if (conn != null) {
try {
conn.close();
} catch (IOException e) {
}
}
}

/**
* Requests an HTTP resource and returns its response as a string
*/
public static String request(String httpUrl, Transaction tx)
throws IOException {
System.out.println("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ pushUtils.java requestingg....!");
checkTransaction(tx);

DataBuffer buffer = new DataBuffer(256, false);
InputStream is = null;
Connection conn = null;
try {
// append connection suffix
httpUrl += getConnectionSuffix();
System.out.println("Opening URL: " + httpUrl);
conn = Connector.open(httpUrl);
tx.setNetworkOperation(conn, is);
if (conn instanceof HttpConnection) {
HttpConnection httpConn = (HttpConnection) conn;
httpConn.setRequestMethod(HttpConnection.POST);
httpConn.setRequestProperty("Content-Type", "text/plain");
int responseCode = httpConn.getResponseCode();
System.out.println("$$$$$$$$$$$$$$$$$$$$$$ RESPONSE CODE IS: "
+ responseCode);
is = httpConn.openInputStream();
tx.setNetworkOperation(conn, is);
int length = is.read(buffer.getArray());
System.out
.println("$$$$$$$$$$$$$$$$$$$$$$ RESPONSE CODE LENGTH IS: "
+ length);
buffer.setLength(length);
String response = new String(buffer.getArray(),
buffer.getArrayStart(), buffer.getArrayLength());
if (responseCode == 200) {
System.out.println("HTTP response: " + response);      // this response value is 10011
System.out.println("%%%%%%%%%%%%%%%%%%%%%%%" + response);
return response;
} else {
System.out.println("HTTP error response: " + response);
throw new IOException("Http error: " + responseCode + ", "
+ response);
}
} else {
throw new IOException("Can not make HTTP connection for URL '"
+ httpUrl + "'");
}
} finally {
PushUtils.close(conn, is, null);
tx.clearNetworkOperation();
}
}

/**
* Forms listen URL based on port number
*/
public static String formPushListenUrl() {
String portNumber = res.getString(PortNumber);
int port = Integer.parseInt(portNumber);
String url = "http://" + port; // get Port number
url += getConnectionSuffix();
return url;
}

private static String getConnectionSuffix() {
if (WLANInfo.getWLANState() == WLANInfo.WLAN_STATE_CONNECTED) {
System.out
.println("############# Wireless LAN connected ########################");
//return ";deviceside=false;ConnectionType=mds-publi;interface=wifi";
return ";deviceside=false;ConnectionType=mds-xxxxxx";

} else {
return ";deviceside=false;ConnectionType=mds-xxxxxx";

}
}

private static void checkTransaction(Transaction tx) throws IOException {
if (tx.isCancelled()) {
throw new IOException("Transaction was canceled");
}
}

}

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

Re: getting Response Code=10011 while trying to Register for the PUSH NOTIFICATION

You need a BlackBerry data plan for OS <7.1 devices. Push will not work over WiFi alone on these devices.

Garett
@garettBeuk
--
Goodbye everybody!
New Developer
Posts: 30
Registered: ‎03-17-2014
My Device: 9220
My Carrier: Blackberry

Re: getting Response Code=10011 while trying to Register for the PUSH NOTIFICATION

but i have the device with OS 7.1.0.746 which > 7.1  

Help me understand my device with 7.1.0.746 requires Data Plan or WiFi is fine?????

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

Re: getting Response Code=10011 while trying to Register for the PUSH NOTIFICATION

If you are not using BlackBerry 10 then you need a BlackBerry Data Plan.

 

So in your case you *need* a BlackBerry data plan.

Garett
@garettBeuk
--
Goodbye everybody!