cordova - WindowsAzure.MobileServiceClient.login 不返回完成 promise

标签 cordova azure winjs azure-mobile-services

我正在构建一个 Apache Cordova 移动应用,使用 Azure 移动服务向 Google 进行身份验证。为此,我使用 WinJS azure 客户端:

var client = new WindowsAzure.MobileServiceClient("<myMobileService>", "<myKey>");


function logIntoGoogle() {
    client.login("google").done(function(results){
            //do something
        },
        function (error) {
        alert(error);
    });
}

应用程序点击 logIntoGoogle,成功登录后,应用程序导航到 [myMobileService]/login/done,而不是返回完成 promise 并执行回调。

请问我是不是漏掉了什么?

最佳答案

好吧,事实证明问题并不在于我对 azure API 的使用。这更多是我的 Cordova 应用程序的设置/配置问题。

我需要安装phonegap设备插件 ( https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git )

以及phonegap InAppBrowser 插件 ( https://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser.git )。

安装后, promise 返回并执行回调。

关于cordova - WindowsAzure.MobileServiceClient.login 不返回完成 promise ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27755523/

相关文章:

android - 在不使用媒体查询的情况下,在横向和纵向模式下保持图像的高度和宽度相同

sqlite - WinJS SQLite runAsync all 在做其他事情之前

windows - "' WinJS ' is not defined."和 "Windows' 未定义。”

sql-server - 性能 Azure 弹性池数据库

javascript - 在 Metro Style 应用程序中保存本地数据

android - 将 ionic 框架添加到现有的 android studio 应用程序

ios - Phonegap iOS 检索设备语言

android - 如何解决Cordova应用突然崩溃的问题?

azure - 将 Azure Devops PAT API 与服务主体结合使用

java - 如果数据库不存在,是否可以使用 Java 代码在 PostgreSQL for Azure 中动态创建该数据库?如果是,怎么办?