我正在构建一个 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/