I'm working on a ios Application, now I want to get the action of push notification's allow button, the user will be push to second view controller once user select one of push notification option(don't allow, allow).
Asked
Active
Viewed 334 times
4
-
1check this [answer](https://stackoverflow.com/questions/40531103/swift-ios-check-if-remote-push-notifications-are-enabled-in-ios9-and-ios10/41911664#41911664) – Prakash Tripathi Mar 26 '19 at 07:13
-
https://stackoverflow.com/questions/40531103/swift-ios-check-if-remote-push-notifications-are-enabled-in-ios9-and-ios10?noredirect=1&lq=1 – Puji Wahono Mar 26 '19 at 07:57
1 Answers
0
You need to call these methods in AppDelegate Class.
//Ios 10 delegates for Push Notifications
func userNotificationCenter( _ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping ( _ options: UNNotificationPresentationOptions) -> Void){
print("Handle push from foreground")
}
func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void){
print("Handle push from background or closed")
}

Deviyani Swami
- 749
- 8
- 17
-
Thanks for the help!, Sorry but i'm unable to upvote your answer i dont have enough repuration. – Vijay Kahar Mar 26 '19 at 13:12
-