From what I've read, React Native requires the permission android.permission.SYSTEM_ALERT_WINDOW
to enable its developer interface in debug mode. However, when publishing a release, this permission is still included, which causes users to freak out (since it says "permission to draw over other apps").
I can manually remove the permission in AndroidManifest.xml, but that will break the app when I'm in development mode -- and that's not something I want to do every time I release a new version.
Is there a way to disable the permission for only release versions of the app?
One of them is the READ_PHONE_STATE, a permission that reads data that most users will not want to give and they might not install the app because of that. The simple way to remove this type of permission, is by deleting its xml code line from the original Android Manifest file in android/app/src/main .
android. permission. READ_PHONE_STATE - You must ask the end user to grant this permission.) Allows read only access to the phone's state, and is used to determine the status of any ongoing calls. You need this permission so you can verify that your end user receives a phone call from Telesign.
There is a solution for Android Studio, I hope react-native have the same functions:
You can have two separate AndroidManifest.xml
for release and debug versions.
Debug manifest should be located in ${projectPath}\src\debug\AndroidManifest.xml
Release manifest in ${projectPath}\src\main\AndroidManifest.xml
You can put android.permission.SYSTEM_ALERT_WINDOW
only in debug manifest and don't add this into release.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With