1

私はプッシュ通知を実装しており、ユーザーが通知をタップしたときに、ユーザーを別のビュー コントローラー (アプリを開くだけではなく) に誘導しようとしています。私はアップルのウェブサイトの例から離れようとしていましたが、まだ運がありません.

私のコードに入る必要さえないようです。それを証明するために NSLog を入れてみましたが、正しかったです。

誰かが理由を知っていますか?実装したいビュー コントローラーは statsViewController と呼ばれます。

ありがとう

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {  

NSDictionary *remoteNotif = [launchOptions objectForKey: UIApplicationLaunchOptionsRemoteNotificationKey];

if (remoteNotif) {      


    NSLog (@"We are here now");
    [self handleRemoteNotification:application userInfo:remoteNotif]; //custom method where View controller will be implemented
    return YES;
}

[window addSubview:tabBarController.view];
[window makeKeyAndVisible];

return YES;
}


-(void) handleRemoteNotification:(UIApplication *)application userInfo:(NSDictionary *)userInfo {
application.applicationIconBadgeNumber = 0;

statsViewController* viewController = [[statsViewController alloc] init];
[navController pushViewController:viewController animated:YES]; //Don't think this is right since I never use it in didFinishLaunching... I simply just declared it delegate.h
[viewController release];

 }
4

0 に答える 0