Unable to receive notification data in Swift 5

Hello everyone, I’m trying to handle notifications in Swift 5 when my app is completely closed. All the methods I tried, I can’t receive the data of the notification when the app opens. Does anyone know how to fix this?

Hi @blakerocks, are you using local notifications or remote?

hi @blakerocks,
What is your xcode version? Do you have just the AppDelegate in your project or also a SceneDelegate?

There is a function that handles when notifications are received, so when you tap on a notification and it will open/start your application. The data is passed to you in a structure with the UserData.


@lewis-h, awesome! Thank you for sharing your solution. Glad you were able to figure it out.

This topic was automatically closed after 166 days. New replies are no longer allowed.