Hello, when a push notification is received the phone display a pop-up and in the icon of App the number of badges is displayed. That is correct but..

First problem: When I open the app for the first time after receiving the notification, I want to display a pop-up with the text of the notification. Is that possible ?

Second problem: After the notification is received, the icon badge number is not cleared.

I use xcode 5 and native iOS app.

Why PhoneGap with these two problems do not occur but with ios native occur?

Thanks in advance


asked 01 Feb '14, 19:51
tuttoilmondo's gravatar image


I have found a solution for the second problem

In the appDelegate.m :

  • (void)applicationDidBecomeActive:(UIApplication *)application { [[UIApplication sharedApplication] setApplicationIconBadgeNumber: 0]; [[UIApplication sharedApplication] cancelAllLocalNotifications]; }

When the App become active the badge number is cleared.

permanent link
answered 01 Feb '14, 20:04
tuttoilmondo's gravatar image


First you should to set pushManager delegate:

 - (BOOL) application: (UIApplication *) application didFinishLaunchingWithOptions: (NSDictionary *) launchOptions {    
// your code here
 [PushNotificationManager pushManager].delegate = self;


Then add this method in AppDelegate.m:

- (void) onPushAccepted:(PushNotificationManager *)pushManager withNotification:(NSDictionary *)pushNotification onStart:(BOOL)onStart {
  if (onStart) {
      //Show alert here. You can get the message from pushNotification dictionary


permanent link
answered 05 Feb '14, 12:38
Fectum's gravatar image


Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 01 Feb '14, 19:51

question was seen: 2,344 times

last updated: 05 Feb '14, 12:38