React Native Expo 应用程序在 Play 管理中心错误地列出了详细信息
Posted
技术标签:
【中文标题】React Native Expo 应用程序在 Play 管理中心错误地列出了详细信息【英文标题】:ReactNative Expo app wrongly listed details in Play Console 【发布时间】:2020-10-06 00:16:32 【问题描述】:我已经上传了一个通过 Expo 内置的 React Native 应用程序。我已将权限设置为无:
"expo":
"android":
"permissions": []
... other settings
... other settings
我只将其设置为纵向模式:
"expo":
"orientation": "portrait",
... other settings
但是当我将应用程序包上传到 PLayConsole 时,它会列出具有 15 个权限的应用程序:
android.permission.ACCESS_NETWORK_STATE android.permission.ACCESS_WIFI_STATE android.permission.FOREGROUND_SERVICE android.permission.INTERNET android.permission.MODIFY_AUDIO_SETTINGS android.permission.RECEIVE_BOOT_COMPLETED android.permission.REQUEST_INSTALL_PACKAGES android.permission.STORAGE android.permission.SYSTEM_ALERT_WINDOW android.permission.USE_BIOMETRIC android.permission.WAKE_LOCK com.google.android.c2dm.permission.RECEIVE com.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE com.sja.firstaid.permission.C2D_MESSAGE host.exp.exponent.permission.C2D_MESSAGE
以及特征下的两个方向:
2 个功能:android.hardware.screen.landscape, android.hardware.screen.portrait
我无法确定忽略这些设置的原因。
【问题讨论】:
你能仔细检查你的manifest
吗?
嗨 Sebastian,Expo 似乎忽略了 app.json 中的 [ ] 权限,而是创建了一个包含所有列出的权限的清单。
【参考方案1】:
注意:权限键似乎忽略权限而不是添加权限列表Docs
独立应用在安装时将请求的附加权限列表, 以及 Expo 应用运行所需的最低要求。
To use ALL permissions supported by Expo, do not specify the "permissions" key.
To use ONLY the following minimum necessary permissions and none of the extras supported
by Expo, set "permissions" to []. The minimum necessary permissions do not require a
Privacy Policy when uploading to Google Play Store and are:
• receive data from Internet
• view network connections
• full network access
• change your audio settings
• draw over other apps
• prevent device from sleeping
To use the minimum necessary permissions ALONG with certain additional permissions,
specify those extras in "permissions", e.g.
["CAMERA", "RECORD_AUDIO"]
ExpoKit: to change the permissions your app requests, you'll need to edit
AndroidManifest.xml manually. To prevent your app from requesting one of the
permissions listed below, you'll need to explicitly add it to `AndroidManifest.xml`
along with a `tools:node="remove"` tag.
"permissions": [
"ACCESS_COARSE_LOCATION",
"ACCESS_FINE_LOCATION",
"CAMERA",
"MANAGE_DOCUMENTS",
"READ_CONTACTS",
"READ_CALENDAR",
"WRITE_CALENDAR",
"READ_EXTERNAL_STORAGE",
"READ_PHONE_STATE",
"RECORD_AUDIO",
"USE_FINGERPRINT",
"VIBRATE",
"WAKE_LOCK",
"WRITE_EXTERNAL_STORAGE",
"com.anddoes.launcher.permission.UPDATE_COUNT",
"com.android.launcher.permission.INSTALL_SHORTCUT",
"com.google.android.c2dm.permission.RECEIVE",
"com.google.android.gms.permission.ACTIVITY_RECOGNITION",
"com.google.android.providers.gsf.permission.READ_GSERVICES",
"com.htc.launcher.permission.READ_SETTINGS",
"com.htc.launcher.permission.UPDATE_SHORTCUT",
"com.majeur.launcher.permission.UPDATE_BADGE",
"com.sec.android.provider.badge.permission.READ",
"com.sec.android.provider.badge.permission.WRITE",
"com.sonyericsson.home.permission.BROADCAST_BADGE"
],
【讨论】:
感谢 Muhammad,稍后我将尝试手动编辑 AndroidManifest.xml。但是我已经指定了“权限”:[] 但是我获得的权限超过了最低权限,并且由于这些额外的权限,Google 正在请求隐私政策。 当然,我只需要弄清楚如何在不弹出的情况下编辑从 Expo 流程发布的应用程序包的清单,然后将尝试您的建议。 @Rich github.com/expo/expo/issues/941#issuecomment-405214705 @Rich 获取隐私政策github.com/expo/expo/issues/3774#issuecomment-526516909 嗨,我遇到了类似的问题,但在我的情况下,我退出了 Expo 工作流程。但是,Expo 指定的依赖项和权限仍然存在。我可以在游戏控制台上看到 android.permission.USE_FINGERPRINT、android.permission.WAKE_LOCK、android.permission.WRITE_EXTERNAL_STORAGE 等权限,即使应用程序不需要它们。我还从 AndroidManifest.xml 中删除了除 Internet 之外的所有权限以上是关于React Native Expo 应用程序在 Play 管理中心错误地列出了详细信息的主要内容,如果未能解决你的问题,请参考以下文章
在 expo 中运行使用 react-native-cli 创建的 react-native 应用程序
React Native - 如何构建 expo react native 应用程序,使其不需要 Expo android 应用程序打开