Telerik 移动应用程序 运行 是在 AppBuilder 中还是作为打包应用程序?

Is Telerik mobile app running in AppBuilder or as packaged app?

我正在使用 Telerik 平台开发我的第一个移动应用程序,我正在尝试找到一种方法来根据代码所在的环境动态设置配置 运行。例如:

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";  
  }
}

我想要做的是判断该应用程序是 运行 在我用于系统测试的 Telerik 的 AppBuilder 移动应用程序中,还是作为打包应用程序(生产应用程序)

我已经通过 Telerik 的 javascript API 进行了拖网搜索,但看不到任何似乎符合要求的东西,而且我不希望在 Cordova API 因为这是特定于 Telerik 平台的。

有什么想法吗?

您可以在 AppBuilder (see the docs) 中使用特定于调试和发布的文件来完成此操作。这允许您将调试文件作为调试(即测试)构建的目标,并将发布文件作为发布(即应用商店)构建的目标。