OGeek|极客世界-中国程序员成长平台

标题: android - Cordova 应用程序使用自定义参数启动 native 应用程序 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-11 18:22
标题: android - Cordova 应用程序使用自定义参数启动 native 应用程序

我有一个带有源代码的 AndroidiOS 应用。这 2 个应用程序是由另一个供应商创建的。我需要使用我的 cordova 应用程序将一些自定义参数传递给 thesw 2 应用程序并启动它。

对于 cordova 应用,我们如何启动带参数的原生应用?



Best Answer-推荐答案


使用 Intent 启动 Android 应用程序,同时使用自定义 URL 方案启动 iOS 应用程序。两者都可以带参数。

1 由于你有两个应用的源代码,你需要分别编辑androidManifest.xml和info.plist,让原生应用识别你的 Intent 。

2 更改每个平台的源代码,使它们对参数做一些特殊的事情。

引用链接 安卓 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

关于android - Cordova 应用程序使用自定义参数启动 native 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41255932/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4