入门指南
开始
要展示Adx3广告,第一步就是将Adx3移动广告SDK集成到应用中。集成广告SDK后,您可以继续植入一种或者多种支持的广告格式
前提条件
- 使用 Xcode 13.4.1 或者更高版本 
- 以 iOS 10.0 或者更高版本为目标平台 
- 推荐:管理端后台申请 SDK 和广告位 ID 
导入移动广告SDK
1.下载SDK:
https://pub-block.s3.ap-east-1.amazonaws.com/base/202306/4fd9e3ee1bfc0c6b.zip
2.解压 SDK 框架,然后将以下框架导入您的 Xcode 项目:
- Adx3Framework.framework 
3.在项目的 build 设置中,将 -ObjC 链接器标志添加到 Other Linker Flags:

更新您的 Info.plist 文件
更新应用的 Info.plist 文件添加以下键:
<key>NSUserTrackingUsageDescription</key>
<string>This identifier will be used to deliver personalized ads to you.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>This identifier will be used to deliver personalized ads to you.</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>This identifier will be used to deliver personalized ads to you.</string>初始化广告 SDK
在加载广告之前,请在 [Adx3AdManager sharedManager] 上调用 initWithAppId:(NSString *)appId success:(isSuccess)success 方法,该方法将初始化 SDK,并在初始化完成之后,回调初始化的结果。此操作仅需执行一次,最好是在应用启动时执行。建议您尽早调用 initWithAppId:(NSString *)appId success:(isSuccess)success
以下示例展示了如何在 Appdelegate 中调用 initWithAppId:(NSString *)appId success:(isSuccess)success 方法
AppDelegate.m 示例
class AppDelegate: UIResponder, UIApplicationDelegate {
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        Adx3AdManager.shared().initWithAppId("Your App ID") { isSuccess in
            //result handler
        }
        // Override point for customization after application launch.
        return true
    }
    
    func applicationDidBecomeActive(_ application: UIApplication) {
        Adx3AdManager.shared().applicationDidBecomeActive(application)
    }
    
    func applicationDidEnterBackground(_ application: UIApplication) {
        Adx3AdManager.shared().applicationDidEnterBackground(application)
    }
   
}#import "Adx3Framework/Adx3Ad.h"
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Override point for customization after application launch.
    [[Adx3AdManager sharedManager] initWithAppId:@"Your App ID" success:^(BOOL isSuccess) {
       //result handler
    }];
    return YES;
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
    [[Adx3AdManager sharedManager] applicationDidBecomeActive:application];
}
- (void)applicationDidEnterBackground:(UIApplication *)application {
    [[Adx3AdManager sharedManager] applicationDidEnterBackground:application];
}
@end选择广告格式
开屏

开屏广告是一种特殊的广告格式,适合希望通过应用启动时加载广告的发布商。用户可以随时关闭开屏广告。
横幅

横幅广告是在设备屏幕的顶部或底部展示的矩形广告。 用户与应用互动时,横幅广告会停留在屏幕上,并且可在一段时间后自动刷新。
插屏

覆盖应用界面的全屏广告,直到用户将其关闭。 它们最适合在应用执行流程中的自然暂停位置展示,例如游戏关卡之间或是用户刚完成一项任务之后。
原生

与您的应用外观和风格相符的可定制广告。您可以决定这类广告的投放方式和位置,从而使布局与应用的设计更加一致。
激励

为观看短视频和与试玩广告及问卷调查互动的用户予以奖励的广告。适合通过免费游戏用户创收。
多重

为列表或瀑布流布局定制的广告。
Last updated