You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Ionic应用中通过Web-Intent用包名打开其他应用并收发数据

Ionic Web-Intent 数据收发问题
  • 正在使用Ionic Web-Intent
  • 使用接收方应用的包名

已安装插件

  • ionic cordova plugin add com-darryncampbell-cordova-plugin-intent
  • npm install --save @ionic-native/web-intent

已成功打开其他应用,但无法实现数据的发送与接收

AndroidManifest.xml 配置

<intent-filter>
                <action android:name="com.darryncampbell.cordova.plugin.intent.ACTION" />
                <category android:name="android.intent.category.DEFAULT" />
                <action android:name="android.intent.action.MAIN" />
                <action android:name="http://webintents.org/share" />
                <action android:name="com.example.ACTION_SEND_DATA" />
                <action android:name="android.intent.action.SEND" />
                <category android:name="android.intent.category.LAUNCHER" />
                <data android:mimeType="text/plain" />
</intent-filter>

.ts 文件代码

const options : IntentOptions = {
        package : 'io.mlite.hwc_assam_uat',
        action: 'io.mlite.hwc_assam_uat.SEND_DATA',
        type: 'text/plain',
        extras: {
            'extra_key': 'extra_value'
        }
};
this.webIntent.startActivity(options).then(intent => {
    console.log(intent);
})

内容的提问来源于stack exchange,提问作者Deepak Mandal

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.22 09:53:25