Good day, colleagues! Faced a problem - my push notifications work fine on any device, but they stubbornly refuse to work on CarPlay.
I have a code in my AppDelegate:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
let center = UNUserNotificationCenter.current()
center.delegate = self
center.requestAuthorization(options: [.alert, .sound, .badge, .carPlay, .announcement, .criticalAlert, .provisional]) { (granted, error) in
}
return true
}
Maybe someone was faced with this problem?
I have a code in my AppDelegate:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
let center = UNUserNotificationCenter.current()
center.delegate = self
center.requestAuthorization(options: [.alert, .sound, .badge, .carPlay, .announcement, .criticalAlert, .provisional]) { (granted, error) in
}
return true
}
Maybe someone was faced with this problem?
You should
registerForPushNotifications() or now registerForRemoteNotifications()
before returning
Have a look at this tutorial:
https :// www.raywenderlich . com/ 11395893-push-notifications-tutorial-getting-started
Not sure it is a problem with american car. Did you try a european ? 😉
Don't forget to close the thread if that works.
registerForPushNotifications() or now registerForRemoteNotifications()
before returning
Have a look at this tutorial:
https :// www.raywenderlich . com/ 11395893-push-notifications-tutorial-getting-started
Not sure it is a problem with american car. Did you try a european ? 😉
Don't forget to close the thread if that works.