iOS11 DeviceCheck

DeviceCheck
备注:Xcode 9 beta测试,不支持模拟器。

#import "AppDelegate.h"
#import 

@interface AppDelegate ()

@end

@implementation AppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Override point for customization after application launch.
    if (DCDevice.currentDevice.isSupported) {
        [DCDevice.currentDevice generateTokenWithCompletionHandler:^(NSData * _Nullable token, NSError * _Nullable error) {
            if (error) {
                // Do what you want
            } else {
                // Upload token to App server
            }
            
        }];
    }
    return YES;
}

(lldb) po token.length
2185

你可能感兴趣的:(iOS11 DeviceCheck)