Skip to content

Commit

Permalink
Remove migration from v1 guide
Browse files Browse the repository at this point in the history
  • Loading branch information
zoontek committed Nov 28, 2020
1 parent 2563bc4 commit de0a348
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -919,26 +919,3 @@ requestLocationAccuracy({purposeKey: 'YOUR-PURPOSE-KEY'})
.then((accuracy) => console.log(`Location accuracy is: ${accuracy}`))
.catch(() => console.warn('Cannot request location accuracy'));
```

## Migrating from v1.x.x

If you are currently using the version `1.x.x` and would like to switch to `v2.x.x`, the only thing you really need to know is that it's now required to select the wanted permission **per platform**.

```js
// v1.x.x
import Permissions from 'react-native-permissions';

Permissions.request('location', {type: 'whenInUse'});

// v2.x.x
import {Platform} from 'react-native';
import {PERMISSIONS, request} from 'react-native-permissions';

request(
Platform.select({
android: PERMISSIONS.ANDROID.ACCESS_FINE_LOCATION,
ios: PERMISSIONS.IOS.LOCATION_WHEN_IN_USE,
windows: PERMISSIONS.WINDOWS.LOCATION,
}),
);
```

0 comments on commit de0a348

Please sign in to comment.