4***@qq.com
4***@qq.com
  • 发布:2022-06-22 18:24
  • 更新:2022-06-22 18:24
  • 阅读:253

离线打包app,引入微信登录sdk,WX_SECRET,WX_APPID不能动态传入

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: 3.1.18

HBuilderX类型: 正式

HBuilderX版本号: 3.1.18

手机系统: Android

手机系统版本号: Android 12

手机厂商: 小米

手机机型: note9

页面类型: vue

vue版本: vue2

打包方式: 离线

项目创建方式: HBuilderX

示例代码:

Androidmainfest.xml文件需要修改的项

需要在application节点前添加权限
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
<application>节点下配置如下代码
<meta-data android:value="%用户申请的微信Appcert%" android:name="WX_SECRET"/>
<meta-data android:value="%用户申请的微信Appid%" android:name="WX_APPID"/>
<activity android:name="%用户包名%.wxapi.WXEntryActivity"
android:label="@string/app_name"
android:exported="true"
android:launchMode="singleTop">
<intent-filter><action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:scheme="%用户申请的微信Appid%"/>
</intent-filter>
</activity>

操作步骤:

需要填写配置文件,有时候要打包N个项目,或更换WX_SECRET,WX_APPID,比较麻烦

预期结果:

可以js中传入.或者代码中数据库读取WX_SECRET,WX_APPID

实际结果:

实际上要配置WX_SECRET,WX_APPID

bug描述:

离线打包app,引入微信登录sdk,WX_SECRET,WX_APPID不能动态传入

2022-06-22 18:24 负责人:无 分享
已邀请:

要回复问题请先登录注册