| Index: base/ios/device_util.mm
|
| diff --git a/base/ios/device_util.mm b/base/ios/device_util.mm
|
| index 1d16de4b9b878c3890a64dfcd1fee552e789d9ac..8e57d752f9096969ec332a4dcb3470840a257515 100644
|
| --- a/base/ios/device_util.mm
|
| +++ b/base/ios/device_util.mm
|
| @@ -6,6 +6,7 @@
|
|
|
| #include <CommonCrypto/CommonDigest.h>
|
| #import <Foundation/Foundation.h>
|
| +#import <UIKit/UIKit.h>
|
|
|
| #include <ifaddrs.h>
|
| #include <net/if_dl.h>
|
| @@ -16,6 +17,7 @@
|
| #include "base/logging.h"
|
| #include "base/string_util.h"
|
| #include "base/stringprintf.h"
|
| +#include "base/sys_info.h"
|
| #include "base/mac/scoped_cftyperef.h"
|
| #include "base/memory/scoped_ptr.h"
|
| #include "base/sys_string_conversions.h"
|
| @@ -103,7 +105,10 @@ std::string GetDeviceIdentifier(const char* salt) {
|
| NSString* client_id = [defaults stringForKey:kClientIdPreferenceKey];
|
|
|
| if (!client_id) {
|
| - client_id = base::SysUTF8ToNSString(GetRandomId());
|
| + if (base::SysInfo::IsRunningOnIOS6OrLater())
|
| + client_id = [[[UIDevice currentDevice] identifierForVendor] UUIDString];
|
| + else
|
| + client_id = base::SysUTF8ToNSString(GetRandomId());
|
| [defaults setObject:client_id forKey:kClientIdPreferenceKey];
|
| [defaults synchronize];
|
| }
|
|
|