AppsFlyerAdRevenue [LEGACY]

Deprecated in v6.15.0
(Supported until SDK v6.14.6 For versions including and above v6.15.0 use logAdRevenue)

总览

AppsFlyerAdRevenue is the parent class for the ad revenue SDK.

属性

MediationNetworkType

常量

类型名称描述
StringironsourceThe name of the mediation network.
StringapplovinmaxThe name of the mediation network.
StringgoogleadmobThe name of the mediation network.
StringfyberThe name of the mediation network.
StringappodealThe name of the mediation network.
StringadmostThe name of the mediation network.
StringtoponThe name of the mediation network.
StringtradplusThe name of the mediation network.
StringyandexThe name of the mediation network.
StringchartboostThe name of the mediation network.
StringunityThe name of the mediation network.
StringcustomMediationThe mediation solution is not on the list of supported mediation partners.
StringdirectMonetizationNetworkThe app integrates directly with monetization networks without mediation.

方法

start

方法签名

(void)start;

描述
Initializes the ad revenue SDK.

输入参数

This method doesn't accept input arguments.

返回
void.

logAdRevenue

方法签名

(void)logAdRevenueWithMonetizationNetwork:(NSString * _Nonnull)monetizationNetwork
      mediationNetwork:(AppsFlyerAdRevenueMediationNetworkType)mediationNetwork
      eventRevenue:(NSNumber * _Nonnull)eventRevenue
      revenueCurrency:(NSString * _Nonnull)revenueCurrency
      additionalParameters:(NSDictionary * _Nullable)additionalParameters

描述
Logs an ad revenue impression.

输入参数

类型名称描述
StringmonetizationNetworkThe name of the monetization network.
MediationNetworkTypemediationNetworkEnum of the mediation network.
StringrevenueCurrencyCurrency of the ad revenue event.
NSNumbereventRevenueAmount of the ad revenue event.
NSDictionaryadditionalParametersContains native and custom fields for the ad revenue payload, as described in the following usage example.

返回
void.

用法示例

let adRevenueParams:[AnyHashable: Any] = [
            kAppsFlyerAdRevenueCountry : "us",
            kAppsFlyerAdRevenueAdUnit : "02134568",     //Add ! here
            kAppsFlyerAdRevenueAdType : "Banner",  //Add ! here
            kAppsFlyerAdRevenuePlacement : "place",
            "foo" : "testcustom",
            "bar" : "testcustom2"
        ]
        
        AppsFlyerAdRevenue.shared().logAdRevenue(
            monetizationNetwork: "facebook",
            mediationNetwork: MediationNetworkType.moPub,
            eventRevenue: 0.026,
            revenueCurrency: "USD",
            additionalParameters: adRevenueParams)