Update to SDK 10 now for iOS 10 support and other critical technical updates. x

1、Summary

1.1 To Readers

This documentation is intended for developers who want to integrate Yumimobi SDK in Unity products.

1.2 Development Enviroment

Xcode 7.0 and above

Deployment target: iOS 8.0 or higher

1.3 Get Demo

2、SDK Download

2.1Choose third-party SDK

2.2Download YUMI SDK

Please download YUMI SDK and add it to your project.

DownLoad SDK v2.0.5

2.3Download third-party SDK

Please download third-party SDK and add it to your project according to instructions of the third-party platform

3、Import YumiMediationPlugins.unitypackage

1.Double-click YumiMediationPlugins.unitypackage and import all files into Unity project

2.Add Component

Correlate YumiMediationSDKEventListener.cs and YumiMediationSDKManager.cs to the scene that you need.

3.Export Xcode project

4、Develop Environment Configuration

4.1 App Transport Security

ATS (App Transport Security) proposed by WWDC 15 features an important method for Apple to boost network communication security. Non-HTTPS access will be banned by default for ios 9 and later.

As most of materials are provided by HTTP, please set as the followings to improve fillrate:

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

The NSAllowsArbitraryLoads exception is required to make sure your ads are not impacted by ATS on iOS 9 devices, while NSAllowsArbitraryLoadsForMedia and NSAllowsArbitraryLoadsInWebContent are required to make sure your ads are not impacted by ATS on iOS 10 devices.

4.2 Permissions for ios 9 and later

Upload app to App Store, and add the following peimissions to info.plist.

 <-- Calendar -->
<key>NSCalendarsUsageDescription</key>
<string>App shall access calendar with your permission</string>
<!-- Photos -->
<key>NSPhotoLibraryUsageDescription</key>
<string>App shall access photos with your permission</string>

5、Integration Method

1. CocoaPods (recommend)

CocoaPods is a dependency manager for ios, which will make it easy to manage YumiMediationSDK.

Open Podfile, add one of the following methods to target.

If use CocoaPods for the first time, please view CocoaPods Guides.

1.If need YumiMediationSDK only:

pod "YumiMediationSDK"

2.If also need other platforms:

pod "YumiMediationAdapters", :subspecs =>['AdColony','AdMob','AppLovin','Baidu','Chartboost','Domob','Facebook','GDT','InMobi','IronSource','StartApp','Unity','Vungle','PlayableAds','Centrixlink','Mobvista']

Then run the followings at command line interface:

$ pod install --repo-update

Finally, open project by workspace.

2.Manually Integrating third-party SDK

1.Choose third-party SDK

2.Download third-party SDK

3.Add third-party SDK to your project

6、Code Sample

6.1、Advertisement Forms

Banner

Initialization

//banner position
public enum YumiMediationBannerPosition{
        YumiMediationBannerPositionTop,
        YumiMediationBannerPositionBottom
    }
YumiMediationSDK_Unity.initYumiMediationBanner("Your PlacementID","Your channelID",
                                               "Your versionID",                                             YumiMediationSDK_Unity.YumiMediationBannerPosition.YumiMediationBannerPositionBottom);

Request banner

YumiMediationSDK_Unity.loadAd(false);

Reset banner size

/// Required to set this banner view to a proper size. Use one of the predefined standard ad sizes (such as kYumiMediationAdViewBanner320x50) If you want to specify the ad size you need to set it before calling loadAd:
// default: iPhone and iPod Touch ad size. Typically 320x50.
// default: iPad ad size. Typically 728x90.
// If you do not need to change the default values, do not execute the following code.
self.yumiBanner.bannerSize = kYumiMediationAdViewBanner300x250;

Remove Banner

YumiMediationSDK_Unity.removeBanner();

Delegate implementation

void yumiMediationBannerViewDidLoadEvent()
{
    Debug.Log("YumiMediationSDKBanner,didLoaded");
}
void yumiMediationSDKDidFailToReceiveAdEvent(string error)
{
    Debug.Log("YumiMediationSDKBanner,didFailToReceiveAd");
}
void yumiMediationBannerViewDidClickEvent()
{
    Debug.Log("YumiMediationSDKBanner,didClickedAd");
}

Self-adaptation

YumiMediationSDK_Unity.loadAd(false);

You are available to set whether to turn on self-adaptation when making banner request.

If isSmartBanner is YES ,YumiMediationBannerView will automatically adapt to size of device.

  • non self-adaptation mode
  • self-adaptation mode

Interstitial

Initialization and interstitial request

 
YumiMediationSDK_Unity.initYumiMediationInterstitial("Your PlacementID",
                                                     "Your channelID",
                                                     "Your versionID");

Show Interstitial

YumiMediationSDK_Unity.present();

Delegate implementation

void yumiMediationInterstitialDidReceiveAdEvent(){
    Debug.Log ("YumiMediationInterstital, DidReceiveAd");
}
void yumiMediationInterstitialDidFailToReceiveAdEvent(string error){
    Debug.Log ("YumiMediationInterstital, DidFailToReceiveAd");
}
void yumiMediationInterstitialWillDismissScreenEvent(){
    Debug.Log ("YumiMediationInterstital, WillDismissScreen");
}
void yumiMediationInterstitialDidClickEvent() {
    Debug.Log ("YumiMediationInterstital, DidClicked");
}

Rewarded Video

Initialization and rewarded video request

YumiMediationSDK_Unity.loadYumiMediationVideo("Your PlacementID",
                                              "Your channelID",
                                              "Your versionID");

Determine whether rewarded video is ready.

bool isplay = YumiMediationSDK_Unity.isVideoReady();

Show rewarded video

YumiMediationSDK_Unity.playVideo();

Delegate implementation

 void yumiMediationVideoDidOpenEvent(){
    Debug.Log ("YumiMediationVideo, DidOpen");
}
void yumiMediationVideoDidStartPlayingEvent(){
    Debug.Log ("YumiMediationVideo, DidStartPlaying");
}
void yumiMediationVideoDidCloseEvent(){
    Debug.Log ("YumiMediationVideo, DidClosed");
}
void yumiMediationVideoDidRewardEvent(){
    Debug.Log ("YumiMediationVideo, DidRewarded");
}

7、Debug Mode

Please select debug mode if you want to test whether ad ruturn is available for an app.

7.1、Call debug mode

YumiMediationSDK_Unity.presentYumiMediationDebugCenter (" your banner placementID"," your interstitial placementID","your video placementID","your native placementID","your channelID","your versionID");

7.2 Reset banner size of debug mode

/// Required to set this banner view to a proper size. Use one of the predefined standard ad sizes (such as kYumiMediationAdViewBanner320x50) If you want to specify the ad size you need to set it before calling 'presentYumiMediationDebugCenter'
/// default: iPhone and iPod Touch ad size. Typically 320x50.
/// default: iPad ad size. Typically 728x90.
/// If you do not need to change the default values, do not execute the following code.
YumiMediationSDK_Unity.setBannerSizeInDebugCenter (YumiMediationSDK_Unity.YumiMediationAdViewBannerSize.kYumiMediationAdViewBanner300x250);

7.3、Sample

*Select platform integration category*

*Select single platform, the grey indicates not configurated yet*

select ad category, debug single platform