小编tor*_*ado的帖子

如何使用ClientID和ClientSecret在Phonegap中使用Angularjs登录Google OAuth2

我正尝试使用Angularjs(使用Ionic Framework)通过Google OAuth2从我的Phonegap应用程序登录.目前我正在使用http://phonegap-tips.com/articles/google-api-oauth-with-phonegaps-inappbrowser.html进行登录.但它正在创建看起来非常难看的代码和非常难以理解的代码我正在使用Angular-UI-Router for Ionic.

如果没有任何正确的答案,这个问题似乎正在蔓延.我希望现在应该解决.Google Angular Guys应该会有所帮助. 如何在phonegap中实施Google Auth?

最接近的主题是如何使用带有Cordova/Phonegap的Google Login API,但这不是angularjs的解决方案.

我不得不使用以下代码传输javascript变量值:

        var el = document.getElementById('test');
        var scopeTest = angular.element(el).scope();
        scopeTest.$apply(function(){ 
            scopeTest.user = user;
            scopeTest.logged_in = true;
            scopeTest.name = user.name;
            scopeTest.email = user.email;
        });
Run Code Online (Sandbox Code Playgroud)

android angularjs cordova google-oauth

7
推荐指数
1
解决办法
6059
查看次数

标签 统计

android ×1

angularjs ×1

cordova ×1

google-oauth ×1