I'm developing my first mobile app using the Telerik platform and I'm trying to find a way of dynamically setting the configuration based on the environment that the code is running in. e.g.:var apiUrl;
function setConfig()
{
if (window.navigator.simulator)
{
// Debug in simulator
apiUrl = "http://localhost:1234/api/myapp";
}
else if ( ??? )
{
// System Testing
apiUrl = "https://beta.myapp.com/api/myapp";
}
else {
// Production
apiUrl = "https://myapp.com/api/myapp";
}
}
What I'd like to be able to do is tell if the application is running within the AppBuilder mobile app, which I'm using for system testing, or as a packaged application (production app)
I've had a trawl through the javascript API, but can't see anything that seems to fit the bill, and I don't expect to find anything in the Cordova API since this is specific to the telerik platform.
Any ideas?