Sorry , i thought because of this warning plugins are not installing successfully .
I am just exploring all Native plugins to test how it works, but in some cases error coming that “plug in not installed”.
This one giving error for google-plugin ,
undefined
"Native: tried calling GooglePlus.login, but the GooglePlus plugin is not installed."
"Install the GooglePlus plugin: 'ionic cordova plugin add cordova-plugin-googleplus'"
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { ProfilePage } from '../profile/profile';
import { GooglePlus } from '@ionic-native/google-plus';
import firebase from 'firebase';
@Component({
selector: 'page-home',
templateUrl: 'home.html'
})
export class HomePage {
userProfile: any = null;
constructor(public navCtrl: NavController,private googlePlus: GooglePlus) {
try {
firebase.auth().onAuthStateChanged( user => {
if (user){
this.userProfile = user;
} else {
this.userProfile = null;
}
});
} catch (error) {
console.log(error);
}
}
loginUser(): void {
this.googlePlus.login({
'webClientId': '******************************************************',
'offline': true
}).then( res => console.log(res))
.catch(err => console.error(err));
}
goto(){
this.navCtrl.push(ProfilePage,{item:""});
}
}
app.module.ts
-------------------
import { BrowserModule } from '@angular/platform-browser';
import { ErrorHandler, NgModule } from '@angular/core';
import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';
import { MyApp } from './app.component';
import { HomePage } from '../pages/home/home';
import { ListPage } from '../pages/list/list';
import { ProfilePage } from '../pages/profile/profile';
import { DetailsPage } from '../pages/details/details';
import { HttpModule } from '@angular/http';
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';
import { Camera } from '@ionic-native/Camera';
import { SQLite, SQLiteObject } from '@ionic-native/sqlite';
import { GooglePlus } from '@ionic-native/google-plus';
@NgModule({
declarations: [
MyApp,
HomePage,
ListPage,
ProfilePage,
DetailsPage
],
imports: [
BrowserModule, HttpModule,
IonicModule.forRoot(MyApp),
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
HomePage,
ListPage,
ProfilePage,
DetailsPage
],
providers: [
StatusBar,
SplashScreen,
Camera,
SQLite,
GooglePlus,
{ provide: ErrorHandler, useClass: IonicErrorHandler }
]
})
export class AppModule { }
When i reinstalling google plugin it showing this
C:\AngularProjects\SideMenuAPP\SideMenuAPP>ionic cordova plugin add cordova-plugin-googleplus --variable REVERSED_CLIENT_ID=****************************
> cordova plugin add cordova-plugin-googleplus --variable REVERSED_CLIENT_ID=**************************** --save
√ Running command - done!
Plugin "cordova-plugin-googleplus" already installed on android.
Saved plugin info for "cordova-plugin-googleplus" to config.xml
C:\AngularProjects\SideMenuAPP\SideMenuAPP>npm install --save @ionic-native/google-plus
SideMenuAPP@0.0.1 C:\AngularProjects\SideMenuAPP\SideMenuAPP
`-- @ionic-native/google-plus@4.1.0
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current:
{"os":"win32","arch":"x64"})
npm WARN ajv-keywords@2.1.0 requires a peer of ajv@>=5.0.0 but none was installed.
And the big issue is ,this problem is inconsistent , not happening with all plugin, camera is working fine. pls help