0

Phonegap、HTML5 を使用してモバイル アプリを作成しています。これにより、Android デバイスがターゲットになります。このアプリは、通知の助けを借りてトラフィックの更新をユーザーにフィードできるはずです。そのようなプロジェクトを行ったことがあり、そのようなアプリを行う際に私を案内できる人はいますか?

4

1 に答える 1

0

プッシュ通知プラグインがあります https://github.com/phonegap-build/PushPlugin

これはそれを行うための記事です

http://www.adobe.com/devnet/phonegap/articles/android-push-notifications-with-phonegap.html

どこからでもajaxを使用して反対のプルを行うこともできます。これは、jquery ajax 呼び出しを使用した例です。

function sendToServer(request, onSuccess) {
    LOG("sendToServer - " + request);

    $.ajax({
        type: "GET",
        url:  ServiceHandlerURL + request,
        dataType: "xml",
        success: onSuccess,
        error: function (xhr, status, error) {
                LOG("Request URL Error: " + xhr.responseText + " | " + status + " | " + error);
           if (error != ""){
               navigator.notification.alert("An Error occurred. May be due to loss of internet connection. Error: " + xhr.responseText + " | " + error);}
                // navigator.app.exitApp(); // ?? what to do ??
           }
    });
}
于 2013-07-31T16:42:54.650 に答える