Closed morsagmon closed 9 months ago
This issue needs more information before it can be addressed. In particular, the reporter needs to provide a minimal sample app that demonstrates the issue. If no sample app is provided within 15 days, the issue will be closed.
Please see the Contributing Guide for how to create a Sample App.
Thanks! Ionitron 💙
Hello Ionitron. I'd be happy to reproduce for you to check. Please refer me to a service that allows a reproduction of such a situation: Angular with Capacitor and Firebase notifications on an XCode MAC with emulators. I'm not familiar with such a service. I really thought I provided a very thorough description and information. If you are missing something please let me know and I'll do my best to complete. Thanks! Mor
Updating that the problem persists as I tried the following:
Another update: I thought I use the angular/fire library (AngularFireMessaging) to register and obtain the token from Firebase, bypassing the capacitor registration service. It behaves exactly as with the capacitor library, with the exact same console log output. Leads me to assume this is not capacitor-specific, but rather something in the way XCode emulator approaches Firebase for registration.
Push notifications only work in the iOS simulator if you are in macOS 13.x, Xcode 14.x and Apple silicon computer. Since you say latest Xcode you can install is 14.2, I would assume you are in macOS 12.x as Xcode 14.3 requires macOS 13.x.
So it's not a bug, it's a limitation of the iOS simulator.
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of the plugin, please create a new issue and ensure the template is fully filled out.
Bug Report
Plugin(s)
Capacitor Version
Platform(s)
iOS on Xcode Emulator (iPhone 14, for example). XCode 14.2 (the latest supported on my Mac).
Current Behavior
Launching the app in an Emulator on XCode - the app hangs with the splash screen and an endless spinner. Very little info is given in the terminal, which looks like this:
The log shows that the app hangs when attempting the Firebase registration request. This is throwing to the console:
console.log('FireBase Permission granted');
But this is not throwing to the console:console.log('In registration. My token: ' + JSON.stringify(token));
(What you see in the above terminal:
⚡️ [log] - Received firebase token:
is just a subscriber in the app.component awaiting the token to be emitted, which obviously not yet emitting).Updating that the problem persists as I tried the following:
Another update: I thought I use the angular/fire library (AngularFireMessaging) to register and obtain the token from Firebase, bypassing the capacitor registration service. It behaves exactly as with the capacitor library, with the exact same console log output. Leads me to assume this is not capacitor-specific, but rather something in the way XCode emulator approaches Firebase for registration.
For completeness, here is the full service code:
Expected Behavior
Normally, the token is received and the app home page comes up. Important: This app is working perfectly fine, including push notification, in the following:
It only fails in the XCode emulator, on my local machine as well as on Apple's testing emulators during a review process of the app, causing a rejection of the app.
Code Reproduction
Naturally, there is no way for me to share a reproduction of this environment as usual, such as on Stackblitz, given the unique nature of the Xcode-Emulator environment needed.
Other Technical Details
XCode 14.2
Additional Context
This app was upgraded to the latest Capacitor family version ^5.0.0 along with respective dependencies, but was downgraded back to ^4.0.0 after major issues with Android Studio not resolved over many days, as can be seen here: https://stackoverflow.com/questions/76845287/android-studio-build-failed-tiramisu-and-packageinfoflags-not-found
Podfile:
package.json: