Get the identifier of a specific notification when it is tapped in the notification center or tapped when it first appears

时间:2017-07-10 15:29:41

标签: ios swift

I am trying to use the userNotificationCenter(_:didReceive:withCompletionHandler:) method (in Swift 4) to handle when a notification is tapped by the user. However, I would like to know the identifier of the specific notification that was tapped, and I have not been able to find a way to do this. Any suggestions?

1 个答案:

答案 0 :(得分:0)

原则上我要做的就是:

let identifier = response.notification.request.identifier

感谢您的回复!