UNICORN - iOS
SecureUDID.h
1 //
2 // SecureUDID.h
3 // SecureUDID
4 //
5 // Created by Crashlytics Team on 3/22/12.
6 // Copyright (c) 2012 Crashlytics, Inc. All rights reserved.
7 // http://www.crashlytics.com
8 // info@crashlytics.com
9 //
10 
11 /*
12  Permission is hereby granted, free of charge, to any person obtaining a copy of
13  this software and associated documentation files (the "Software"), to deal in
14  the Software without restriction, including without limitation the rights to
15  use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
16  of the Software, and to permit persons to whom the Software is furnished to do
17  so, subject to the following conditions:
18 
19  The above copyright notice and this permission notice shall be included in all
20  copies or substantial portions of the Software.
21 
22  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28  SOFTWARE.
29  */
30 
31 #import <Foundation/Foundation.h>
32 
33 @interface SecureUDID : NSObject
34 
35 /*
36  Returns a unique id for the device, sandboxed to the domain and salt provided. This is a potentially
37  expensive call. You should not do this on the main thread, especially during launch.
38 
39  retrieveUDIDForDomain:usingKey:completion: is provided as an alternative for your 4.0+ coding convenience.
40 
41  Example usage:
42  #import "SecureUDID.h"
43 
44  NSString *udid = [SecureUDID UDIDForDomain:@"com.example.myapp" key:@"difficult-to-guess-key"];
45 
46  */
47 + (NSString *)UDIDForDomain:(NSString *)domain usingKey:(NSString *)key;
48 
49 /*
50  Getting a SecureUDID can be very expensive. Use this call to derive an identifier in the background,
51  and invoke a block when ready. Use of this method implies a device running >= iOS 4.0.
52 
53  Example usage:
54  #import "SecureUDID.h"
55 
56  [SecureUDID retrieveUDIDForDomain:@"com.example.myapp" usingKey:@"difficult-to-guess-key" completion:^(NSString *identifier) {
57  // make use of identifier here
58  }];
59 
60  */
61 #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 40000
62 + (void)retrieveUDIDForDomain:(NSString *)domain usingKey:(NSString *)key completion:(void (^)(NSString* identifier))completion;
63 #endif
64 
65 /*
66  Indicates that the system has been disabled via the Opt-Out mechansim.
67 */
68 + (BOOL)isOptedOut;
69 
70 @end
71 
72 /*
73  This identifier is returned when Opt-Out is enabled.
74  */
75 extern NSString *const SUUIDDefaultIdentifier;
Definition: SecureUDID.h:33