Я использую этот код для управления push:
В AppDelegate
@implementation AppDelegate{
NSDictionary *dUserInfo; //To storage the push data
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
//Check for options
if (launchOptions != nil)
{
//Store the data from the push.
dUserInfo = [launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey];
if (dUserInfo != nil)
{
//Do whatever you need
}
}
return YES;
}
- (void)applicationDidBecomeActive:(UIApplication *)application
{
//Data from the push.
if (dUserInfo != nil)
{
//Do whatever you need
}
}
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
{
//Store the data from the push.
if (userInfo != nil)
{
dUserInfo = userInfo;
}
}
Я надеюсь, что это будет кому-то полезно.*