【问题标题】:How to navigate from Salesforce1 app to Other Native Apps in iOS 13 Using Javascript or JQuery?如何使用 Javascript 或 JQuery 从 Salesforce1 应用程序导航到 iOS 13 中的其他本机应用程序?
【发布时间】:2019-08-28 10:50:45
【问题描述】:

我们目前正在开发一个在 Salesforce1 应用程序中运行的 Visualforce 页面。我需要从此页面导航到一个 iOS 本机应用程序。 早些时候我使用 - window.top.location = '<appurl>'; 此命令在 iOS 12 及其早期版本中按预期工作。当我在一台装有 iOS 13.0 版本的 iOS 设备上运行同一页面时,它不会将我导航到 iOS 本机应用程序。

我已经实施了以下解决方案,以解决此导航问题 -

1. window.location = '<appurl>';
2. document.location = '<appurl>';
3. window.location.href = '<appurl>';
4. location.replace("<appurl>");
5. window.top.location = '<appurl>';
6. location.href = '<appurl>';
7. window.location.assign("<appurl>");

下面是我的代码 sn-p -

var versionNumberiOS = parseFloat(getiOSversion());

if(versionNumberiOS != null && versionNumberiOS < 13.0) {
   window.top.location = '<url>'; //this works for ios  < 13
} else {
   window.location = '<url>'; //Here I need to implement solution
}

function getiOSversion() {

   if (/iP(hone|od|ad)/.test(navigator.platform)) {

     var v = (navigator.appVersion).match(/OS (\d+)_(\d+)_?(\d+)?/);
     return [parseInt(v[1], 10), parseInt(v[2], 10), parseInt(v[3] || 0, 10)];
   }
}

请帮我解决 iOS 13.0 版本的导航问题,使用 javascript/jquery。

【问题讨论】:

    标签: javascript jquery ios


    【解决方案1】:

    你可以试试setTimeout

    setTimeout(function(){
        document.location.href = "other_page.html";
    },500);
    

    【讨论】:

      猜你喜欢
      • 2016-04-23
      • 2016-03-30
      • 2021-10-01
      • 1970-01-01
      • 1970-01-01
      • 2019-03-25
      • 2023-01-13
      • 1970-01-01
      • 2017-06-07
      相关资源
      最近更新 更多