admin管理员组

文章数量:1290925

I have two apps: one in production (built with React Native) where I use the react-native-device-info library to get a uniqueId(). Now, I am refactoring the app with Flutter. There is a process in my app that depends on this uniqueId, and for iOS, the ID should be the same in both applications (it will be identifierForVendor on iOS).

How can I ensure the same ID is used in both applications?

I already tried using the same Bundle ID to compare the uniqueId I get in production with the ID I get in testing, but it’s the same result. The IDs are still different.

I have two apps: one in production (built with React Native) where I use the react-native-device-info library to get a uniqueId(). Now, I am refactoring the app with Flutter. There is a process in my app that depends on this uniqueId, and for iOS, the ID should be the same in both applications (it will be identifierForVendor on iOS).

How can I ensure the same ID is used in both applications?

I already tried using the same Bundle ID to compare the uniqueId I get in production with the ID I get in testing, but it’s the same result. The IDs are still different.

Share Improve this question edited Feb 13 at 18:54 tomerpacific 6,54018 gold badges41 silver badges60 bronze badges asked Feb 13 at 17:32 Gustavo GuddenGustavo Gudden 1 4
  • Once your updated app is in the App Store, then users who upgrade will get the same IDFV. I would not expect you to get the same IDFV when you replace an app,tore build with an Xcode build on your device since they have different signing – Paulw11 Commented Feb 13 at 19:25
  • If I upload both versions of the application testfligth, will I have 2 different IDs or the same? – Gustavo Gudden Commented Feb 13 at 19:50
  • For TestFlight builds I would expect the same value – Paulw11 Commented Feb 13 at 20:10
  • Please provide enough code so others can better understand or reproduce the problem. – Community Bot Commented Feb 14 at 0:28
Add a comment  | 

1 Answer 1

Reset to default 0

You cannot control the IDFV of the user. As it states in the documentation:

The value in this property remains the same while the app (or another app from the same vendor) is installed on the iOS device. The value changes when the user deletes all of that vendor’s apps from the device and subsequently reinstalls one or more of them. The value can also change when installing test builds using Xcode or when installing an app on a device using ad-hoc distribution. Therefore, if your app stores the value of this property anywhere, you should gracefully handle situations where the identifier changes.

If you need to rely on a unique identifier in both of your applications, I can recommend generating one that can be shared across both or have one be generated in the same fashion on both which will result in the same identifier for a specific user.

本文标签: ioshow to keep the same identifyForVendor in 2 differents appStack Overflow