iOS 5の通知を正常に受信しました。通知センターでプッシュ通知をスワイプまたはタップすると、特定のビューにユーザーを送信できるようにします。プッシュ通知からのプッシュ表示
View Controller(view)ユーザーが私のアプリケーションの開始に反対するようにしたいのは、 "groceryStoreViewController"です。私はこれがdidFinishLaunchingWithOptionsまたはdidReceiveRemoteNotificationで行われているが、わかりません。
誰かがこれを行う方法を知っていれば、本当に闘争だったので、私は本当にそれを感謝します。
おかげ
EDIT
だから問題は、私は、ユーザーが通知をタップしたときに、特定のビューコントローラを開くことにしたいが、私はまたUITabBarのままにしておきたいということです。私はこれを成功裏に実行することができませんでした。それは、私が信じているサブビューを表示することと私が関係しています。あなたの考えを伝えてくれてありがとう。
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
self.tabBarItem = [[[UITabBarItem alloc] init] autorelease];
exploreViewController *view1 = [[exploreViewController alloc] initWithNibName:@"exploreViewController" bundle:nil];
view1.title= @"Explore";
Upcoming *view2 = [[Upcoming alloc] initWithNibName:@"Upcoming" bundle:nil];
view2.title = @"Upcoming";
TipsViewController *view3 = [[TipsViewController alloc] initWithNibName:@"TipsView" bundle:nil];
view3.title = @"Tips";
UINavigationController *nav1 = [[UINavigationController alloc] initWithRootViewController:view1];
UINavigationController *nav2 = [[UINavigationController alloc] initWithRootViewController:view2];
UINavigationController *nav3 = [[UINavigationController alloc] initWithRootViewController:view3];
[view1 release];
[view2 release];
[view3 release];
self.tabBarController = [[[UITabBarController alloc] init] autorelease];
self.tabBarController.viewControllers = [NSArray arrayWithObjects:nav1,nav2,nav3,nil];
self.tabBarItem = [[[UITabBarItem alloc] init] autorelease];
[nav1 release];
[nav2 release];
[nav3 release];
if (launchOptions != nil)
{
NSDictionary *remoteNotif = [launchOptions objectForKey: UIApplicationLaunchOptionsRemoteNotificationKey];
NSLog(@"Launched from push notification");
//Accept push notification when app is not open
if (remoteNotif) {
NSDictionary *alertBody = [remoteNotif objectForKey:@"loc-key"];
self.window.rootViewController = nav2; //this is what I want displayed when tapped but also maintain tab bar controller
[window addSubview:tabBarController.view];
[window makeKeyAndVisible];
}
}
else {
//Go here if just loading up normally without push
[window addSubview:tabBarController.view];
[window makeKeyAndVisible];
}
return YES;
}
質問は明確に定義されていません。! –
@hp iOSコーダー:ここにスタックしているすべてのユーザーが英語を話せるわけではありません。だから親切にして、それを撃つ.. – filou