Skip to content

Commit de0a348

Browse files
committed
Remove migration from v1 guide
1 parent 2563bc4 commit de0a348

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

README.md

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -919,26 +919,3 @@ requestLocationAccuracy({purposeKey: 'YOUR-PURPOSE-KEY'})
919919
.then((accuracy) => console.log(`Location accuracy is: ${accuracy}`))
920920
.catch(() => console.warn('Cannot request location accuracy'));
921921
```
922-
923-
## Migrating from v1.x.x
924-
925-
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**.
926-
927-
```js
928-
// v1.x.x
929-
import Permissions from 'react-native-permissions';
930-
931-
Permissions.request('location', {type: 'whenInUse'});
932-
933-
// v2.x.x
934-
import {Platform} from 'react-native';
935-
import {PERMISSIONS, request} from 'react-native-permissions';
936-
937-
request(
938-
Platform.select({
939-
android: PERMISSIONS.ANDROID.ACCESS_FINE_LOCATION,
940-
ios: PERMISSIONS.IOS.LOCATION_WHEN_IN_USE,
941-
windows: PERMISSIONS.WINDOWS.LOCATION,
942-
}),
943-
);
944-
```

0 commit comments

Comments
 (0)