Skip to content

Commit 5ce95cc

Browse files
authored
Merge pull request #36 from tsapeta/master
🎉 Add support for Expo SDK 45+
2 parents 455f9db + 2c9bb62 commit 5ce95cc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ function getRandomBase64 (byteLength) {
2727
if (NativeModules.RNGetRandomValues) {
2828
return NativeModules.RNGetRandomValues.getRandomBase64(byteLength)
2929
} else if (NativeModules.ExpoRandom) {
30+
// Expo SDK 41-44
3031
return NativeModules.ExpoRandom.getRandomBase64String(byteLength)
32+
} else if (global.ExpoModules) {
33+
// Expo SDK 45+
34+
return global.ExpoModules.ExpoRandom.getRandomBase64String(byteLength);
3135
} else {
3236
throw new Error('Native module not found')
3337
}

0 commit comments

Comments
 (0)