iOS push notification: how to detect if the user tapped on notification when the app is in background?

前端 未结 12 1700
情深已故
情深已故 2020-11-29 15:43

There are a lot of stackoverflow threads regarding this topic, but I still didn\'t find a good solution.

If the app is not in the background, I can check launc

12条回答
  •  北荒
    北荒 (楼主)
    2020-11-29 16:01

    If you have "Background Modes" > "Remote notifications" checked == YES, tap on notification event will arrive in:

    -(void)userNotificationCenter:(UNUserNotificationCenter *)center **didReceiveNotificationResponse**:(UNNotificationResponse *)response withCompletionHandler:(void(^)())completionHandler.
    

    It helped me. Please enjoy :)

提交回复
热议问题