Constants.deviceId and Constants.installationId undefined?

Please provide the following:

  1. SDK Version: 36
  2. Platforms(Android/iOS/web/all):IOS

Replace this section with as much relevant information as possible and any relevant code along with your question.

I am trying to get unique UUID for device , but I am getting all time undefined, i tried to run app on simulator and device both.
here is How I am getting.

  if(Constants.isDevice){
      if(Constants.deviceId){
        console.log('deviceID:', Constants.deviceId );
        this.updateContext('deviceID', Constants.deviceId);

      }else{
        console.log('InstallationId:', Constants.deviceId );
        this.updateContext('deviceID', Constants.installationId);
      }
    }else{
      this.updateContext('deviceID', 'FCDBD8EF-62FC-4ECB-B2F5-92C9E79AC7F9');
    }

Hi! this was a known issue, you can workaround it by upgrading to SKD 37, or wait for the next version of the iOS client to be released with the fix :slight_smile: https://github.com/expo/expo/issues/7585

This Constant problem affects also Android : Expo bare: trying to find null `Constants.manifest.name` error
Modules that use expo-constant also crash (firebase for instance)

where does firebase use expo-constants?

https://github.com/expo/expo/blob/master/packages/expo-firebase-core/src/FirebaseOptions.ts.

ah that’s only on web, which does not use expo-updates and works differently. it also ill not cause any crash for you because if any of the properties looked up on manifest aren’t defined it will just return undefined

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.