AppsFlyerAdRevenue

Overview

AppsFlyerAdRevenue is the parent class for the ad revenue SDK.

Properties

MediationNetworkType

Constants

TypeNameDescription
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.

Methods

start

Method signature

(void)start;

Description
Initializes the ad revenue SDK.

Input arguments

This method doesn't accept input arguments.

Returns
void.

logAdRevenue

Method signature

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

Description
Logs an ad revenue impression.

Input arguments

TypeNameDescription
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.

Returns
void.

Usage example

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

Did this page help you?