Configuration
Test only in devices after build in APK format . The ads will not be shown in Unity editor.
You can integrate SDK using C# . Import SDK package as Custom Package like this :
Manifest file
Change the package name of the manifest file to your package file located in: Assets/Plugins/Android/AndroidManifest.xml
<manifest xmlns:android=”http://schemas.android.com/apk/res/android” package=”com.yourcompany.yourapp” …>
That’s all you have to do with the manifest file.
Start Session
To start using this SDK, you need to implement IEventDelegate interface and give definition to the abstract method of that interface. There are five methods you need to give definition of : void
1 2 3 4 5 6 7 8 9 |
viewDidDisappear (string success); void viewDidAppear (string success); void viewConnectFail(string s); void onOfferComplete(string points); void conversion(string success); |
then start your session by instantiating the instance .
A good place to start it is in the Awake() method of your Script: All you need to do to start your session is call this Static Method of SDKManager Class : SDKManager.Init(“Your Publisher ID”, “Name of the GameObject which contains your script”); If you want to enable notification just call static method : SDKManager. SetNotificationEnable(bool isEnable) immediately after SDKManager.Init(). Example :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
using System; using System.Collections; using UnityEngine; public class YourScript : MonoBehaviour, IEventDelegate { void Awake() { SDKManager.Init(“Your Publisher ID”, this.gameObject.name); SDKManager. SetNotificationEnable(true); } //overridden methods of interface public void viewDidDisappear (string success) { //you dont need to do anything with success string parameter. SampleScript.eventMessage = "viewDidDisappear"; } public void viewDidAppear (string success) { //you dont need to do anything with success string parameter. Debug.Log(“your message”); } public void viewConnectFail(string s) { Debug.Log(s); } public void onOfferComplete(string points) { Debug.Log(“onOfferComplete : " + points); } public void conversion(string success) { //you dont need to do anything with success string parameter. Debug.Log(“your message"); } } |
All StaticMethods
This is all the the methods of the functionalities you want from this SDK. SDKManager. SetNotificationEnable(bool isEnable);
1 2 3 4 5 6 7 8 9 10 11 12 13 |
SDKManager. SetProperties(string headerBackground, string bodyBackground, string splashBackground); SDKManager. EndGameWithViewControllerAndAppID(); SDKManager. showMoreGamesWithViewControllerAndAppID(); SDKManager .showMoreGamesWithViewControllerAndAppID(string headerTitle); SDKManager .showMoreGamesWithViewControllerAndAppID(string splashTitle, string headerTitle); SDKManager. showMoreGamesWithViewControllerAndAppID(string splashTitle, string headerTitle, bool interstitial); SDKManager. InterstitialWithViewControllerAndAppID(); SDKManager. InterstitialWithViewControllerAndAppID(string splashTitle, string headerTitle); SDKManager. showOffersWall(); SDKManager. showOffersWall(string moneyNumber, float scoreScale); SDKManager.showGameBySlug(string gameSlug); |