深度链接-通过另一个Ionic应用程序打开Ionic应用程序 [英] Deeplinking - Opening an Ionic App through another Ionic App

查看:90
本文介绍了深度链接-通过另一个Ionic应用程序打开Ionic应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试开发两个Apple的Ionic应用程序,它们至少可以在一个方向上进行通信.如何使一个应用程序直接打开另一个应用程序?我有很多关于深度链接的知识,但是我不确定这是否是正确的方法,因为我只想通过调用另一个应用程序中的函数来打开一个应用程序(并可能传递数据).

I'm trying to develope two Ionic applications which are apple to communicate at least in one direction. How do I enable one application to directly open the other one? I have red many things about Deep-Linking but I'm not sure if this is the right way as I only want to open one app (and maybe passing data) through the calling of a function within the other app.

有人在这种情况下有经验吗?每个答案我都很高兴!

Does anyone have experience with this scenario? I'm happy for every answer!

推荐答案

您可以使用自定义-URL方案插件

像这样安装它:

cordova plugin add cordova-plugin-customurlscheme --variable URL_SCHEME=mycoolapp

然后在另一个应用程序中安装cordova-plugin-inappbrowser来打开第一个应用程序,如下所示:

Then in the other app install cordova-plugin-inappbrowser to open the first app like this:

window.open('mycoolapp://', '_system');

然后在此应用中安装具有不同变量的Custom-URL-scheme插件,并使用具有不同变量值的上述代码打开其他应用.

Then install the Custom-URL-scheme plugin in this app with a different variable and use above code with the different variable value to open the other app.

您可以像这样获取网址(以防您也传递一些参数):

You can get the url (in case you also pass some params) like this:

function handleOpenURL(url) {
  console.log("received url: " + url);
}

这篇关于深度链接-通过另一个Ionic应用程序打开Ionic应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