404 Not Found


nginx
404 Not Found

404 Not Found


nginx
404 Not Found

404 Not Found


nginx
404 Not Found

404 Not Found


nginx

1、Overview

1.1 Target Readers

This document is for developers who need to integrate YUMI Unity 3D SDK into their Unity3D product.

1.2 Development environment

OS:Windows、Mac、Linux

Android SDK: 2.1 and newer versions

IDE:Unity64-5.2.3f1

2、SDK Download

2.1 Choose third-party SDK

2.2 Download YUMI SDK

Please download YUMI SDK and add it to your project

2.3 Download third-party SDK

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

3、Integration

3.1 Add resource files

1、All Add SDK-need resource file: Importresource\YumiMobi_UnityPlugin_Android.unitypackageto the project.

If importing fails, the contents under resource\Android folder can be copied manually to your \Assets\plugins\Android content. During this process, if resource file does not match the current file in the project, please use the resource file we provide. For any query, please contact us at support@yumimobi.com, we will answer you soon. The ad may not be showed properly if no resource file added.

2、Add third-party SDK: if you need to add three party platform, through the 2.1 option to download the corresponding three party platform adapte, and add it to\Assets\plugins\Android

3、The AndroidManifest.xml file is required to copy to your project. If this file has existed already in the project, please add the followings in your current AndroidManifest.xml file:

(1)、Add Permission

Necessary Permission: These permissions will directly affect ad fill rate and impression.

<!-- yumi sdk start -->
<!-- Mandatory-->
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/>
<!-- yumi sdk end -->

Optional Permission: The fill rate will be improved if the following permissions added.

<!-- yumi sdk start -->
<!-- optional -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.CALL_PHONE"/>
<uses-permission android:name="android.permission.SEND_SMS"/>
<uses-permission android:name="android.permission.WRITE_CALENDAR"/> 
<uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" />
<!-- yumi sdk end -->

Permission Access Dynamically

When your app targetSdkVersion is 23 or above, call the following method to permission checks and prompt user authorisation with popup. The method shall be called before instantiated ad, and android-support-v4.jar is required to add.

uad.CheckPermission();

(2)The Component You Should Register in

Assets\plugins\Android\AndroidManifest.xml:

<receiver android:name="com.yumi.android.sdk.ads.self.module.receiver.ADReceiver" >
    <intent-filter>
        <action android:name="android.intent.action.DOWNLOAD_COMPLETE" />
    </intent-filter>
    <intent-filter>
        <action android:name="android.intent.action.PACKAGE_ADDED" />
        <data android:scheme="package" />
    </intent-filter>
</receiver>
<service  android:name="com.yumi.android.sdk.ads.service.YumiAdsEventService" />
<activity  android:name="com.yumi.android.sdk.ads.self.activity.YumiFullScreenActivity"
          android:configChanges="keyboardHidden|orientation|screenSize"
          android:theme="@android:style/Theme.NoTitleBar.Fullscreen" />
<activity android:name="com.yumi.android.sdk.ads.mediation.activity.MediationTestActivity" ></activity>

3.2 Quick Access

3.2.1 Environment configuration

1.If Android.unitypackage has been imported to project already via importing method, you can skip this part to 3.2.1-2 directly.

If you add the resource via the method of manually copying, please continue add UnityDemo\Unity3d\UnityAd\Assets\Yumi\Demo\YumiUnityAdUtils.cs file to Assets folder in Unity project. This category refers to Unity plugin tools of Android Yumi SDK.

This category consists of construction method, call method of banner, interstitial, rewarded video and callback interface announcement.

2. After the above steps, add the following code in C#的Start ():

// your YumiID,You are required to create a Yumi ID on Yumimobi platform. 
private string adID = "a36777775b*******1b3a9de3c166";
// setChannelID . (Recommend),Your current project channel ID.
private string channelStr = "";
// setVersionName . (Recommend),Your current project version ID.
private string versionStr = "";
// Android YumiAd plugin Utils 
private YumiUnityAdUtils uad;
void Start () {
    // Use this for instantiation
    uad = new YumiUnityAdUtils(adID, channelStr, versionStr);
}

3.2.2 Banner Access

1. Necessary Access Method: This method directly affect whether the ad can be exposed properly.

1) Call following to show banner, pass parameter GameObject:

uad.AddBannerAd("YumiAdHelp");

2) Call following to hide banner:

uad.DismissBanner();

