04-10-2010 11:17 AM
Dear,
I am wondering if the registration for a push application can only be done via the server which initiates pushes or only via the BlackBerry device running the application which receives the pushes or both?
If also (or only) via the server, what's the registration url for a device pin if the base url is https://pushapi.eval.blackberry.com ?
Thanks in advance,
Best regards,
Bullety
Solved! Go to Solution.
04-15-2010 02:45 PM
Hi,
I got a bit further.
My subscribtion url is now:
But I always get an rc=10011 error when opening this url...
This error means that osversion or model is null or empty or longer than 40 characters...
Does anyone knows something what could be wrong?
04-15-2010 05:41 PM
Registration can only be initated from the device. Please see the deviceside sample application that includes sample code for registration. This application is included with the BlackBerry Push Service SDK available at: http://na.blackberry.com/eng/developers/javaappdev
04-16-2010 06:15 AM
...But the registration in this sample (sample-client-app) calls the "contentProviderUrl" defined in the PushConfig.java and not the "bpasUrl".
I think the contentProviderUrl is the Url from my website which handles the registration etc?
04-16-2010 01:44 PM
contentProviderUrl is for Content Provider registration. This registration process is seperate from registeration with the BlackBerry Push Service and it's upto your server application on how to manage it.
04-16-2010 01:51 PM
Ok, thank you.
But the sample app only calls this content provider url.
So not the BlackBerry device registeres itself for the application at the push server but it registeres at the content provider server which registeres the device at the push server.
Is this correct?
That's the way the sample app is working I think.
But I want not to use java on the server side - it's .net code.
Therefore I need the URL for registering a device with http post.
But mine mentioned above does not work.
Do you know what's wrong with the url?
04-18-2010 10:52 AM
Is there anyone who got the debug portal and the sample app running in the tomcat who could possibly check which url is accessed when registering a new device to an application using the sample-app and the sample-client-app (possibly with wireshark or something similar)?
I do unfortunately not get it running so I can unfortunately not do it myself.
I always get these errors:
SCHWERWIEGEND: Error listenerStart 18.04.2010 16:43:36 org.apache.catalina.core.StandardContext start SCHWERWIEGEND: Context [/debug-portal] startup failed due to previous errors log4j:ERROR LogMananger.repositorySelector was null likely due to error in class reloading, using NOPLoggerRepository.
when I try to start tomcat...it's really frustrating to hang on one "simple" url... ![]()
It would be great if someone could try this for me.
I am planning to make and post an explanation of a very simple push application (with code snippets) on my blog when I get it running to help new developers and to prevent them from such problems we currently have here in the forums.
04-19-2010 02:41 PM
After the client sample app calls the content provider URL, assuming that doesn't fail, it then calls the bpasUrl server to register the device. This happens on lines 74/75 of PushController.java, which calls execute routine in RegisterCommand.java.
04-20-2010 03:12 PM
Dear idonen,
Thank you very much - I must have been blind...
I now see where it tries to register with the BPAS but I run into problems when the simulator or the device tries to register.
My PushLibFactory currently looks like this:
public class PushLibFactory {
private static Object lib;
static {
lib = new PushLib50();
}
public static UiApplication getUiApplication() {
return (UiApplication) lib;
}
public static BpasProtocol getBpasProtocol() {
return (BpasProtocol) lib;
}
public static PushMessageListener getPushMessageListener() {
return (PushMessageListener) lib;
}
But always when the line in the static block is called (when an instance should be made), the program runs into a freeze and the method getBpasProtocol() will never be executed as defined in the RegisterCommand class:
BpasProtocol bpasProtocol = PushLibFactory.getBpasProtocol(); bpasProtocol.register(tx);
also then the bpasProtocol.register(tx) will never be executed because the Thread seems to have freezed while in the static block.
I already tried to put an empty constructor in PushLib50 but it did not help.
Is this debuggable in the simulator or can it only be done on a real device?
On my real device, an unhandled exception is thrown when I try to register (I saw it in the event log).
Do you know if it is normal that this bpasProtocol.register is never called?
Because the JavaDoc of PushLib50 says it registeres itself with the BPAS. Possibly bpasProtocol.register(tx) is not necessary in this case?!
04-25-2010 06:03 AM - edited 04-25-2010 06:04 AM
I now got it...
The PushLib50 was extending UiApplication and my main application, too.
Therefore I think they were stealing each other the event dispatching thread.
So I now made my main application not UiApplication and it works now.
Thank you all for your help!