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.

输入参数

类型名称描述
AppsFlyerAdRevenuerevenueCreates 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.

输入参数

类型名称描述
StringmonetizationNetworkThe name of the monetization network.
MediationNetworkmediationNetworkEnum of the medation network.
CurrencyeventRevenueCurrencyCurrency of the ad revenue event.
DoubleeventRevenueAmount of the ad revenue event.
Map<String, String>nonMandatoryContains 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

常量

类型名称描述
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.