Skip to main content

Catch push notification"s message if the user tapes "close” in the alert



I'm developing an app, I'm using push notifications, I'm sending pushes from an asp.net application and everything is ok, but there is a problem when I want to catch the notification message in the xcode. I know to catch that information I have to use this method







- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo







But it works just when the user tapes "view" in the alert or when the app is in foreground. I need to save the message in to my core data DB everytime, but I can't do that if the user tapes "close" in the alert. Are there any way to get a solution for my problem?





Thanks.


Comments

  1. If the application is in the foreground, then yes, your code can automatically be notified. If your app is not running, or running in the background, the user must "view" the notification.

    However, you can include an update to the app's icon badge number in the push notification. The app could check that periodically. After pulling the data, the app should then reset its badge icon number.

    Inerdial's comment is also correct. The app should pull the data as needed after it receives the notification.

    ReplyDelete

Post a Comment

Popular posts from this blog

Slow Android emulator

I have a 2.67 GHz Celeron processor, 1.21 GB of RAM on a x86 Windows XP Professional machine. My understanding is that the Android emulator should start fairly quickly on such a machine, but for me it does not. I have followed all instructions in setting up the IDE, SDKs, JDKs and such and have had some success in staring the emulator quickly but is very particulary. How can I, if possible, fix this problem?