I'm trying to implement rich push notification but having issue with register push notification.
Anybody help me?
I checked the apple doc and found the one way, some Class
is depericated in iOS 10 which we using till iOS 9.x
Steps are there:
UserNotifications
let center = UNUserNotificationCenter.current()
center.requestAuthorization(options: [.alert, .sound, .badge]) { (granted, error) in
// Enable or disable features based on authorization.
if granted == true
{
print("Allow")
UIApplication.shared.registerForRemoteNotifications()
}
else
{
print("Don't Allow")
}
}
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
print(deviceToken)
}