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
- Host: GitHub
- URL: https://github.com/appsflyersdk/adrevenue-apple-sdk
- Owner: AppsFlyerSDK
- License: other
- Created: 2019-07-22T08:20:40.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-05-03T16:46:31.000Z (about 2 years ago)
- Last Synced: 2024-11-15T20:02:43.855Z (over 1 year ago)
- Topics: adrevenue, appsflyer, ios
- Language: Objective-C
- Homepage:
- Size: 4.94 MB
- Stars: 5
- Watchers: 4
- Forks: 3
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AdRevenue project by AppsFlyer
[](http://cocoapods.org/pods/AppsFlyer-AdRevenue)
[](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 [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];
```