로딩중입니다
[iOS] IGAW Apple IDFA 传达 : Native iOS
8/31/2015 6:31:47 PM

Apple IDFA 传达

为了使用监测广告效果或 adPOPcorn 广告商品时,必须在我方 Framework 中登录 Apple IDFA。

添加 AdSupport.framework 后,在 AppDelegate 的 application: didFinishLaunchingWithOptions: 中调用 setAppleAdvertisingIdentifier API,登录 IDFA 价。

(* 注意 : 调用 igaworksCoreWithAppKey 前,需要登录 IDFA。)

#import "AppDelegate.h"
#import <AdSupport/AdSupport.h>

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 
{
    if (NSClassFromString(@"ASIdentifierManager")){
		NSUUID *ifa =[[ASIdentifierManager sharedManager]advertisingIdentifier];
		BOOL isAppleAdvertisingTrackingEnalbed = [[ASIdentifierManager sharedManager]isAdvertisingTrackingEnabled];
		[IgaworksCore setAppleAdvertisingIdentifier:[ifa UUIDString] isAppleAdvertisingTrackingEnabled:isAppleAdvertisingTrackingEnalbed];
		
		NSLog(@"[ifa UUIDString] %@", [ifa UUIDString]);
    }

    [IgaworksCore igaworksCoreWithAppKey:@"YOUR_APP_KEY" andHashKey:@"YOUR_HASH_KEY"];

    return YES;
}