Bug 15410 - Problem with MonoTouch.UIKit.UIDevice.CurrentDevice.IdentifierForVendor with XCode 5
Summary: Problem with MonoTouch.UIKit.UIDevice.CurrentDevice.IdentifierForVendor with ...
Status: RESOLVED NOT_ON_ROADMAP
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: 7.0.3.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-10-15 14:02 UTC by Alain
Modified: 2013-10-15 14:46 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED NOT_ON_ROADMAP

Description Alain 2013-10-15 14:02:29 UTC
Hi,

I have a problem with this function :

MonoTouch.UIKit.UIDevice.CurrentDevice.IdentifierForVendor.

When I run my app on the simulator 7, I have an ID. I quit the application and I run, I have another ID.

I think that I don't have this problem with the simulator 6.1.

Since I installed XCode 5, I have this problem. 

Normally, I must have always the same ID unless I remove the application and I reinstalls.

Alain
Comment 1 Sebastien Pouliot 2013-10-15 14:46:56 UTC
This is a known issue (or should I say Apple design decision).

Apple documents several reasons where `IdentifierForVendor` might change [1]. While I don't agree that it's clear [2] (from Apple documentation) for the simulator value can change (beside that it can change when installing from Xcode) it is not something we have any control over.

Note that the fact that it happens with Xcode 5 is _likely_ related to the change that Apple made to compute the value. There's a bit of details in the iOS7 release notes [3].

I suggest you to use an approach similar to [2] in your simulator builds, i.e. hard code a value in your simulator builds.

[1] https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIDevice_Class/Reference/UIDevice.html#//apple_ref/occ/instp/UIDevice/identifierForVendor

[2] http://stackoverflow.com/questions/18905091/how-should-i-use-identifierforvendor-during-development

[3] https://developer.apple.com/library/ios/releasenotes/General/RN-iOSSDK-7.0/index.html#//apple_ref/doc/uid/TP40013202