How to add 'Choose an account' option of google sign-in with hybrid mobile app?

本秂侑毒 提交于 2019-12-24 15:08:05

问题


I've a hybrid mobile app which has built using cordova. Recently, I've included Google Sign-in feature into this. But, one issue which I'm facing is, even if my native gmail app connected to 3 other gmail accounts... it's not showing me the... "Choose an account" option like other mobile app shows.

EX :

One of my thought is, maybe because of my app is a hybrid app it's not getting access to native gmail accounts session. That's why, it's not showing me the option.

Am I right? How I can solve this problem ?


回答1:


I don't know how you implemented google login in your app. For displaying the choose account dialog box, you have to use Cordova Google plugin. By using this, it will call the google accounts linked to your android phone and the dialog box like you said will appear.

Hope it will meet your requirement.




回答2:


Try This :

this.afAuth.auth .signInWithPopup(new firebase.auth.GoogleAuthProvider().setCustomParameters({prompt: 'select_account'})) .then((user) => { // your logic code here

},(err) => {
  console.log("Error in auh service" + err);
 reject(err);

})



来源:https://stackoverflow.com/questions/33481944/how-to-add-choose-an-account-option-of-google-sign-in-with-hybrid-mobile-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!