-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🌊 Add Expo managed workflow support for SDK 39+
This is done by using the ExpoRandom native module if it exists.
- Loading branch information
1 parent
75829b2
commit 8e25a1a
Showing
4 changed files
with
27 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { NativeModules } from 'react-native'; | ||
|
||
// In the Expo managed workflow the getRandomBase64 method is provided by ExpoRandom.getRandomBase64String | ||
if (!NativeModules.ExpoRandom) { | ||
throw new Error('Expo managed workflow support for react-native-get-random-values is only available in SDK 39 and higher.'); | ||
} | ||
|
||
export default NativeModules.ExpoRandom.getRandomBase64String; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { NativeModules } from 'react-native'; | ||
|
||
export default NativeModules.RNGetRandomValues.getRandomBase64; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters