PhoneGap 3.3 and Mobile Services HTML App on Android

Viewed 889

I've installed the latest PhoneGap version (3.3), packaged my Mobile Services HTML application and hit the known authorization issue:

Login is only supported from http:// and https:// URLs. Please host your page in a web server

I've searched internet for this issue (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) but the solution does not work for me. The project created by phonegap references <script type="text/javascript" src="phonegap.js"></script> but even when i changed it to <script type="text/javascript" src="cordova.js"></script> it does not work.

Is there any solution for this issue?

My source code:

<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();
});

Edit 21.12.

Apparently PhoneGap 3 does not report its version in window.device.cordova anymore where Mobile Services checks it. But even faking it did not help - after authorization on Google, it goes to empty page.

1 Answers
Related