facebook

Need Help

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #339337 Reply

    RobertSoto
    Member

    I need help

    I trying to use this code but it will not work for me.. The code work on test center but not in any phone or table
    I also went to this link
    https://docs.google.com/document/d/1gKK9Aliz9LXOoTfWiVSJ4Tp3kVa1zk_JZ7nJxfBM3wY/edit?pli=1

    PLEASE PLEASE HELP!!!!
    /**
    * Called when document is loaded.
    */
    phoneui.documentReadyHandler = function() {
    phoneui.showURL(‘http://google.com’,’_self’);
    }

    #339342 Reply

    Hi Veilex,

    In order to be sure that your redirect instruction is called when you just opened the app, you must wait for the Cordova Runtime Environment to be loaded and initialized by the app since the phoneui.showURL function uses ‘device’ variable that is being set by cordova on init, and docready happens before this. Please use next code to replace the phoneui.documentReadyHandler function:

    phoneui.documentReadyHandler = function() {
    
       document.addEventListener("deviceready", function() { 
          phoneui.showURL("http://google.com", "_self"); },
          false);
    }
Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Need Help

You must be logged in to post in the forum log in