在我的应用中,本地通知正确显示。但是,我的疑问是,我需要重定向到应用程序中的特定屏幕,同时我将解锁滑动到通知。
答案 0 :(得分:3)
在app delegate中执行以下操作。
- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification
{
UIApplicationState state = [[UIApplication sharedApplication] applicationState];
if (state != UIApplicationStateActive)
{
// redirect to the next screen.
}
}
希望它会对你有所帮助。
答案 1 :(得分: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.