cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject [04/11] cordova-plugin-device git commit: CB-10631 ios: Fix for device.uuid in iOS 5.1.1
Date Fri, 15 Apr 2016 20:48:53 GMT
CB-10631 ios: Fix for device.uuid in iOS 5.1.1

- Check if identifierForVendor exists and if not create a new UUID
  and store in on the device for future use.


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device/commit/b31206dd
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device/tree/b31206dd
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device/diff/b31206dd

Branch: refs/heads/1.1.x
Commit: b31206dd6566548337a63c26b87f4c03fcaacbad
Parents: d42fb80
Author: Thomas Allen <thomas@agilelaw.com>
Authored: Tue Feb 16 14:12:24 2016 -0600
Committer: Thomas Allen <thomas@agilelaw.com>
Committed: Tue Feb 16 16:15:57 2016 -0600

----------------------------------------------------------------------
 src/ios/CDVDevice.m | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-device/blob/b31206dd/src/ios/CDVDevice.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVDevice.m b/src/ios/CDVDevice.m
index f58c321..373696d 100644
--- a/src/ios/CDVDevice.m
+++ b/src/ios/CDVDevice.m
@@ -55,7 +55,12 @@
     // which didn't user identifierForVendor
     NSString* app_uuid = [userDefaults stringForKey:UUID_KEY];
     if (app_uuid == nil) {
-        app_uuid = [[device identifierForVendor] UUIDString];
+        if ([[UIDevice currentDevice] respondsToSelector:@selector(identifierForVendor)])
{
+            app_uuid = [[device identifierForVendor] UUIDString];
+        } else {
+            app_uuid = (__bridge NSString *) CFUUIDCreateString(NULL, CFUUIDCreate(NULL));
+        }
+
         [userDefaults setObject:app_uuid forKey:UUID_KEY];
         [userDefaults synchronize];
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message