windows phone 8 (phonegap build) pushpage

Comments

3 comments

  • Avatar
    Alexander Spotar

    If /WP8-Phonegap/www/push.html is the full path to the html that you'd like to open upon receiveing the toast-push, then yes, it is correct.

  • Avatar
    Maxborgatti

    it exits the app when opening the push, what kind of error could it be?

    push.html is the exact copy of index.html page of your sample fot windows phone 8

  • Avatar
    Alexander Spotar

    It seems that navigation doesn't work this way in Phonegap.

    Here's what you can try to do: 1) Comment the following lines as on the screenshot below (with the correct App ID, obviously) alt text

    2) Add a basic test push.html, (for example https://www.dropbox.com/s/6r780b5k53y6smd/push.html) to www > js alt text

    3) locate the following function in your index.js:

    onPushRecive: function (pushContent) {
    console.log("Push has been recived: " + pushContent);
    $("#secondPage").show();
    $("#firstPage").hide();
    $("#pushContent").html(pushContent);
    app.getUserData();
    },
    

    and replace it with

    onPushRecive: function (pushContent) {
    console.log("Push has been recived: " + pushContent);
    window.location.href = "push.html";
    navigator.notification.alert("Navigated");
    app.getUserData();
    },
    

    Thus, it should work as expected - by opening a toast notification the push.html should be opened.

Please sign in to leave a comment.