Skip to content

Instantly share code, notes, and snippets.

@mkonicek
Created December 16, 2015 15:37
Show Gist options
  • Save mkonicek/4ba3621c109b36fba9a6 to your computer and use it in GitHub Desktop.
Save mkonicek/4ba3621c109b36fba9a6 to your computer and use it in GitHub Desktop.
The RedBox implementation uses TYPE_SYSTEM_ALERT windows, which require
the SYSTEM_ALERT_WINDOW permission. This permission is seen as 'above dangerous'
in android M and cannot be requested through the runtime permission system (more
details here:
https://code.google.com/p/android-developer-preview/issues/detail?id=2971).
In Android M, this permission is now ignored even when listed in the manifest.
Instead, we can fire an intent to the settings menu where the user can enable
this setting for react-native apps. An alternative approach is to find a better
window type than TYPE_SYSTEM_ALERT which doesn't need that permission, and only
enable this setting if the redbox cannot be displayed for some reason.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment