ngx-cordova-oauth
ngx-cordova-oauth copied to clipboard
Cannot authenticate via web Browser
I just follow the examples and when compile the app to my phone(android) and click login it says that. Somebody can help me? or tell me what is the right configuration in the facebook console.
my register component look like this.
import { Component, OnInit } from '@angular/core';
import { Facebook, Google, LinkedIn } from 'ng2-cordova-oauth/core';
import { OauthCordova } from 'ng2-cordova-oauth/platform/cordova';
@Component({
selector: 'app-register',
templateUrl: './register.component.html',
styleUrls: ['./register.component.scss']
})
export class RegisterComponent implements OnInit {
private oauth: OauthCordova = new OauthCordova();
private facebookProvider: Facebook = new Facebook({
clientId: '**********',
appScope: ['email']
});
constructor() {}
ngOnInit() {}
login() {
this.oauth.logInVia(this.facebookProvider).then(
success => {
alert('RESULT: ' + JSON.stringify(success));
},
error => {
alert('ERROR: ' + error);
}
);
}
}
my register.html like this
<div class="network col-12">
<button (click)="login()" class="btn btn-primary connect">Sign Up With Facebook</button>
</div>
You need to use class OauthBrowser (located in ng2-cordova-oauth/platform/browser) instead of OauthCordova.