Summary:
On iOS simulator 9.3, the UIDevice method "identifierForVendor" does not consistently return the same value if called at the beginning of the app lifetime from a background thread. If called in the background near app startup, it returns a different value then it does when called on the main thread or when called in the background at a later point in the app lifetime.
Steps to Reproduce:
Use the attached code in an app's AppDelegate.
Run on a iOS Simulator 9.3.
Observe the two printed values are different.
Note that the values printed will be the same if you either uncomment the sleep or run on iOS simulator <= 9.2
Expected Results:
In the simulator, vendor id should be the same on every call in a single app launch.
Actual Results:
The value returned early in the app life on a background thread is different then when called later or when called on the main thread.
Description
Summary: On iOS simulator 9.3, the UIDevice method "identifierForVendor" does not consistently return the same value if called at the beginning of the app lifetime from a background thread. If called in the background near app startup, it returns a different value then it does when called on the main thread or when called in the background at a later point in the app lifetime.
Steps to Reproduce:
Note that the values printed will be the same if you either uncomment the sleep or run on iOS simulator <= 9.2
Expected Results: In the simulator, vendor id should be the same on every call in a single app launch.
Actual Results: The value returned early in the app life on a background thread is different then when called later or when called on the main thread.
attachment:
(BOOL)application:(UIApplication )application didFinishLaunchingWithOptions:(NSDictionary )launchOptions { dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ // [NSThread sleepForTimeInterval:1]; NSLog(@"vendor id background: %@", [[[UIDevice currentDevice] identifierForVendor] UUIDString]);
});
NSLog(@"vendor id: %@", [[[UIDevice currentDevice] identifierForVendor] UUIDString]); return YES; }
Product Version: Simulator 9.3 Created: 2016-03-28T15:37:38.809070 Originated: 2016-03-28T00:00:00 Open Radar Link: http://www.openradar.me/25386801