3) Call the following method to unhide banner:

uad.ResumeBanner();

2. Optional Access Method: Callback method can help developers get SDK status.

1) Banner callback: Developers shall get SDK status via callback method, and are required to handle it on the basis of this. The impression report will not be affected if you do not access this method.

Inherit Assets.YumiUnityAdUtils.BannerAdCallbackListener interface and realize the following methods:

onBannerPreparedFailed(string data)

callback when banner loading failed, get failure reason via data.

onBannerPrepared(string data)

callback when banner loading success.

onBannerExposure(string data)

callback when banner show success.

onInterstitialClosed(string data)

callback when banner closed.

onBannerClicked(string data)

callback when banner clicked.

Access Sample:

#region Banner Callback
    //callback method when banner loading failed
    public void onBannerPreparedFailed(string data)
    { 
       uad.ShowLog("onBannerPreparedFailed:" + data);
    }
    //callback method when banner loading success
    public void onBannerPrepared(string data)
    { 
       uad.ShowLog("onBannerPrepared:" + data); 
    }
    //callback when banner show success
    public void onBannerExposure(string data)
    { 
       uad.ShowLog("onBannerExposure:" + data); 
    }
    //callback method of banner close event
    public void onBannerClosed(string data)
    { 
       uad.ShowLog("onBannerClosed:" + data); 
    }
    //callback of  banner click event
    public void onBannerClicked(string data)
    { 
       uad.ShowLog("onBannerClicked:" + data);
    } 
#endregion

2) Banner shall be self-responsive to screen width: The parameter status of isMatchWindowWidth can be modified if needed, it is recommended to use default false status to improve ad impression.

  • 非自适应
  • 自适应

When banner ad container is set, Yumi SDK also provides boolean type parameter: isMatchWindowWidth. You are available to modify this boolean type parameter to whether banner width will fill with the full screen. If false, the banner width is container width, if true, the banner width is screen width.

uad.AddBannerAd("YumiAdHelp", isMatchWindowWidth);

3.2.3 Interstitial Access

1. Necessary Access Method: This method directly affect whether the ad can be exposed properly.

1). Call the following method to show interstitial, the passing parameter is GameObject:

uad.InitInterstitialAd("YumiAdHelp");

2) Call the following method to request interstitial:

uad.RequestInterstitial(); 

3) Call the following method to show interstitial:

uad.ShowInterstitialAd();

2. Optional Access Method: Accessing the following method can help developers get SDK status.

1).Interstitial callback: Developers shall get SDK status via callback method, and are required to handle it on the basis of this. The impression report will not be affected if you do not access this method.

Inherit Assets.YumiUnityAdUtils.InterstitialAdCallbackListener interface and realize the following methods:

onInterstitialPreparedFailed(string data)

callback when interstitial loading failed, get failure reason via data.

onInterstitialPrepared(string data)

callback when interstitial loading success

onInterstitialExposure(string data)

callback when interstitial show success.

onInterstitialClosed(string data)

callback when interstitial closed.

onInterstitialClicked(string data)

callback when interstitial clicked.

Access Sample:

#region InterstitialAd Callback
    //callback method when interstitial loading failed
    public void onInterstitialPreparedFailed(string data)
    { 
       uad.ShowLog("onInterstitialPreparedFailed:" + data); 
    }
    //callback method when interstitial loading success
    public void onInterstitialPrepared(string data)
    { 
       uad.ShowLog("onInterstitialPrepared:" + data); 
    }
    //method when interstitial show success 
    public void onInterstitialExposure(string data)
    { 
       uad.ShowLog("onInterstitialExposure:" + data); 
    }
    //callback of interstitial close event
    public void onInterstitialClosed(string data)
    { 
       uad.ShowLog("onInterstitialClosed:" + data); 
    }
    //callback of interstitial click event
    public void onInterstitialClicked(string data)
    { 
       uad.ShowLog("onInterstitialClicked:" + data); 
    } 
#endregion

3.2.4 Rewarded Video Access

1. Necessary Access Method: The following method directly affect whether the ad can be exposed properly.

1) Call the following method to show rewarded video, the passing parameter is GameObject:

uad.InitMedia("YumiAdHelp");

2) Call the following method to request rewarded video:

uad.RequestMedia();

3) Call the following method to ask whether rewarded video has completed loading already:

uad.IsMediaPrepared ();

4) Call the following method to show rewarded video:

