AppsFlyerAdRevenue [LEGACY]
Deprecated in v6.15.0
(Supported until SDK v6.14.2 For versions including and above v6.15.0 use logAdRevenue
)
总览
AppsFlyerAdRevenue is the parent class for the ad revenue SDK.
方法
initaliaze
方法签名
public static void initialize(AppsFlyerAdRevenue revenue)
描述
Initializes the ad revenue SDK.
输入参数
类型 | 名称 | 描述 |
---|---|---|
AppsFlyerAdRevenue | revenue | Creates and initializes an AdRevenue singleton object. |
返回
void
.
用法示例
AppsFlyerAdRevenue.Builder afRevenueBuilder = new AppsFlyerAdRevenue.Builder( this);
AppsFlyerAdRevenue.initialize(afRevenueBuilder.build());
logAdRevenue
方法签名
public static void logAdRevenue(@NonNull String monetizationNetwork, @NonNull MediationNetwork mediationNetwork, @NonNull Currency eventRevenueCurrency, @NonNull Double eventRevenue, @Nullable Map<String, String> nonMandatory)
描述
Logs an ad revenue impression.
输入参数
类型 | 名称 | 描述 |
---|---|---|
String | monetizationNetwork | The name of the monetization network. |
MediationNetwork | mediationNetwork | Enum of the medation network. |
Currency | eventRevenueCurrency | Currency of the ad revenue event. |
Double | eventRevenue | Amount of the ad revenue event. |
Map<String, String> | nonMandatory | Contains native and custom fields for the ad revenue payload, as described in the following usage example. |
返回
void
.
用法示例
// Creating optional customParams
Map<String, String> customParams = new HashMap<>();
customParams.put(Scheme.COUNTRY, "US");
customParams.put(Scheme.AD_UNIT, "89b8c0159a50ebd1");
customParams.put(Scheme.AD_TYPE, AppsFlyerAdNetworkEventType.BANNER.toString());
customParams.put(Scheme.PLACEMENT, "place");
customParams.put(Scheme.ECPM_PAYLOAD, "encrypt");
customParams.put("foo", "test1");
customParams.put("bar", "test2");
// Actually recording a single impression
AppsFlyerAdRevenue.logAdRevenue(
"ironsource",
MediationNetwork.googleadmob,
Currency.getInstance(Locale.US),
0.99,
customParams
);
变量
MediationNetwork
常量
类型 | 名称 | 描述 |
---|---|---|
String | ironsource | The name of the mediation network. |
String | applovinmax | The name of the mediation network. |
String | googleadmob | The name of the mediation network. |
String | fyber | The name of the mediation network. |
String | appodeal | The name of the mediation network. |
String | admost | The name of the mediation network. |
String | topon | The name of the mediation network. |
String | tradplus | The name of the mediation network. |
String | yandex | The name of the mediation network. |
String | chartboost | The name of the mediation network. |
String | unity | The name of the mediation network. |
String | customMediation | The mediation solution is not on the list of supported mediation partners. |
String | directMonetizationNetwork | The app integrates directly with monetization networks without mediation. |
已更新 4个月前