iOS 获取 设备广告标识IDFA
2017-11-13 本文已影响42人
aaa000
一 、导入
AdSupport.framework
二、引入 库头文件
#import <AdSupport/AdSupport.h>
三、获取idfa
NSString *idfa = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString];
NSLog(@"idfa = %@",idfa);
四、
将idfa 拷贝到粘贴板
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
pasteboard.string = idfa;