I “detached” the Expo client as I had to use react-native link. However, when I test the app in the Genymotion emulator and build & run the apk from the Android Studio, I get a pop up that says Please enable "Permit drawing over other apps".
Why is the pop up showing? Is this something of a requirement for the Expo client in certain Android versions in Production too? Or is it specifically occurring only in the development environment? This would be a deal breaker from a user experience point of view in a production scenario.
Once you detach, you gain full control over what permissions your app requires. You will need to remove the SYSTEM_ALERT_WINDOW permission. (I believe this is only used in the standard expo app to display progress while you load an updated version of your experience while developing)
Even though SYSTEM_ALERT_WINDOW has been removed, the app is still asking for permission to “Permit drawing over other apps”, only when running in the emulator. However, it doesn’t seem to affect the release version.
Here is the error generated in AndroidStudio (detached to ExpoKit):
--------- beginning of crash
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.modenero.***, PID: 23335
android.view.WindowManager$BadTokenException: Unable to add window android.view.ViewRootImpl$W@8557fd1 -- permission denied for window type 2003
at android.view.ViewRootImpl.setView(ViewRootImpl.java:703)
at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:342)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:93)
at android.app.Dialog.show(Dialog.java:322)
at com.facebook.react.devsupport.DevSupportManagerImpl$4.run(DevSupportManagerImpl.java:375)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)