简体   繁体   English

Cordova应用程序使用自定义参数启动本机应用程序

[英]cordova app launch native app with custom parameter

I've an Android and iOS app with source code. 我有一个带有源代码的AndroidiOS应用。 These 2 apps are created by another vendor. 这2个应用是由其他供应商创建的。 I need to use my cordova app to pass in some custom parameters to thesw 2 apps and launch it. 我需要使用我的cordova应用程序将一些自定义参数传递给thesw 2应用程序并启动它。

for cordova app, how do we launch native app with parameter ? 对于cordova应用程序,我们如何使用参数启动本机应用程序?

Use intent to launch the Android app while use Custom URL Scheme to start the iOS one. 使用意图启动Android应用程序,同时使用自定义URL方案启动iOS应用程序。 Both of them can take parameter. 它们都可以带参数。

1 As you have the source code the two apps, you need to edit the androidManifest.xml and info.plist respectively, allowing the native apps to recognize your intention. 1由于您拥有两个应用程序的源代码,因此需要分别编辑androidManifest.xml和info.plist,以允许本机应用程序识别您的意图。

2 change the source code for each platform, making them do something special with the parameters. 2更改每个平台的源代码,使它们对参数做一些特殊的事情。

reference link Android https://developer.android.com/guide/components/intents-filters.html 参考链接Android https://developer.android.com/guide/components/intents-filters.html

iOS https://developer.apple.com/library/content/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/Inter-AppCommunication/Inter-AppCommunication.html iOS https://developer.apple.com/library/content/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/Inter-AppCommunication/Inter-AppCommunication.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM