我在我的项目中实现了cordova-plugin-email-composer,在此之前它运行良好,但是在升级到cordova-android@10.0.0之后,应用程序在触发this.emailcomposer.open(email)时崩溃了。
只有android 11崩溃,android 8运行良好。当我切换回cordova-android@9.0.0时,Android8和11都能正常工作。
https://github.com/katzer/cordova-plugin-email-composer/issues/350
我发现有人也有同样的问题。所以我想知道是个bug还是我们需要在config.xml上写点东西
发布于 2021-12-29 10:10:33
我找到了离子电子邮件编写器崩溃问题的解决方案。下面的URL链接是android 11中更改的文档。
https://developer.android.com/about/versions/11/behavior-changes-all#share-content-uris
需要在android下的config.xml中添加以下代码
<config-file parent="/manifest" target="AndroidManifest.xml" xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.FLAG_GRANT_READ_URI_PERMISSION" />
</config-file>
<config-file parent="/manifest/queries" target="AndroidManifest.xml" xmlns:android="http://schemas.android.com/apk/res/android">
<package android:name="com.google.android.gm" />
<package android:name="com.microsoft.office.outlook" />
<package android:name="com.yahoo.mobile.client.android.mail" />
<intent>
<action android:name="android.support.customtabs.action.CustomTabsService" />
</intent>
</config-file>https://stackoverflow.com/questions/70470649
复制相似问题