Step 1. Configure Your Xcode Project

Configure Your Xcode Project

Create a Folder to Save Following Files

Unzip the SDK package and create a folder under your App project via ”Finder”, then copy the following flies into the folder you just created:

  • ce-*.a

  • I2WAPI.h

  • CEVideoViewProfile.h

  • IWOWMoatMobileAppKit.framework

  • CrystalExpress.plist

  • The necessary “.h” files for your AD format

    (ex. Copy “CERewardedVideoAD.h”, if you gonna integrate rewarded video into your App )

Drag the folder you created from “Finder” into “Project Navigator” (the left bar of the Xcode project), and the below window would pop out. Please ensure the target of your app has been chosen in “Add to Target”, like the picture.

Add Resource to Build Target

Choose your app target, please ensure the following file is added in the section of “Copy Bundle Resources” from “Build Phases” page:

  • CrystalExpress.plist

If not, press the “+” button to add the file

IMPORTANT! Set the Crystal_Id value in CrystalExpress.plist to the Crystal ID you received from intowow account manager.

Import Files to Build Target

At the same page, "Build Phases", please ensure the following files are added in the section of "Link Binary with Libraries":

  • ce-*.a

  • IWOWMoatMobileAppKit.framework

If not, press the “+” button to add files.

Moreover, add the following dylibs to your build target in the same page

  • libz.tbd

  • libsqlite3.tbd

  • libicucore.tbd

Update Other Linker Flags

Add -ObjC flag via TARGETS -> Build Settings -> Linking -> Other Linker Flags.

Allow HTTP Connection

iOS 9 and later versions block http connection by default. Since most of the redirect links of ads use HTTP protocol, we have to modify Info.plist in your project to allow HTTP connections.

<key>NSAppTransportSecurity</key>
<dict>
     <key>NSAllowsArbitraryLoads</key>
     <true/>
</dict>

SDK Initialization

  • Import I2WAPI.h in AppDelegate.m.

  • Initialize SDK in application:didFinishLaunchingWithOptions: of AppDelegate.m:

    • Enable/disable debugging message from SDK with initWithVerboseLog:(BOOL).

    • Set SDK to test mode by isTestMode:(BOOL) for development.

## import "I2WAPI.h"

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // init SDK
    [I2WAPI initWithVerboseLog:NO isTestMode:NO];
    return YES;
}

Last updated