Helium by Chartboost SDK 集成

提示:
如果您对 Helium by Chartboost 广告收入跟踪有任何疑问,请联系您的专属客户经理,或发送邮件至 support@adjust.com

如果您想使用 Helium by Chartboost SDK 跟踪广告收入,可以借助我们的 SDK 到 SDK 集成,将数据发送到 Adjust 后端。

操作前须知

要使用该功能,请先为您的平台下载并设置对应的 Adjust SDK。按照下方链接中的说明操作,开始使用功能。

⚙️ iOS SDK v4.29.7 及更高版本 / Android SDK v4.29.0 及更高版本 / Unity SDK v4.29.6 及更高版本/Flutter SDK v4.29.2

示例

Objective-CiOS
Java安卓
C#Unity

[NSNotificationCenter.defaultCenter addObserverForName:kHeliumDidReceiveILRDNotification
                                                object:nil
                                                 queue:nil
                                            usingBlock:^(NSNotification * _Nonnull notification) {
    // extract the ILRD payload
    HeliumImpressionData *ilrd = (HeliumImpressionData *)notification.object;
NSDictionary *json = ilrd.jsonData;
// mandatory fields
    NSNumber *ad_revenue = [json objectForKey:@"ad_revenue"];
    NSString *currency_type = [json objectForKey:@"currency_type"];
    ADJAdRevenue *adjustAdRevenue = [[ADJAdRevenue alloc] initWithSource:ADJAdRevenueSourceHeliumChartboost];
    [adjustAdRevenue setRevenue:[ad_revenue doubleValue] currency:currency_type];
    // optional fields
    NSString *network_name = [json objectForKey:@"network_name"];     // Helium demand network name
    NSString *placement_name = [json objectForKey:@"placement_name"]; // Helium placement name
    NSString *line_item_name = [json objectForKey:@"line_item_name"]; // Helium line item name
    [adjustAdRevenue setAdRevenueNetwork:network_name];
    [adjustAdRevenue setAdRevenueUnit:placement_name];
    [adjustAdRevenue setAdRevenuePlacement:line_item_name];
    // track Adjust ad revenue
    [Adjust trackAdRevenue:adjustAdRevenue];
}