how to call getBasicProfile() of google to google signin on only button click?

后端 未结 2 1176
花落未央
花落未央 2021-02-06 15:34

i have take google signin in my website :





        
2条回答
  •  没有蜡笔的小新
    2021-02-06 15:38

    I done it by declaring global js variable as false

    var isFirstGoogle = 0;
    

    Then to check this variable

    if(isFirstGoogle)
    {
    //wont enter here first time
    }
    isFirstGoogle = 1;
    

    So next time when I click on button the above method will be called as now isFirstGoogle = 1;

    Hope this help!! It's a temporary thing I know but it's working for me.

提交回复
热议问题