当用户点击收到的推送通知时,我希望我的应用推送NewsViewController。在didFinishLaunching中我有:
ArgumentException
然后,仍然在AppDelegate中,我有:
UIUserNotificationType userNotificationTypes = (UIUserNotificationTypeAlert |
UIUserNotificationTypeBadge |
UIUserNotificationTypeSound);
UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:userNotificationTypes
categories:nil];
[[UIApplication sharedApplication]
registerUserNotificationSettings:settings];
[application registerUserNotificationSettings:settings];
[application registerForRemoteNotifications];
如果用户在应用程序打开时进行推送,则会转到NewsViewController。如果应用程序在点击推送通知时在后台运行,则会转到NewsViewController。但是,如果用户已完全从应用程序切换器关闭应用程序,然后点击收到的通知,则会打开应用程序,而无需转到NewsViewController。我该如何解决这个问题?