firebase-ios-sdk icon indicating copy to clipboard operation
firebase-ios-sdk copied to clipboard

New Watch App project configuration from Xcode14 does not receive push notifications using Firebase Cloud Messaging

Open AkiraHayakawaJMAS opened this issue 3 years ago • 2 comments

Description

Xcode14 also eliminates the WatchKit Extension and allows everything to be integrated into the WatchKit App, as shown in the following Apple document. https://developer.apple.com/documentation/watchkit/wkapplication

This will also affect the processing of bundle identifiers, and there will be cases where the bundle identifier that can be retrieved programmatically will no longer have the watchkitextension.

Example: [[NSBundle mainBundle] bundleIdentifier] Xcode13:com.sample.bundle.app.watchkitapp.watchkitextension Xcode14:com.sample.bundle.app.watchkitapp

There is some functions in the Firebase Cloud Messaging framework that falls under this issue. It is FIRMessagingAppIdentifier and FIRMessagingBundleIDByRemovingLastPartFrom. This functions handles removing the last element of the bundleID. (I understand the purpose is to remove ".watchkitextension"). As noted in the source code comments, this is done in the watchKitExtension, so the This processing is performed to obtain the bundleId of watchKitApp.

However, starting with Xcode14, there will be cases where this process itself will no longer be necessary. If you adopt the new WatchApp project structure from Xcode14, you will need to use Messaging may not be able to send push notifications to the Apple Watch app.

We would appreciate your consideration to address this issue as soon as possible.

Reproducing the issue

Create a new Watch App project in Xcode14. Develop a Watch App to use and receive Firebadse Cloud messaging. Attempt to send messages through Firebase console or API, etc.

Firebase SDK Version

9.5.0

Xcode Version

14.0

Installation Method

Swift Package Manager

Firebase Product(s)

Messaging

Targeted Platforms

watchOS

Relevant Log Output

No response

If using Swift Package Manager, the project's Package.resolved

Expand Package.resolved snippet

Replace this line with the contents of your Package.resolved.

If using CocoaPods, the project's Podfile.lock

Expand Podfile.lock snippet

Replace this line with the contents of your Podfile.lock!

AkiraHayakawaJMAS avatar Aug 27 '22 03:08 AkiraHayakawaJMAS

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

google-oss-bot avatar Aug 27 '22 03:08 google-oss-bot

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

google-oss-bot avatar Aug 27 '22 03:08 google-oss-bot

This should be fixed with https://github.com/firebase/firebase-ios-sdk/pull/10324.

aashishpatil-g avatar Nov 04 '22 21:11 aashishpatil-g