Closed danhab99 closed 2 years ago
I can't access the getUserId function.
getUserId
import RNUserIdentity, { ICLOUD_ACCESS_ERROR } from 'react-native-user-identity' const checkAccount = async () => { try { const result = await RNUserIdentity.getUserId() // const result = await RNUserIdentity.default.getUserId() // const result = await RNUserIdentity.getUserIdentity() if (result === null) { onPressed?.(false) if (alert) { Alert.alert( "iCloud Error", "You have to enable iCloud to add your ID to your Apple Wallet" ) } } else { onPressed?.(true) } } catch (error) { console.error(error) if (error === ICLOUD_ACCESS_ERROR) { if (alert) { Alert.alert( "iCloudError", "Unable to access iCloud" ) } return onPressed?.(false, error) } throw error } }
Figured it out. Use this import line:
import * as RNUserIdentity from 'react-native-user-identity'
And this call to get the user's iCloud ID
const result = await RNUserIdentity.default.getUserId()
I can't access the
getUserId
function.