Expo.Constants.deviceId is undefined

Hello everyone,

Our team recently ejected from expo to the new bare workflow (SDK 34) since we need to add in-app-purchases.

We’ve tried import Constants from 'expo-constants'; and import { Constants } from 'react-native-unimodules'; but we are still having undefined deviceId.

.2019_09_19_15_50_37_React_Native_Debugger

Documentation didn’t says that we can’t use Constants after ejecting app. So my question is can we get DeviceId with bare app ?
Are we missing something ?

package.json

Hey @numidev_sebastien,

Without your code I can’t be sure but from first glance at the error, it looks like you may be calling the Constants module with the Expo package namespace which is no longer valid. You’ll want to rather use Constants.deviceId.

Cheers,
Adam

Hi,

As i said :

We’ve tried import Constants from 'expo-constants'; and import { Constants } from 'react-native-unimodules'; but we are still having undefined deviceId.

js_app_Atom

And I don’t understand why it’s work in managed workflow because in documentation https://docs.expo.io/versions/v34.0.0/sdk/constants/https://docs.expo.io/versions/v34.0.0/sdk/constants

There is no deviceId but installationId.

Thank you for your concern, i think we are gonna use react-native-device-info.