Open laagland opened 6 years ago
A workaround is to comment out the line to prevent the removal of the file during the debug build (line 56 in platforms/ios/cordova/lib/copy-www-build-step.js).
This could be done by added a hook to the plugin which will execute after platform add and or removes the line or comments it out
@laagland let's vote up the cordova issue so it gets fixed. I just voted and started watching it.
Hi there, Cordova project on Xcode10 is failure for FCM because of XCode's new build system.
If you want to use Google FCM Push Notification with iOS device (Coding with Cordova / Ionic 3) try this; Opening your cordova/ionic project in the Xcode IDE and change the build system in Workspace Settings to "Legacy Build System". (Under the File Menu)
@ecert works perfectly! So now we need to wait for a fix in order to return back to the new build system?
Hi there, Cordova project on Xcode10 is failure for FCM because of XCode's new build system.
If you want to use Google FCM Push Notification with iOS device (Coding with Cordova / Ionic 3) try this; Opening your cordova/ionic project in the Xcode IDE and change the build system in Workspace Settings to "Legacy Build System". (Under the File Menu)
This worked for me with ionic 3.9. Thanks for the fix (y) @ecert
Seems to me that the XCode 10 issue is a different kind of issue then the one we are focusing on here.
Hi there, Cordova project on Xcode10 is failure for FCM because of XCode's new build system.
If you want to use Google FCM Push Notification with iOS device (Coding with Cordova / Ionic 3) try this; Opening your cordova/ionic project in the Xcode IDE and change the build system in Workspace Settings to "Legacy Build System". (Under the File Menu)
It's actually fixes the issue with iOS12 but breaks any previous version of iOS.
I confirm commenting out ☝️ line 56 fixed FCM pushes for debug builds.
@2mia it's also works for me !!!! many thanks !
Hi there, Cordova project on Xcode10 is failure for FCM because of XCode's new build system.
If you want to use Google FCM Push Notification with iOS device (Coding with Cordova / Ionic 3) try this; Opening your cordova/ionic project in the Xcode IDE and change the build system in Workspace Settings to "Legacy Build System". (Under the File Menu)
So go to:
Xcode > File > Workspace Settings...
Hi there, Cordova project on Xcode10 is failure for FCM because of XCode's new build system.
If you want to use Google FCM Push Notification with iOS device (Coding with Cordova / Ionic 3) try this; Opening your cordova/ionic project in the Xcode IDE and change the build system in Workspace Settings to "Legacy Build System". (Under the File Menu)
This working for me in Xcode 10.1. Thanks.
Hi there, Cordova project on Xcode10 is failure for FCM because of XCode's new build system.
If you want to use Google FCM Push Notification with iOS device (Coding with Cordova / Ionic 3) try this; Opening your cordova/ionic project in the Xcode IDE and change the build system in Workspace Settings to "Legacy Build System". (Under the File Menu)
Worked for me as well. Thanks
Expected Behaviour
When configuring iOS on FCM notifications for debug-signed apps should arrive.
Actual Behaviour
Sending notifications gives a 'InvalidRegistration' error and when attempted a second time with the same FCM token, a 'NotRegistered' error.
Steps to Reproduce
We use separate debug & production versions of our apps. When using a debug-only version, we couldn't get notifications delivered to our client apps.
Using the debugger in Xcode, we noticed the following error from Firebase:
[Firebase/InstanceID][I-IID003014] Error while reading embedded mobileprovision Error Domain=NSCocoaErrorDomain Code=260 "The file “embedded.mobileprovision” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/var/containers/Bundle/Application/XXX/embedded.mobileprovision, NSUnderlyingError=0x28127d620 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
It turns out that Cordova uses a hook during the ios-build, which removes the embedded.mobileprovision that Firebase uses to determine if this is a production app or not. Because this is missing, debug-only signed apps will not receive the correct FCM token when the plugin makes a request to Firebase.
A workaround is to comment out the line to prevent the removal of the file during the debug build (line 56 in platforms/ios/cordova/lib/copy-www-build-step.js). An issue was created to fix this in cordova, see https://issues.apache.org/jira/browse/CB-14264
Platform and Version (eg. Android 5.0 or iOS 9.2.1)
iOS 12 on iPhone & iPad
Cordova CLI version and cordova platform version
cordova-cli 8.0 cordova-ios 4.5.5
Plugin version
phonegap-plugin-push v2.2.3