Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 15 additions & 9 deletions OpenUDID.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,6 @@
3. This notice may not be removed or altered from any source
distribution.
*/

#if __has_feature(objc_arc)
#error This file uses the classic non-ARC retain/release model; hints below...
// to selectively compile this file as non-ARC, do as follows:
// https://img.skitch.com/20120411-bcku69k1uw528cwh9frh5px8ya.png
#endif

#import "OpenUDID.h"
#import <CommonCrypto/CommonDigest.h> // Need to import for CC_MD5 access
#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
Expand Down Expand Up @@ -186,7 +179,11 @@ + (NSString*) valueWithError:(NSError **)error {
{
// generate a new uuid and store it in user defaults
CFUUIDRef uuid = CFUUIDCreate(NULL);
appUID = (NSString *) CFUUIDCreateString(NULL, uuid);
#if __has_feature(objc_arc)
appUID = (__bridge NSString *) CFUUIDCreateString(NULL, uuid);
#else
appUID = (NSString *) CFUUIDCreateString(NULL, uuid);
#endif
CFRelease(uuid);
}

Expand Down Expand Up @@ -328,8 +325,12 @@ + (NSString*) valueWithError:(NSError **)error {
if (error!=nil) *error = [NSError errorWithDomain:kOpenUDIDDomain
code:kOpenUDIDErrorOptedOut
userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:@"Application with unique id %@ is opted-out from OpenUDID as of %@",appUID,optedOutDate],@"description", nil]];


#if __has_feature(objc_arc)
kOpenUDIDSessionCache = [NSString stringWithFormat:@"%040x",0];
#else
kOpenUDIDSessionCache = [[NSString stringWithFormat:@"%040x",0] retain];
#endif
return kOpenUDIDSessionCache;
}

Expand All @@ -345,7 +346,12 @@ + (NSString*) valueWithError:(NSError **)error {
code:kOpenUDIDErrorNone
userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"OpenUDID succesfully retrieved",@"description", nil]];
}
#if __has_feature(objc_arc)
kOpenUDIDSessionCache = openUDID;
#else
kOpenUDIDSessionCache = [openUDID retain];
#endif

return kOpenUDIDSessionCache;
}

Expand Down