facebook

window.open vs phoneui.gotoURL

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

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

    cng_1
    Member

    Is there a coding standard for mobione about when to use javascript directly or use something in the mobione library ?

    window.open vs phoneui.gotoURL is one in question. It looks like phoneui.gotoURL is doing some house keeping steps vs if you call window.open directly. Would calling window.open directly cause problems ?
    Is there a difference calling these functions in phonegap vs the mobione app?

    Is there a reference document for mobione created functions and what they replace or when they should be used?

    thank you.

    #328382

    cng_1
    Member

    Waiting on reply from support please.

    #328445

    support-michael
    Keymaster

    >Would calling window.open directly cause problems ?

    Yes, as I recall that it is not supported consistently across devices. I don’t recall the details but there were some crazy quirks. For example iOS ipad2 gave us fits – the entire browser would crash in some situations. We originally used window.open but introduced the phoneui api to provide a higher layer for additional compatibility over time.

    >Is there a difference calling these functions in phonegap vs the mobione app?

    I will check with the dev team on if there are key differences. I do know that the phoneui api takes into account the environment of your app, e.g., native, webapp, running the test center…

    >Is there a reference document for mobione created functions and what they replace or when they should be used?

    No doc that describes the deep technical background behind some of the apis. Most of them were derived from school of hard-knocks as we have worked across different platforms and devices. It will continue to evolve as the platforms evolve.

    We are planning to move much of this api to more formal programmer centric resources. Its a function of man-power atm and that we planning to introduce a full ui widget api.

    #328778

    cng_1
    Member

    >Is there a difference calling these functions in phonegap vs the mobione app?

    >>I will check with the dev team on if there are key differences. I do know that the phoneui api takes into >>account the environment of your app, e.g., native, webapp, running the test center…

    Did the dev team say anything about this ? Should we NOT use window.open for now????

    Thank you.

    #328814

    Hi cng_1,

    The dev team recommended using phoneui.showURL(“URL”, “_blank”) to open an external window and phoneui.showURL(“URL”, “_self”) to open a URL in the app window.

    The reason is because:
    1) window.open works differently across different platforms and between web apps and native apps. showURL works around these differences to provide a consistent set of behavior.
    2) showURL works around some bugs that exist with opening sms:// and tel:// URLs on certain platforms.

    #328820

    cng_1
    Member

    Thank you.

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: window.open vs phoneui.gotoURL

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