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

Posts: 230
Registered: ‎01-12-2013
My Device: z30
My Carrier: Mobile Vikings

App automatically opens after push

Ok, so far so good.


I managed to get everything working. My app registers himself with my own written NodeJS push initiator and I can push messages from the push initiator to my device.


But I noticed that if the push message arrives on my device, and the app is not open, he automatically opens the app in an active frame. Can I prevent this from happening? I only want my notification to appear in the hub, so I handle the invoke of the InvokeManager


void PushManager::handleInvoke(const bb::system::InvokeRequest& request) {
	if (request.action().compare("bb.action.PUSH") != 0) {

	bb::network::PushPayload payload(request);

	if (payload.isValid()) {
		if (payload.isAckRequired()) {

		Notification* notification = new Notification(this);


 So is it possible to prevent the app from opening? Or is there another way to make a notification in the hub from a push message?


Thanks in advance!

BB10-OAuth: GitHub
Posts: 311
Registered: ‎08-08-2012
My Device: BlackBerry Z10
My Carrier: Rogers

Re: App automatically opens after push

In the current BlackBerry 10 OS, processing a push will always launch the application to the background (if you had registered to launch of course - if you did not register to launch, the push will be dropped if it comes in and the application is closed).


The recommended best practice is to exit your application after processing a push message.

So, you would process the push, create your notification in the Hub, and then exit the application (if and only if the user did not bring the application to the foreground during the processing).


The following links talk about how to do both of these:




I highly recommend you take a look at the code samples in general.  They help explain the best practices you need to follow in your applicaiton.