fechanique / cordova-plugin-fcm

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

Native: tried calling FCM.getToken, but the FCM plugin is not installed. #478

Open evallgar opened 6 years ago

evallgar commented 6 years ago

I'm having this issue when trying to use FCM Plugin.

console.warn: Native: tried calling FCM.getToken, but the FCM plugin is not installed. [23:30:37] console.warn: Install the FCM plugin: 'ionic cordova plugin add cordova-plugin-fcm'

Ionic info:

`` cli packages: (/Users/***/.nvm/versions/node/v7.9.0/lib/node_modules)

@ionic/cli-utils  : 1.19.1
ionic (Ionic CLI) : 3.19.1

global packages:

cordova (Cordova CLI) : 7.1.0

local packages:

@ionic/app-scripts : 3.1.5
Cordova Platforms  : android 6.4.0 ios 4.5.4
Ionic Framework    : ionic-angular 3.9.2

System:

Android SDK Tools : 26.1.1
ios-deploy        : 1.9.2
ios-sim           : 5.0.11
Node              : v7.9.0
npm               : 5.6.0
OS                : macOS High Sierra
Xcode             : Xcode 9.2 Build version 9C40b

Environment Variables:

ANDROID_HOME : /Users/*****************/Library/Android/sdk

Misc:

backend : pro

Any ideas how to solve it? Thanks.

RSDoo commented 6 years ago

Same here After adding the platform with:

ionic cordova platform add ios

The plugin get's an error while adding the platform

Failed to install 'cordova-plugin-fcm': CordovaError: Uh oh! Cannot find framework "/Users/******/plugins/cordova-plugin-fcm/src/ios/firebase/FirebaseAnalytics.framework" for plugin cordova-plugin-fcm in iOS platform

local packages:

@ionic/app-scripts : 3.1.8
Cordova Platforms  : ios 4.5.4
Ionic Framework    : ionic-angular 3.9.2

Any idea how to fix this?

evallgar commented 6 years ago

I think that this repo is no longer been maintained. I moved to ostownsville/cordova-plugin-fcm. I'm still getting the same error with this new repo, but I think I can get some more uselful help than in here.

@DanTTea if you find a solution, please let me know. I will do so.

RSDoo commented 6 years ago

This is how i fixed it: First I cloned my project from my git repository into a new folder and did a npm install After that i added the platform with ionic cordova platfrom add ios and everthing worked fine.
Make sure the GoogleService-Info.plist is correct and in the root folder.

Seems like if u delete the platform and readd, something is cached and not really recreated. Hope this will help u too!

cipriancirstea commented 6 years ago

So every time I want to remove the ios platform i have to clone the whole project? That seems a bit annoying. Can't whatever is being cached be cleared? npm cache clean

writer0713 commented 6 years ago

I think it is because of dependency problem. When we use ionic cordova platform add ios command, it collects all the dependencies to make ios project. If you add another cordova plugin later, it means previous(existing) ios project doesn't have this new plugin. so to make it clear, we need to rm platform and add platform again as @DanTTea said above.

kapilSoni101 commented 4 years ago

@evallgar : are u fixed above issue?

Mahfoudh-gary commented 4 years ago

uninstall your app