Xcode 14 RC Mac Catalyst fails to registerForRemoteNotifications

Using the latest Xcode 14 Release Candidate Version 14.0 (14A309) I stop have registering for remote notifications on a Mac Catalyst application.

It calls the func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) and the error is:

Notifications are not allowed for this application

This is happening on macOS Monterey Version 12.5.1 in a MacBook Pro (14-inch, 2021).

Does it work if you use Xcode 13?

Turns out Xcode 14 removes the entitlement from the xcent file before embedding that in the code signature. You should be able to do something like:

/usr/libexec/PlistBuddy -c "Add :aps-environment string development" "$TARGET_TEMP_DIR/$FULL_PRODUCT_NAME.xcent"

In a build script towards the end of the build.

This is now fixed and working OK in XCode 14.1 beta 3

Xcode 14 RC Mac Catalyst fails to registerForRemoteNotifications
 
 
Q