I am using Ionic2
with Cordova
to authenticate a user in Firebase
.
I can build the app and run it on iOS Simulator
(Xcode
). However, as soon as I try log in a user with the following code using ionic-native ("ionic-native": "2.2.11",) GooglePlus
:
loginGoogleCordova(): void {
GooglePlus.login(['public_profile', 'email']).then(googleData => {
let provider = firebase.auth.GoogleAuthProvider.credential(googleData.authResponse.accessToken);
firebase.auth().signInWithCredential(provider).then((data) => {
this.signIn(data);
});
}, error => {
this.loading.dismiss();
console.error('loginGoogle: ' + error);
this.doAlert('loginGoogle: ' + error.message);
});
}
I get the following error:
2017-03-06 07:55:06.433 theWhoZoo[10489:868996] *** WebKit discarded
an uncaught exception in the
webView:decidePolicyForNavigationAction:request:frame:decisionListener:
delegate: -[__NSArrayM
objectForKeyedSubscript:]: unrecognized selector sent to instance
0x6100002471a0
More Info:
I can successfully authenticate a user in a browser with AngularFire2
.
loginGoogleBrowser() {
this.auth.login({ provider: AuthProviders.Google, method: AuthMethods.Popup }).then((data: FirebaseAuthState) => {
this.signIn(data);
}).catch((error) => {
this.loading.dismiss();
console.error('loginGoogle', error);
this.doAlert('loginGoogle: ' + error.message);
});
}
Any help appreciated.