有没有办法在不弹出的情况下删除 react-native 中的默认权限?

Is there a way to remove default permissions in react-native without ejecting?

我想删除 react-native 应用程序中的默认 android 权限:

我找到的唯一方法是修改 AndroidManifest.xml :

https://facebook.github.io/react-native/docs/removing-default-permissions.

我的问题是:有没有办法在不弹出我的应用程序的情况下做到这一点?因为我不想失去 Expo 提供的功能。

看看docs

他们说:

Note: If you don't specify android.permissions inside your app.json, by default your standalone Android app will require all of the permissions listed above.

另请参阅:

In order to request permissions in a standalone Android app, you need to specify the corresponding native permission types in the android.permissions key inside app.json read more about configuration. The mapping between Permissions values and native permission types is as follows

您可以在 app.json 中仅添加您想要的权限:

{
    ...
    "permissions": [ ... ]
}