-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[Messaging] Xcode 14 watchkit extension bundle id fix #10324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Coverage Report 1Affected Products
Test Logs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pending approval on testing on a real device.
Also please address the comment for older version for backward compatibility.
|
Tested on device for both old and new scenarios and confirmed that logic works. |
Discussion
Fix for #10147
In versions of Xcode prior to Xcode 14, whenever a watch app was created, Xcode always created two targets
Watch App (contained assets for the app but no code)
Watch Kit Extension (contained the code / logic for the app)
Xcode 14 onwards, no watch kit extension target is created for watchOS apps. There is a consolidated Watch App target that contains both code and assets.
Firebase Messaging code used to strip out the watch extension suffix and use the watch app bundle ID for FCM registration. Since there is no extension anymore, the code is inadvertently stripping out the last component of the app bundle identifier itself, resulting in an incorrect bundle ID being used for FCM registration.
This change detects if code is running in an extension by looking for the watch kit NSExtensionPointIdentifier in the Info.plist before stripping out the last component of the bundle identifier.
Testing
API Changes
None