iOS SDK
This page describes how to install the AdGate Media iOS SDK.
Requirements
• iOS version 8.0 or higher
1. Install SDK
Installation with CocoaPods
To install via CocoaPods, simply add the following line to your Podfile:
Run
pod install
to install AdGateMedia dependency.
Installation with Framework (.framework)
Download the AdGateMedia_UniversalFramework.zip file from the Releases page. Drag and drop
AdGateMedia.framework
andAdGateMedia.bundle
into your project. (Note that when you would like to upload your app to app store you must use device only version which is AdGateMedia_DeviceFramework.zip otherwise your app will be rejected Radar)Go to General/Linked Frameworks and Libraries and add
AVFoundation.framework
,AdSupport.framework
CoreMedia.framework
, andWebKit.framework
.Go to Build Settings/Linking/Other Linker Flags and add -ObjC flag.
Make sure Build Settings/Search Paths/Framework Search Paths includes the path of our framework, Otherwise add framework path. For example if your framework exist in your project directory then you could add
$(PROJECT_DIR)
.Make sure AdGateMedia.bundle is added in Build Phases/Copy Bundle Resources.
Installation with Library (.a)
Download the AdGateMediaLibrary.zip file from the Releases page. Drag and drop
libAdGateMedia.a
,AdGateMedia.bundle
andinclude
folder into your project. (Note that when you would like to upload your app to app store you must use device only version which is AdGateMedia_DeviceLibrary.zip otherwise your app will be rejected Radar)Go to General/Linked Frameworks and Libraries and add
AVFoundation.framework
,AdSupport.framework
CoreMedia.framework
, andWebKit.framework
.Go to Build Settings/Linking/Other Linker Flags and add -ObjC flag.
Make sure Build Settings/Search Paths/Library Search Paths includes the path of our library, otherwise add library path. For example if library exist in project directory then you could add
$(PROJECT_DIR)
.Make sure AdGateMedia.bundle is added in Build Phases/Copy Bundle Resources.
Go to Build Settings/Search Paths/Header Search Paths and add $(PROJECT_DIR)/include or actual directory path where library header file copied.
In order to get started you are required to add the following header file to either your project's .pch file or at the location you are displaying the offer wall:
Installation in Swift project
Follow all bullet points of installation steps mentioned above and do these additional steps.
Create Bridging header file (If not already created). It's name should be
${YOURPROJ}-Bridging-Header.h
while ${YOURPROJ} is your project name.If you created bridging header manually then Go to Build Settings->Swift Compiler - General->Objective-C Bridging Header and add bridging header manually by specifying
$(PROJECT_DIR)/$(PROJECT_NAME)/$(PROJECT_NAME)-Bridging-Header.h
In the Bridging header file, import your framework using the standard Objective C import syntax. In our case, it will be
Note
Please note that method names may be little bit shorter when you use this framework inside swift project.
We have included a demo project written in swift for your convenience.
2. Load & Display the Offer wall
Add the following lines of code where you want to launch the offer wall:
To change the offer wall code and user name, use the following code:
Set the rewardCode and userId to the appropriate values. You may get your wall code from this page on the affiliate dashboard.
You can pass subids while loading the offer wall, specifically, s2, s3, s4 and s5.
Once the offer wall is loaded you can display it using the
showOfferWall
method. User can see it called in the above code after the wall is successful loaded.
3. Get a list of the latest offer wall conversions
To get the list of the latest offer wall conversions, use the getConversions
method. Add the following lines of code in your class (i.e ViewController)
4. Debug mode:
Step 1: Select the Edit Scheme from XCode where you set your active scheme.
Step 2: Goto Run -> Info -> Build Configuration -> Debug option -> Close.
Note: Use NSLog to print result after selecting the Debug build configuration. NSLog is used to print the value in the console for debug mode.
5. Demo App.
This repository contains a demo iOS app that shows how to implement our SDK.
Last updated