0
Google 로그인 인증이 이온 2 단계별로 제공됩니다. 내가 간단한 응답을 인쇄하려고하지만이온 2 Google Plus Authetication
GLogin(){
alert("you are in google plush ");
GooglePlus.login((res)=>{
alert(this.data=res);
});
}
Google 로그인 인증이 이온 2 단계별로 제공됩니다. 내가 간단한 응답을 인쇄하려고하지만이온 2 Google Plus Authetication
GLogin(){
alert("you are in google plush ");
GooglePlus.login((res)=>{
alert(this.data=res);
});
}
이 플러그인을 추가 작동하지 않습니다 (확인이 link) :
import { GooglePlus } from 'ionic-native';
이제 로그인 :
는cordova plugin add cordova-plugin-googleplus --save --variable REVERSED_CLIENT_ID=myreversedclientid
는 lib 디렉토리를 포함 :
googlePlus_login() {
GooglePlus.login(
{
'scopes': '',
'webClientId': '',
'offline': false
}
).then(
(success) => {
alert( '\n id: ' + JSON.stringify(success.userId) +
'\n name: ' + JSON.stringify(success.displayName) +
'\n email: ' + JSON.stringify(success.email)
);
},
(failure) => {
console.log('GOOGLE+ login FAILED', failure);
}
);
}
여기서
범위 : 범위의 선택, 공백으로 구분 된 목록에 포함되거나 비어 있지 않은 경우, 기본값은 프로파일 및 이메일합니다.
webClientId : 프로젝트의 자격 증명 설정에서 웹 응용 프로그램의 선택적 clientId - Android의 경우 idToken을 가져 오려면이 항목을 반드시 포함해야합니다. iOS에서는 필요하지 않습니다.
오프라인 : 선택 사항이지만 webClientId가 필요합니다. true로 설정하면 플러그인은 또한 Google 이외의 서버에 대한 오프라인 액세스 권한을 부여하는 데 사용할 수있는 serverAuthCode를 반환합니다.
로그 아웃 기능 :
googlePlus_logout() {
GooglePlus.logout().then(
(success) => {
console.log('GOOGLE+: logout DONE', success);
},
(failure) => {
console.log('GOOGLE+: logout FAILED', failure);
}
);
}
은 당신을 도울 것입니다 바랍니다. :)