expo-random - unimodules TypeError on IOS

I have not been able to get expo-random to work on native CLI app created via npx react-native init. I have modified the files for IOS as documented and have expo-crypto working. The same code works in an expo native app. Does expo-random currently work with unimodules? Thanks

Code (blank test app and cribbed from expo-crypto example):
useEffect(() => {
async function runRandom() {
const randomBytes = await Random.getRandomBytesAsync(16);
console.log('Bytes: ', randomBytes);
/* Some crypto operation… */

backend.js:32 Possible Unhandled Promise Rejection (id: 0):
TypeError: Cannot read property ‘getRandomBytesAsync’ of undefined

I’m experiencing the same issue. Did you ever find a solution?

hi there. you need to install react-native-unimodules for this to work. also, ensure that you are using expo-random@9.0.0.

I’m using Expo 39 ejected bare workflow, also encounter the same issue.
The version of expo-random is expo-random@9.0.0
I noticed for iOS because there is no unimodule.json in node_modules/expo-random folder like other unimodule packages, thus the expo-random module would not be identified as unimodule package and the expo-random module is not included in the generated cocoapods list.
Tried patching the package as following and it resolves the issue:
Adding an unimodule.json file with following content:
“name”: “expo-random”,
“platforms”: [“ios”]
Notice “android” must not in the platforms list, otherwise it will break Android build.
Since I know little about unimodule development I’m not sure may be this is not the best solution. Seems on different platform the expo-random package are built differently: for iOS it should be treated as an unimodule package but on android it can not be treated as a unimodule package. This might be why the unimodule.json is missing and the module not working as expected on iOS bare workflow.

install expo-random@9.0.1 into your project to resolve. this package doesn’t use unimodule autolinking anymore and instead uses react-native’s autolinking, for some reasons i can elaborate on if you’re curious