Skip to main content

iOS - Integration Guide

Prerequisites


Before you start to integrate Vpon SDK, please make sure you already have your own Vpon Publisher Account and get your License Key. Register as a Vpon Publisher if you haven’t own your Publisher Account.

Once you have your own Publisher Account, follow the instruction below to integrate Vpon iOS SDK to your Xcode project.

Import SDK


Vpon provides two ways to integrate our SDK. Choose one of the following two options:

Integrate SDK with CocoaPods

Note: CocoaPods is a dependency manager for Swift and Objective-C Cocoa projects. If you haven’t installed CocoaPods in your device for development, please refer to CocoaPods Introduction

1. Create Podfile

1.1 Launch your terminal and change the directory to your Xcode project. Use pod init to initialize and generate a Podfile.
1.2 Open the Podfile. Uncomment the description about the platform version and modify it to the corresponding one.
1.3 Add the description about SDK version to the target section of the podfile. The description depends on whether the publishers assign a specified version of SDK :

  • Non specific version (Preferred): download the latest version automatically → pod 'VpadnSDK'
  • Specific version: (Take SDK 4.7.1 for example) → pod 'VpadnSDK', '~>4.7.1'

2. Run pod install

Make sure your current directory in terminal is the same as your Xcode project. Close the project (.xcodeproj) and run pod install to install SDK.

You’ll see a new project file (.xcoworkspace) in your Xcode project directory. A Pods project with new dependencies for VpadnSDK will included.

Note: To update to the latest SDK, please change your directory in terminal to your Xcode project. Run pod repo update to refresh the podspec and use pod install again to install SDK.

Integrate SDK Manually

Vpon provides two SDK types with the same function for our publishers. Choose one of them to integrate to your project.

There is slight difference between these two SDKs, which we will explain in introduction of Framework SDK.

Framework SDK


Framework SDK is a dynamic library, our latest SDK within any necessary references, headers and lib, needs fewer steps, and is lighter than Fundamental SDK.

However, this convenient way is only for apps designed for iOS version higher than 7.0. If you are targeting at users with devices OS version lower than 7.0, you should definitely choose Fundamental SDK instead.

Import Framework SDK

First, right click on your project and choose Add Files to your_project

Second, add VpadnSDKAdKit.framework into your project.

Remember to check whether the framework in Linked Frameworks and Libraries under General has been added.

Third, find Other Linker Flags under Build Settings and input -ObjC

Finally, import the framework:

@import VpadnSDKAdKit

Note: Remind again that the Framework SDK only support devices in iOS version higher than 7.0. Do not use this SDK if your app targets at users with devices OS version lower than 7.0.

Fundamental SDK


The decompressed SDK consists of Objective-C, a runtime library and a README. Show Vpadn banner on your Android App, you must complete three steps:

  1. Import libAdOn.a, VpadnBanner.h and VpadnInterstitial.h
  2. Add all iOS development frameworks
  3. Modify Build Settings

Notee: All three these steps are necessary!

1. Add SDK lib

The decompressed SDK consists of a lib file and two header files.

  1. Right click on your project in Xcode, choose Add Files to “your_project” IOS-add-file_vpadn.png
  2. Choose libAdOn.a, VpadnBanner.h and VpadnInterstitial.h in SDK

2. Add Framework

The SDK library references the a few iOS development frameworks.

1.Add all the following frameworks.
AdSupport,
AssetsLibrary,
AudioToolbox,
AVFoundation,
CoreFoundation,
CoreGraphics,
CoreLocation,
CoreMedia,
CoreMotion,
CoreTelephony,
EventKit,
Foundation,
MediaPlayer,
MessageUI,
MobileCoreServices,
QuartzCore,
Security,
StoreKit,
SystemConfiguration,
UIKit

To add these frameworks, double-click the project name. Open the Link Binary With Libraries dropdown under the Build phases tab. Add the frameworks from the iOS SDK using the + button that becomes visible. IOS-add-frameworks_vpadn

3. Modify Build Settings

Add -all_load and -ObjC under Other Linker Flags of Build Settings. Click the Build Phases and set the AdSupport framework to Optional.

App Transport Security


Apple recently revised App Transport Security (ATS), to iOS9. Please refer to iOS9 ATS for your reference.

Tips


關於更多廣告形式的呈現,請參考: