betaacid / expo-analytics

Google Analytics integration for use with React Native apps built on Expo
MIT License
286 stars 64 forks source link

Constants.installationId has been deprecated #79

Open tomelsner opened 2 years ago

tomelsner commented 2 years ago

Getting this message when calling the constructor in an expo 43 project. Is there a plan to address this and implement the generation of an installationId with one of the suggested methods here: https://forums.expo.dev/t/constants-installationid-how-to-implement-it-on-your-own/50003 ?

gregdburns commented 2 years ago

Seconding this.

There are two warnings from Expo, so perhaps both can be considered.

  1. Constants.installationId has been deprecated in favor of generating and storing your own ID. Implement it using expo-application's androidId on Android and a storage API such as expo-secure-store on iOS and localStorage on the web. This API will be removed in SDK 44.
  2. Constants.platform.ios.model has been deprecated in favor of expo-device's Device.modelName property. This API will be removed in SDK 45.

Potentially as a quick solution a property could be exposed that would allow the implementer to set a unique app id that could override the usage of Constants.installationId? In our case, that would be ideal, as we already have created a custom app Id for other use cases.

watadarkstar commented 2 years ago

I'm also getting this warning. Any plans to address this @ryanvanderpol or are you open to contributions? I might be able to take this on or find someone who is willing to.

Started to see this warning after I upgraded Expo to SDK 44 and installed this library for our open source meditation app: https://github.com/heylinda/heylinda-app/pull/140

We have an issue tracking this here in our app: https://github.com/heylinda/heylinda-app/issues/142

I will probably start with a patch-package solution.

ryanvanderpol commented 2 years ago

Contributions are always welcomed!

tomelsner commented 2 years ago

@ryanvanderpol could you merge one of the pull requests that fixes the issue with SDK 44?

minusthebear02 commented 2 years ago

@ryanvanderpol , any news on this? looks like there are some PR's opened to solve these deprecation issues

bcarradini commented 2 years ago

I found a publicly available package that was forked from this repo and that claims to be compatible with Expo SDK 44.

The repo: https://github.com/meecodebymariomurrent/expo-analytics The changes: https://github.com/ryanvanderpol/expo-analytics/compare/master...meecodebymariomurrent:master The package: https://www.npmjs.com/package/@meecode/expo-analytics

I'm going to give it a try, but still hope that @ryanvanderpol will merge in one of the PRs that addresses compatibility with SDK 44.