uad.ShowMedia();

5) Callback method of rewarded video:

Inherit Assets.YumiUnityAdUtils.MediaAdCallbackListener interface and realize the following methods:

onMediaExposure(string data)

when rewarded video shows successfully.

onMediaClosed(string data)

callback when rewarded video closed.

onMediaClicked(string data)

when rewarded video clicked.Note: This method varies to different platforms, some platforms may not callback.

onMediaIncentived(string data)

callback when rewarded video play completed and available to get bonus.Note: If video play not completed, the callback will not be initiated. And the method shall be always triggered after onMediaClosed ().

onIsMediaPrepared(string data)

callback method of rewarded video loading completed, true refers to that it has completed already. (The method shall be available only after calling uad.IsMediaPrepared().

Access Sample:

#region MediaAd Callback
	// bonus callback method of rewarded video 
    public void onMediaIncentived(string data)
    { 
       uad.ShowLog("onMediaIncentived:" + data);
    }
    // callback method of rewarded video show completed
    public void onMediaExposure(string data)
    { 
       uad.ShowLog("onMediaExposure:" + data);
    }
    // callback method of rewarded video close event
    public void onMediaClosed(string data)
    { 
       uad.ShowLog("onMediaClosed:" + data);
    }
    // callback method of rewarded video click event
    public void onMediaClicked (string data)
    { 
       uad.ShowLog("onMediaClicked:" + data);
    }
    // callback method of rewarded video loading completed, true refers to that it has completed already. (The method shall be available only after calling uad.IsMediaPrepared()
    public void onIsMediaPrepared (string data)
    { 
       uad.ShowLog("onIsMediaPrepared:" + data);
    } 
#endregion

3.3 The APP Is for GooglePlay released

Note :Setting The APP Is for GooglePlay released

uad.SetAppIsGooglePlayVersions();

3.4 Log and Toast

The Android Log output method provided for unity plugin is as follows, developers shall determine whether to use it. It will be more convenient to look up problems with this method:

//output log from console
uad.ShowLog("********");
//prompt popup on screen
uad. ShowToast("********");

3.5 Debug Mode

Developers are available to detect the third-party platform integration status via Yumimobi SDK debug mode:

The following method shall be called to initiate debugging mode.

uad.StartDebugging();

Operation Steps:

1.Call the method to open debugging page

uad.StartDebugging();

2.The configuration will be get by Yumi SDK and the third-party platform list will be shown, enter debug page:

1)when the page showsSearching for third party ADnetwork adapters: which refers to no configuration, please check configuration of different ad forms for the application. If no response, please contact us at support@yumimobi.com.

2)After configuration, the platforms will be shown properly. All platforms on the left side display in red when you first enter this page. The corresponding left-side place would turn green once a platform integrated and showed successfully.

3.The platform can be clicked to enter regardless of the colour of left status bar.

11) When SDK Available is green, it refers to the third-party platform adapter has been added; when in red, it means the third-party platform adapter has not been added, which should go back 3.1-2 to check whether the platform adapter has been added.

2) When Configuration present is green, it means the third-party platform adapter Manifest has been registered; when in red, it refers to the third-party platform adapter Manifest has not been added, which should go back 3.1-3 to check whether the platform adapter component has been added.

3) When SDK Failed to start or No_fill is green, it means the ad has been shown successfully; when in red, it refers to the ad has not been shown successfully, which you can continue next step. If it remains red after all steps operated, please contact us at support@yumimobi.com.

4. Click Fetch to request ad, click Show to show ad.

5. When ad shows property, all elements will turn green, which indicates this platform has been integrated successfully.

6. The debugging mode shall be annotated before releasing application.

4. Obfuscation

If obfuscated compilation is required in your project, please add the followings in obfuscation file.

-keepattributes Exceptions,InnerClasses,Signature,Deprecated,SourceFile,LineNumberTable,*Annotation*,Synthetic,EnclosingMethod
-keep class com.yumi.android.sdk.ads.** { *;}
-keep class com.yumi.android.sdk.ads.self.**{*;}
-keep class com.yumi.android.sdk.ads.selfmedia.**{*;}

5. Compilation

1. Click File, choose Build&Run to compile.

2. The screen orientation in Unity3D shall conform to the settings of AndroidManifest.xml in Android project, or screen rotation may lead to crash after starting application. (see the following image)

Click【Build And Run】and wait progress bar