fechanique / cordova-plugin-fcm

Google FCM Push Notifications Cordova Plugin
624 stars 989 forks source link

Ionic Cloud Package GoogleService.plist not found #270

Open casper5822 opened 7 years ago

casper5822 commented 7 years ago

Hello everyone, I try to build my ionic app on Ionic Cloud Service. The Ionic package function make a copy only of the www project folder and upload it on the Ionic cloud. During the package the plugin fails the installation with this error:

**Fetching plugin "cordova-plugin-fcm" via npm Installing "cordova-plugin-fcm" for ios

    Cordova FCM plugin v2.1.1 installed
    For more details visit https://github.com/fechanique/cordova-plugin-fcm

Error: cordova-plugin-fcm: You have installed platform ios but file 'GoogleService-Info.plist' was not found in your Cordova project root folder.**

I think it's a problem of the built-in plugin hook, this because it looks for the file in the root folder, and not also in the www folder. Maybe i made some mistake, do you have some tips?

Best Regards.

connois commented 7 years ago

I have the same issue. Trying to compile on Ionic Cloud and get this same error:

Error: cordova-plugin-fcm: You have installed platform ios but file 'GoogleService-Info.plist' was not found in your Cordova project root folder.

rehanhanar7 commented 7 years ago

This is simple issue Create your app profile in FCM console and download the .plist file from the fcm console then put it in the root of the project folder thats it

casper5822 commented 7 years ago

I have the plist file in my project root folder, the problem is not in the local enviroment but on the ionic cloud. The package function that uploads the project to the ionic cloud does not copy the files inside the project folder ( it copy only the index.html and the package.json at this level) and only the www folder so the plugin at build time fail on the ionic platform

connois commented 7 years ago

Yeah same here. I also had created the project on Firebase and copied the GoogleService-Info.plist inside the project. But it seems that this file does not get uploaded on the Ionic Cloud when we run the "ionic package build ios --profile dev" command to build on the cloud.

Actually, thinking about it, @casper5822, maybe this is an issue we should take to the Ionic Cloud team instead of here. I don't think this is a cordova-plugin-fcm issue, more a Ionic Cloud issue.

I just tried to compile on android in the Cloud and we get a similar issue :

Error: cordova-plugin-fcm: You have installed platform android but file 'google-services.json' was not found in your Cordova project root folder.

This is definitly an issue with thoses 2 files not being copied onto the Ionic Cloud !

I just created a post in the Ionic Forum : https://forum.ionicframework.com/t/fail-to-compile-on-ionic-cloud-with-cordova-plugin-fcm/83208

@casper5822, you should tell also your story in the same thread. Would help !

casper5822 commented 7 years ago

I think, ionic team upload few files at the root level on their cloud for security issues maybe. The solution is maybe simple, just modify the plugin hook during the search phase to look for the config file also in the www folder.

the script is this:

if (directoryExists("platforms/ios")) { var path = "GoogleService-Info.plist";

so become var paths = ["GoogleService-Info.plist","www/GoogleService-Info.plist"]

olivier-po commented 6 years ago

@casper5822, I'm having the same issue. Where do you add this script ?

ron-gonzalez commented 6 years ago

There is a solution for this problem ? I have tried manual copy and all steps but when compiling in ionic cllud always the same error "Error: cordova-plugin-fcm: You have installed platform android but file 'google-services.json' was not found in your Cordova project root folder."

In local works perfectly

Thanks !

jimbomilk commented 6 years ago

Yes you can use a hook of the ionic cloud...more instructions here: https://github.com/ionic-team/ionic-package-hooks

belherdigital commented 6 years ago

hi @jimbomilk , i checked your given link, but i am little confuse how to use ionic hook, i am trying to build ios app by ionic package build ios command, and i have added hook to my config file, but i am still facing error

Prodev2017 commented 6 years ago

I copied plist file into project root folder on ionic 3 but i got same errors Please help me my error