How to receive base_url from the AppWorks Client

Hi,

When you use the appworks app, you already add a username, password and authentication url.
How can I retrieve and re-use this url?
This would prevent me from having to put it hardcoded in my code.

Comments

  • You are right: you should certainly not hard-code this url except for early testing.

    In the next version of the mobile client, we will make this easier by putting it in the otag javascript object.

    In the meantime, you retrieve the base url via a cordova plugin. The plugin is called "Session", and the function to use is "getSessionInfo". So, roughly:

    cordova.exec(successFn, errorFn, "Session","getSessionInfo", []);
    
  • Thanks John.