1
當用戶單擊通知時,我希望應用打開到我的選項卡欄控制器上的第三個選項卡。我可以獲得通知,但不是開放權利部分。在我的應用程序的didFinishLaunchingWithOptions我:打開本地通知到特定視圖
UILocalNotification *localNotif = [launchOptions objectForKey:UIApplicationLaunchOptionsLocalNotificationKey];
if (localNotif) {
tabBarController.selectedIndex = 3;
}
然後在AppDelegate中爲好,我有:
- (void)application:(UIApplication *)application
didReceiveLocalNotification:(UILocalNotification *)notification {
application.applicationIconBadgeNumber = 0;
NSString *reminderText = [notification.userInfo
objectForKey:kRemindMeNotificationDataKey];
[viewController showReminder:reminderText];
tabBarController.selectedIndex = 3;
}
但是,單擊該通知只是打開它,像正常的,到第一個標籤。