微信开放标签打开Android App白屏

问题背景:

APP分享web页面到微信好友后,用户可以通过分享的web页面打开APP,并根据extinfo参数打开对应的APP原生页面;
为了实现以上需求,
选用使用wx-open-launch-app开放标签打开APP的技术方案

Flutter项目的pubspec.yaml中引用了 fluwx_no_pay: ^3.13.1插件,

解决方案:
AndroidManifest.xml中没有配置缺少配置相关参数,

在AndroidManifest.xml中给你的Activity加上一个标签:

   <intent-filter>
       <action android:name="${applicationId}.FlutterActivity" />
       <category android:name="android.intent.category.DEFAULT" />
   </intent-filter>
<intent-filter>
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <data
        android:host="${applicationId}"
        android:path="/"
        android:scheme="wechatextmsg" />
</intent-filter>

与此同时,你还需要在需要在application中加上,把你的appId放进去:

 <meta-data
            android:name="weChatAppId"
            android:value="12345678" />   

AndroidManifest.xml文件内容如下:

 <application>

        <activity android:name=".MainActivity"
            android:exported="true">
            <!--            fluwx插件:  wx-open-launch-app 标签-->
            <intent-filter>
                <action android:name="${applicationId}.FlutterActivity" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
            <!--微信SDK Deep Link -->
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data
                    android:host="${applicationId}"
                    android:path="/"
                    android:scheme="wechatextmsg" />
            </intent-filter>
        </activity>

        <!--            微信appId配置-->
        <meta-data
            android:name="weChatAppId"
            android:value="12345678" />

        <!--            微信请求处理是否交给fluwx-->
        <meta-data
            android:name="handleWeChatRequestByFluwx"
            android:value="true" />
	
    </application>

参考文献:
fluwx文档

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值