Skip to content

Commit

Permalink
fix: added ACCESS_NETWORK_STATE to manifest
Browse files Browse the repository at this point in the history
- Added ACCESS_NETWORK_STATE to AndroidManifest.xml of this package
- Updated readme instructions for android setup
  • Loading branch information
faizplus committed May 13, 2024
1 parent c5457ef commit e2d541d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 31 deletions.
30 changes: 0 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -495,36 +495,6 @@ is `com.myapp://oauth`, then the url scheme will is `com.myapp`. The scheme must
NOTE: When integrating with [React Navigation deep linking](https://reactnavigation.org/docs/deep-linking/#set-up-with-bare-react-native-projects), be sure to make this scheme (and the scheme in the config's redirectUrl) unique from the scheme defined in the deep linking intent-filter. E.g. if the scheme in your intent-filter is set to `com.myapp`, then update the above scheme/redirectUrl to be `com.myapp.auth` [as seen here](https://github.com/FormidableLabs/react-native-app-auth/issues/494#issuecomment-797394994).
#### Allow permission to access the network state
You need to add the `ACCESS_NETWORK_STATE` permission to your `AndroidManifest.xml` file. Here's how you can do it:
1. Open your `AndroidManifest.xml` file located in the `android/app/src/main` directory of your React Native project.
2. Add the following line inside the `<manifest>` element, just before the `<application>` element:
```xml
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
```
Your manifest should look something like this:
```xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.yourpackagename">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<application
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:allowBackup="false"
android:theme="@style/AppTheme">
...
</application>
</manifest>
```
## Usage
```javascript
Expand Down
2 changes: 1 addition & 1 deletion android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.rnappauth">

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
</manifest>

0 comments on commit e2d541d

Please sign in to comment.