04-27-2011 08:15 PM
tried everything, installed another os, factory reset....there is no IT policy...but the firewall keeps blocking the pushes...is there a reason? (app has full permissions set by hand)
10-17-2011 01:16 AM - last edited on 10-17-2011 01:21 AM
Hi ekke,
I am currently working on BlackBerry push notification.In my client application the onMessage() method is not getting called but whenever I send push message from server my device is showing network interaction.Can you please help me in this and also can you please share some sample codes which implements PushApplication
01-31-2012 02:27 PM
Hi, I have the same need right now, my application isn't launching automatically when receiving push messages from the server. I know the server is sending them correctly because of the 200 ok status, and because I have another apps that constantly check in background for any new message. However the Application that implements PushApplication is not launched and even the onMessage method is never fired. Do you have any example of how to implement the PushApplication interface ?. Do I need any additional entry point?. The code I have right now looks like this:
package com.bes.push.example2; import javax.microedition.io.StreamConnection; import net.rim.blackberry.api.push.PushApplication; import net.rim.blackberry.api.push.PushApplicationDescriptor; import net.rim.blackberry.api.push.PushApplicationRegistr y; import net.rim.blackberry.api.push.PushApplicationStatus; import net.rim.device.api.io.http.PushInputStream; import net.rim.device.api.system.ApplicationDescriptor; import net.rim.device.api.ui.UiApplication; /** * This class extends the UiApplication class, providing a * graphical user interface. */ public class BESApplication extends UiApplication implements PushApplication { /** * Entry point for application * @param args Command line arguments (not used) */ public static void main(String[] args) { // Create a new instance of the application and make the currently // running thread the application's event dispatch thread. BESApplication theApp = new BESApplication(); theApp.enterEventDispatcher(); ApplicationDescriptor descriptor = ApplicationDescriptor .currentApplicationDescriptor(); ApplicationDescriptor pushDescriptor = new ApplicationDescriptor( descriptor, new String[] { "push" }); PushApplicationDescriptor registeredDescriptor = new PushApplicationDescriptor(4242, pushDescriptor); PushApplicationRegistry .registerApplication(registeredDescriptor); } /** * Creates a new MyApp object */ public BESApplication() { // Push a screen onto the UI stack for rendering. pushScreen(new BESScreen()); } public void onMessage(PushInputStream inputStream, StreamConnection conn) { System.out.println("ON MESSAGE"); } public void onStatusChange(PushApplicationStatus status) { // TODO Auto-generated method stub } }
03-05-2012 09:47 AM
@pablo:
The documentation for enterEventDispatcher is clear:
Enters the event dispatcher.
The thread that calls this method (typically the main thread in the application) becomes the event-dispatching thread, which will execute all drawing and event-handling code.
Note that under normal circumstances this method does not return.
I think you should check if the application is in the background or not and use that info