tags:

views:

67

answers:

1

hi, Friends

In, testing of Apple Push Notification Service ,server sends me response .k that is not the problem problem is that when server sends response to me ,at that time pop up comes through Operating system(OS).how to handle it

there are 2 questions related to it 1>if pop up comes through OS ,there are 2 options 1>press YES and 2>NO now if i press yes where it will be in my code 2>or u can say how i know if i press yes it will be where in my code .so that i can put NSLog(@"abcdefghijklmnop"); there

A: 

There are two situations when a push notification arrives. Either your app is already running and it arrives, or it's not running and it arrives. If it's not running, the O/S has sole control of handling the push notification, and you won't be able to do anything from your app unless the user proceeds.

If your app is already running, you can pretty much do whatever the heck you want. Simply provide an implementation for UIApplicationDelegate's application:didReceiveRemoteNotification: method.

If your app isn't running, the O/S is handling and there is very little that you can learn from arrival. If the user simply dismisses the message, none of your code anywhere will be run. If the user accepts the message, then your application is launched. You can get examine the contents of the launchOptions parameter to application:didFinishLaunchingWithOptions: to see what happened.

bpapa