xu-li / cordova-plugin-wechat

A cordova plugin, a JS version of Wechat SDK
1.22k stars 508 forks source link

安卓10 分享微信,提示"未安装微信" #605

Open k3179 opened 2 years ago

k3179 commented 2 years ago

这个支持安卓10吗? api版本是30

cxcxcxcx commented 2 years ago
diff --git a/plugin.xml b/plugin.xml
index f81f68c..19a5678 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -97,9 +97,12 @@
             <uses-permission android:name="android.permission.INTERNET"/>
             <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
             <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
-            <uses-permission android:name="android.permission.READ_PHONE_STATE" />
+            <!--<uses-permission android:name="android.permission.READ_PHONE_STATE" />-->
             <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
-        </config-file>
+            <queries>
+              <package android:name="com.tencent.mm" />
+            </queries>
+          </config-file>

         <config-file target="AndroidManifest.xml" parent="/manifest/application">
             <activity
mimaster commented 2 years ago

我同样遇到了这个问题,请问你的问题解决了么,我按照楼上的试了下,但是没有效果😓

ChinaGc commented 2 years ago

按照楼上的改动 问题得到了解决 感谢!!

diff --git a/plugin.xml b/plugin.xml
index f81f68c..19a5678 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -97,9 +97,12 @@
             <uses-permission android:name="android.permission.INTERNET"/>
             <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
             <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
-            <uses-permission android:name="android.permission.READ_PHONE_STATE" />
+            <!--<uses-permission android:name="android.permission.READ_PHONE_STATE" />-->
             <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
-        </config-file>
+            <queries>
+              <package android:name="com.tencent.mm" />
+            </queries>
+          </config-file>

         <config-file target="AndroidManifest.xml" parent="/manifest/application">
             <activity