onmyway133 / blog

🍁 What you don't know is what you haven't learned
https://onmyway133.com/
MIT License
669 stars 33 forks source link

How to get notification userInfo at launch #884

Open onmyway133 opened 2 years ago

onmyway133 commented 2 years ago

When user taps on push notification, depending on app state

SceneDelegate

Checking UIScene.ConnectionOptions.notificationResponse?.notification.request.content.userInfo in scene(_:willConnectTo:options:)

UNUserNotificationCenter

Checking UNNotificationResponse.notification.request.content.userInfo in userNotificationCenter(_:didReceive:withCompletionHandler:)

Read more