iOS
Last updated
Last updated
The CrystalExpress MoPub Adapter allows MoPub publishers to add CrystalExpress as a Custom Ad Network within the MoPub platform.
CrystalExpress provides four ad formats for MoPub mediation. The relationship between MoPub ad unit and ad format in CrystalExpress is as following:
MoPub ad unit
AD format from CrystalExpress
Banner or Medium
Card AD
Rewarded Video
Rewarded Video AD
Interstitial
Splash AD
Native
Native AD
NOTICE: The aspect ratio for CrystalExpress ad is 16:9, 4:3 or 1:1.
Before you start add CrystalExpress as Custom network, you have to integrate MoPub SDK by following the instructions on the .
NECESSARY STEPS:
Get CrystalExpress SDK and Crystal ID.
Integrate the CrystalExpress SDK.
Add CrystalExpress MoPub Adapter into project.
Configure MoPub to mediate CrystalExpress.
Please contact your Intowow account manager. We will provide the right version of SDK and Crystal ID according to your needs.
Unzip the SDK package, and you could find static library, header files, and sample app.
Find ce-[premium|lite]-[global|cn]-[version].a
and add it to your project via Build Phases -> Link Binary With Libraries in project setting of Xcode.
Add header files to project.
Make sure that all of the following frameworks are added into Build Phases.
Security.framework
CFNetwork.framework
MessageUI.framework
MobileCoreServices.framework
SystemConfiguration.framework
AdSupport.framework
libz.dylib
libc++.dylib
CoreTelephony.framework
CoreMedia.framework
libsqlite3.dylib
AVFoundation.framework
libicucore.dylib
Add -ObjC
flag in TARGETS -> Build Settings -> Linking -> Other Linker Flags.
Copy CrystalExpress.plist
to your project and set the Crystal_Id value to Crystal ID you received from Intowow account manager.
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.
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.
Contact Intowow account manager for CrystalExpress MoPub Adapter and sample code.
Unzip CrystalExpress_MoPub_Demo_iOS.zip, and add files under folder CrystalExpress_MoPub_Plugin
(under MoPubDemo/MoPubDemo/
) to your project according to following different propose.
For Banner:
Banner/CEMPCardCustomEvent.h
Banner/CEMPCardCustomEvent.m
Common/UIView+CELayoutAdditions.h
Common/UIView+CELayoutAdditions.m
For Native:
Native/CEMPNativeCustomEvent.h
Native/CEMPNativeCustomEvent.m
Native/CEMPNativeAdRenderer.h
Native/CEMPNativeAdRenderer.m
Native/CEMPNativeAdAdapter.h
Native/CEMPNativeAdAdapter.m
Common/UIView+CELayoutAdditions.h
Common/UIView+CELayoutAdditions.m
For Interstitial:
Interstitial/CEMPInterstitialCustomEvent.h
Interstitial/CEMPInterstitialCustomEvent.m
For Rewarded Video:
RewardedVideo/CEMPRewardedVideoCustomEvent.h
RewardedVideo/CEMPRewardedVideoCustomEvent.m
If you are still having issues, please check out the sample code within download folder.
Click Custom Native Network
.
Add CrystalExpress
into Title edit box.
Add the Custom Event Classes for iOS:
Banner ad: enter CEMPCardCustomEvent
Native ad: enter CEMPNativeCustomEvent
Interstitial ad: enter CEMPInterstitialCustomEvent
Rewarded video ad: enter CEMPRewardedVideoCustomEvent
For each unit, you will need to add a JSON object with the following keys:
placement_id
(required; JSON String): Please contact intowow account manager for this.
default_title
(optional; JSON String; Native ad only): Default string for ad title.
default_mainText
(optional; JSON String; Native ad only): Default string for ad main text.
default_CTAText
(optional; JSON String; Native ad only): Default string for call to action text.
In MoPub custom event, our SDK will keep the aspect ratio of creatives and try to fit the ad view that you bind to MoPub.
If the aspect ratio for the ad view to be bound and the creative are inconsistent, the return ad will be filled with black background to match the aspect ratio.
Log in to your MoPub account and register your application on your account dashboard.
1. Click Networks
tab.
2. Click Add a Network
button.
Request ad follow by the instructions for , , , from MoPub.