0

在我的应用程序中,本地通知正确显示。但是,我的疑问是,当我将解锁滑动到通知时,我需要重定向到应用程序中的特定屏幕。

4

2 回答 2

3

在应用程序委托中执行以下操作。

- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification
{
   UIApplicationState state = [[UIApplication sharedApplication] applicationState];

   if (state != UIApplicationStateActive)
   {
      // redirect to the next screen.
   }
}

希望它会帮助你。

于 2013-10-16T18:27:35.913 回答
1

试试这个,

您将通过此方法获得本地通知

- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification;

或用于远程通知

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

然后你可以推你的屏幕,即

if(you are in another screen)
    push your required screen 
else 
    do nothing.
于 2013-10-16T13:47:47.680 回答