【问题标题】:PhoneGap 3.3 and Mobile Services HTML App on AndroidAndroid 上的 PhoneGap 3.3 和移动服务 HTML 应用程序
【发布时间】:2014-01-09 11:13:33
【问题描述】:

我已经安装了最新的 PhoneGap 版本 (3.3),打包了我的移动服务 HTML 应用程序并遇到了已知的授权问题:

仅支持从 http:// 和 https:// URL 登录。请将您的页面托管在网络服务器中

我已经在互联网上搜索过这个问题 (http://social.msdn.microsoft.com/Forums/windowsazure/en-US/a2386093-73cd-44fb-a418-4fa83a36c800/phonegap-apps-using-the-new-html-client-for-azure-mobile-services-is-not-working?forum=azuremobile),但该解决方案对我不起作用。 phonegap 创建的项目引用了<script type="text/javascript" src="phonegap.js"></script>,但即使我将其更改为<script type="text/javascript" src="cordova.js"></script>,它也不起作用。

这个问题有解决办法吗?

我的源代码:

<html>
<head>
    <meta charset="utf-8" />
    <title>Report</title>
    <meta name="format-detection" content="telephone=no" />
    <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height" />

    <script type="text/javascript" src="cordova.js"></script>
    <script src="http://ajax.aspnetcdn.com/ajax/mobileservices/MobileServices.Web-1.1.0.min.js"></script>
    <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
    <script src="myscript.js"></script>
</head>

myscript.js

var app = {
    initialize: function() {
        document.addEventListener('deviceready', this.onDeviceReady, false);
    },

    onDeviceReady: function() {
        var client = new WindowsAzure.MobileServiceClient(
            "https://myapp.azure-mobile.net/", "XXX");
        client.login("google").done(....
    },
};

$(document).ready(function documentReady() {
    app.initialize();
});

编辑 21.12.

显然,PhoneGap 3 不再在移动服务检查它的window.device.cordova 中报告其版本。但即使伪造它也无济于事 - 在 Google 授权后,它会进入空白页面。

【问题讨论】:

  • 在 iOS 项目中遇到同样的错误。有没有运气弄清楚这一点?
  • Azure 仍然存在 PhoneGap 问题。如果您从托管位置(如 jsfiddle)运行代码是否有效?
  • 您是否尝试过使用新的移动服务 PhoneGap 快速入门? windowsazure.com/en-us/documentation/articles/…。另外,您的 config.xml 中有 吗?
  • 您是否尝试过将 jquery 和 mobileservices js 文件复制到本地文件夹,而不是将它们引用到网络。

标签: javascript android html cordova azure-mobile-services


【解决方案1】:

最近已通过更新设备核心插件修复了版本问题。

device.cordova.version 应正确说明您正在运行的版本。

因此,如果您打算解决它,您现在也许可以做到。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-05-29
    • 2012-10-07
    • 2015-02-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-05-03
    相关资源
    最近更新 更多