4

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).

Vijay Kahar
  • 1,082
  • 1
  • 7
  • 20
  • 1
    check 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 Answers1

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