菜鸟教程小白 发表于 2022-12-11 18:22:41

android - Cordova 应用程序使用自定义参数启动 native 应用程序


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

<p>对于 <strong>cordova</strong> 应用,我们如何启动带参数的原生应用? </p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>使用 Intent 启动 Android 应用程序,同时使用自定义 URL 方案启动 iOS 应用程序。两者都可以带参数。</p>

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

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

<p>引用链接
安卓
<a href="https://developer.android.com/guide/components/intents-filters.html" rel="noreferrer noopener nofollow">https://developer.android.com/guide/components/intents-filters.html</a> </p>

<p>iOS
<a href="https://developer.apple.com/library/content/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/Inter-AppCommunication/Inter-AppCommunication.html" rel="noreferrer noopener nofollow">https://developer.apple.com/library/content/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/Inter-AppCommunication/Inter-AppCommunication.html</a> </p></p>
                                   
                                                <p style="font-size: 20px;">关于android -Cordova 应用程序使用自定义参数启动 native 应用程序,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/41255932/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/41255932/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: android - Cordova 应用程序使用自定义参数启动 native 应用程序