How to add Permissions in React Native


Sometimes you need to add custom permissions to your React Native Android app to use certain features like React Native’s Vibration.vibrate.

Adding Permissions to AndroidManifest.xml

Permissions in Android are stored in an AndroidManifest.xml file which is located at app\src\main\AndroidManifest.xml relative to your React Native project folder. In there you can simply add the permission by inserting the lines:

<manifest xmlns:android=""

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
    <uses-permission android:name="android.permission.VIBRATE" />

        android:targetSdkVersion="22" />

You then have to recompile the app for the permissions to take effect by running react-native run-android. It might also be necessary to add the second line xmlns:tools="", which defines some additional namespaces if you get an error during compilation.

Hi, I'm Christoph Michel 👋

I'm a , , and .

Currently, I mostly work in software security and do on an independent contractor basis.

I strive for efficiency and therefore track many aspects of my life.