An open API service indexing awesome lists of open source software.

https://github.com/appsflyersdk/adrevenue-apple-sdk

AdRevenue project by AppsFlyer
https://github.com/appsflyersdk/adrevenue-apple-sdk

adrevenue appsflyer ios

Last synced: 11 months ago
JSON representation

AdRevenue project by AppsFlyer

Awesome Lists containing this project

README

          

# AdRevenue project by AppsFlyer

[![Version](https://img.shields.io/cocoapods/v/AppsFlyer-AdRevenue.svg)](http://cocoapods.org/pods/AppsFlyer-AdRevenue)
[![SPM Compatible](https://img.shields.io/badge/SPM-compatible-brightgreen.svg)](https://swift.org/package-manager)

### Table of Contents
- [Table of Contents](#table-of-contents)
- [Background](#background)
- [How it works](#how-it-works)
- [Supported ad monetization network SDKs](#supported-ad-monetization-network-sdks)
### Background

By attributing ad revenue, app owners gain the complete view of user LTV and campaign ROI.
Ad revenue is generated by displaying ads on rewarded videos, offer walls, interstitials, and banners in an app.
To display ads, ad monetization network SDKs are integrated into the app.
Having done so you are able to serve ads to your app users and generate ad revenue.

### How it works

The AdRevenue project mediates between the ad monetization network SDK and the AppsFlyer SDK.
In other words, you no longer need to send a revenue event, we will find it ourselves!
```

|-------------------------------------------------------------------------|
| |Application| + |Monetization network SDK| |
|-------------------------------------------------------------------------|

|-------------------------------------------------------------------------|
| |AdRevenue| |
|-------------------------------------------------------------------------|
| |AdRevenue main module| + |AdRevenue monetization network SDK mediator| |
|-------------------------------------------------------------------------|

|-------------------------------------------------------------------------|
| |AppsFlyer SDK| |
|-------------------------------------------------------------------------|

```

### Supported ad monetization network SDKs
- [AdMob iOS](https://github.com/AppsFlyerSDK/adrevenue-apple-admob)

## Adding The Connector To Your Project via Cocoapods:
Add to your Podfile and run `pod install`:
```ruby
pod 'AppsFlyer-AdRevenue'
```

## Adding The Connector To Your Project via [Swift Package Manager](#SPM)

1. **Add a Swift Package File**
- In your Xcode project, go to **File** > **Swift Packages** > **Add Package Dependency**.

2. **Enter Package Repository URL**
- In the dialog that appears, enter the URL of the repository that hosts the adrevenue-apple-sdk package:
```ruby
https://github.com/AppsFlyerSDK/adrevenue-apple-sdk.git
```
> *Note: as AdRevenueConnector has a dependency on [AppsFlyerLib framework](https://github.com/AppsFlyerSDK/AppsFlyerFramework) v6.12.1 , please, make sure to integrate it as well for SPM.*

## AdRevenue-Generic

```objective-c
@import AppsFlyerLib;
@import AppsFlyerAdRevenue;

...
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Setup AppsFlyer
[[AppsFlyerLib shared] setAppsFlyerDevKey:@"{dev-key}"];
[[AppsFlyerLib shared] setAppleAppID:@"{apple-id}"];
[[AppsFlyerLib shared] setIsDebug:YES];

// Setup AppsFlyerAdRevenue
[AppsFlyerAdRevenue start];
[[AppsFlyerAdRevenue shared] setIsDebug:YES];
//...
}

- (void)applicationDidBecomeActive:(UIApplication *)application {
[[AppsFlyerLib shared] start];
}

```
In your UIViewController, where you want to send data to AdRevenue specify following:

```objective-c
@import AppsFlyerAdRevenue;
```
### `logAdRevenue`

Allow you send data from the impression payload to AdRevenue no matter which mediation network you use:

```objective-c
NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
dictionary[kAppsFlyerAdRevenueCountry] = @"il"
dictionary[kAppsFlyerAdRevenueAdUnit] = @"02134568"
dictionary[kAppsFlyerAdRevenueAdType] = @"Banner"
dictionary[kAppsFlyerAdRevenuePlacement] = @"place"
dictionary[kAppsFlyerAdRevenueECPMPayload] = @"encrypt"
dictionary[@"foo"] = @"testcustom"
dictionary[@"bar"] = @"testcustom2"

[[AppsFlyerAdRevenue shared] logAdRevenueWithMonetizationNetwork:@"facebook"
mediationNetwork:AppsFlyerAdRevenueMediationNetworkTypeAdMob
eventRevenue:@(0.026)
revenueCurrency:@"USD"
additionalParameters:dictionary];
```