IONIC3 firebase error


#1

IONIC3 Firebase error

Dear.

I’m developing a mobile app using IONIC3.
It does not have any special features, and it automatically calls the mobile web page when the app is launched.

home.ts

export class HomePage {

constructor(public navCtrl: NavController, private iab: InAppBrowser, private firebaseNative: Firebase, private platForm: Platform) {
this.getToken();
}

async getToken() {
let pmxtoken;

if ( this.platForm.is('android') ) {
  pmxtoken = await this.firebaseNative.getToken();
}

if ( this.platForm.is('ios') ) {
  pmxtoken = await this.firebaseNative.getToken();
  await this.firebaseNative.grantPermission();
}
return this.openWebPagePMX(pmxtoken);

}

openWebPagePMX(pmxtoken) {
const options: InAppBrowserOptions = {
zoom: ‘no’,
location: ‘no’
}
this.iab.create('http://pmx.dskorea.com/Windchill/ext/common/portal/viewMain?token=’+pmxtoken, ‘_blank’, options);
}

}

I have run Visual studio code using ‘Run Android on device’ using debug and I have seen the following error message.

///////////////////////////////////
Angular is running in the development mode. Call enableProdMode() to enable the production mode.
core.js:3688
Ionic Native: tried calling Firebase.getToken, but the Firebase plugin is not installed.
util.js:44
Install the Firebase plugin: ‘ionic cordova plugin add cordova-plugin-firebase’
util.js:56
ERROR
core.js:1449
Error: Uncaught (in promise): plugin_not_installed
///////////////////////////////////

When I use this.firebaseNative.getToken (), I get an error.

Let me know if you have a solution

Thank you.

Ionic Framework: 3.9.3
Ionic App Scripts: 3.2.3
Angular Core: 5.2.11
Angular Compiler CLI: ^7.2.12
Node: 10.15.3
OS PLatform: macOS


#2

Have you installed Firebase plugin using this command?


#3

Also you need to wait for the platform to be ready before interacting with any plugins.


#4

yes I’m using this command.
$ ionic cordova plugin add cordova-plugin-firebase


#5

I do not understand well.
This is the second operation in the same way.
The first operation was normal,
I am working again, but it is not working normally.


#6

okay then try this:
1)Delete all the node modules and run the command npm install
2)Then remove the platform and add it again ionic cordova platform rm ios
ionic cordova platform add ios
3) And then again try to run the project.
maybe it works and your issue will be resolved.


#7

I’ve been working on your suggestion.

this.firebaseNative.getToken()
.then(token => alert(The token is ${token}))
.catch(error => alert(‘Error getting token’+ error));

/// Error getting token => plugin_not_installed ///
The above error message appears. Any other options?
Thank you for your help.


#8

Hi, @wysong

Can you share your package.json and config.xml file over here

Thanks


#9

config.xml

https://drive.google.com/open?id=1jrQyxNIE5S3dPg1UQMCbv9VRHW4DWzxx

package.json

https://drive.google.com/open?id=1XBVFMwEaZRAKF_MxsjCfjIlasO6EQPDH

Thanks


#10

The whole project.

https://drive.google.com/open?id=1UkjTaivF75hQ7NdiYhGCOOF-y52sqe4g

Thanks for your help.


#11

You need to generate Reverse_client_Id


#12

Hi, @addwebsolution

won-yeong-ui-MacBookPro:pmx wysong$ cordova plugin list
cordova-plugin-device 2.0.2 “Device”
cordova-plugin-firebase 2.0.5 “Google Firebase Plugin”
cordova-plugin-inappbrowser 3.0.0 “InAppBrowser”
cordova-plugin-ionic-keyboard 2.1.3 “cordova-plugin-ionic-keyboard”
cordova-plugin-ionic-webview 3.1.2 “cordova-plugin-ionic-webview”
cordova-plugin-splashscreen 5.0.2 “Splashscreen”
cordova-plugin-statusbar 2.4.2 “StatusBar”
cordova-plugin-whitelist 1.3.3 “Whitelist”
won-yeong-ui-MacBookPro:pmx wysong$

but Error getting token -> plugin_not_installed

Thanks.


#13

Hi @rahulsharma991
config.xml
<widget id=“com.dskorea.pmx” version=“0.0.1”

google-service.json
“package_name”: “com.dskorea.pmx”

what is “Reverse_client_Id” ?


#14

Hit that link and watch thus video----

https://m.youtube.com/watch?v=TCcvji4ow40