cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabb...@apache.org
Subject [4/7] cordova-plugin-device git commit: Revert "Check user defaults first to maintain backwards compatibility"
Date Tue, 28 Jul 2015 18:21:41 GMT
Revert "Check user defaults first to maintain backwards compatibility"

This reverts commit 6416f60528a2ee1418c50c0791e8373bed40f39f.


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/3c125c81
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device/tree/3c125c81
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device/diff/3c125c81

Branch: refs/heads/master
Commit: 3c125c813573be6ddfc5344b45c151a4371dc9fc
Parents: 6416f60
Author: Jordan Clist <jordan@fergusapp.com>
Authored: Sat Jul 18 19:59:33 2015 +1200
Committer: Jordan Clist <jordan@fergusapp.com>
Committed: Sat Jul 18 19:59:33 2015 +1200

----------------------------------------------------------------------
 src/ios/CDVDevice.m | 28 ++++++++--------------------
 1 file changed, 8 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-device/blob/3c125c81/src/ios/CDVDevice.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVDevice.m b/src/ios/CDVDevice.m
index ffb22e2..9225cbc 100644
--- a/src/ios/CDVDevice.m
+++ b/src/ios/CDVDevice.m
@@ -6,9 +6,9 @@
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License.  You may obtain a copy of the License at
- 
+
  http://www.apache.org/licenses/LICENSE-2.0
- 
+
  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -28,13 +28,13 @@
 - (NSString*)modelVersion
 {
     size_t size;
-    
+
     sysctlbyname("hw.machine", NULL, &size, NULL, 0);
     char* machine = malloc(size);
     sysctlbyname("hw.machine", machine, &size, NULL, 0);
     NSString* platform = [NSString stringWithUTF8String:machine];
     free(machine);
-    
+
     return platform;
 }
 
@@ -47,26 +47,14 @@
 
 - (NSString*)uniqueAppInstanceIdentifier:(UIDevice*)device
 {
-    NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults];
-    static NSString* UUID_KEY = @"CDVUUID";
-    
-    // Check user defaults first to maintain backwards compaitibility with previous versions
-    // which didn't user identifierForVendor
-    NSString* app_uuid = [userDefaults stringForKey:UUID_KEY];
-    if (app_uuid == nil) {
-        app_uuid = [[device identifierForVendor] UUIDString];
-        [userDefaults setObject:app_uuid forKey:UUID_KEY];
-        [userDefaults synchronize];
-    }
-    
-    return app_uuid;
+    return [[device identifierForVendor] UUIDString];
 }
 
 - (void)getDeviceInfo:(CDVInvokedUrlCommand*)command
 {
     NSDictionary* deviceProperties = [self deviceProperties];
     CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK
messageAsDictionary:deviceProperties];
-    
+
     [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
 }
 
@@ -74,14 +62,14 @@
 {
     UIDevice* device = [UIDevice currentDevice];
     NSMutableDictionary* devProps = [NSMutableDictionary dictionaryWithCapacity:4];
-    
+
     [devProps setObject:@"Apple" forKey:@"manufacturer"];
     [devProps setObject:[device modelVersion] forKey:@"model"];
     [devProps setObject:@"iOS" forKey:@"platform"];
     [devProps setObject:[device systemVersion] forKey:@"version"];
     [devProps setObject:[self uniqueAppInstanceIdentifier:device] forKey:@"uuid"];
     [devProps setObject:[[self class] cordovaVersion] forKey:@"cordova"];
-    
+
     NSDictionary* devReturn = [NSDictionary dictionaryWithDictionary:devProps];
     return devReturn;
 }


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


Mime
View raw message