LoginSignup
1
0

More than 1 year has passed since last update.

[iOS] アプリ終了時 プッシュ通知表示

Last updated at Posted at 2022-03-10

・プッシュ通知受信 アプリが起動中に受信した場合

-(void)application:(UIApplication *) application
    didReceivedRemoteNotification:(NSDirctionary *)usetInfo {
}

・プッシュ通知受信-アプリがフォアグランドの状態である場合に、通知表示前にコールされる

-(void)userNotificationCenter:(UNUserNotificationCenter *)center
    willPresentNotification:(UNNotification *)notification
    withCompletionHandler:(void(^)(UNNotificationPresentationOptions))completionHandler{
    NSLog(@"Push通知受信");
}

・プッシュ通知受信-ユーザーが通知をタップ後にコールされる

-(void)userNotificationCenter:(UNUserNotificationCenter *)center
    didReceiveNotificationResponse:(UNNotificationResponse *)response
    withCompletionHandler:(void(^))completionHandler{
    NSLog(@"Push通知受信");
}

・アプリ未起動時のプッシュ通知タップイベント受取

func application(_:didFinishLaunchingWithOptions:)

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

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0