iOS App唯一标识符获取方案
刷机 | APP重装 | 存储方式 |
---|---|---|
否 | 否 | MFSCache、NSUserDefaults |
否 | 是 | KeyChain、Safari Cookie、iCloud、IDFA、IDFV、NSUUID |
是 | 是 | iCloud、IDFA、IDFV、NSUUID |
#import <MFSIdentifier/MFSIdentifier.h>
NSString *deviceID = [MFSIdentifier deviceID];
NSLog(@"deviceId: %@", deviceID);
编辑Pofile
pod 'MFSIdentifier', '1.0.0'
安装
pod install
更多关于CocoaPods
编辑Cartfile
github "maxfong/MFSIdentifier" >= 1.0.0
安装
carthage update
更多关于Carthage
使用Framework,工程Other Linker Flags需添加-ObjC
- Safari Cookie支持需iOS9.0及以上。
- 设置[MFSCacheUtility registerAESKey:]达到其他应用获取了数据也无法正确解密
- iCloud方案需设置TARGETS的Capabilities,开启iCloud并设置Key-value storage
如果您发现任何问题或有啥建议,发个issues,谢谢
MFSIdentifier is available under the MIT license. See the LICENSE file for more info.