I have difficulties integrating Applovin sdk in unity(for android for now).
they have instructions here:
but the sdk does not contain a sample scene.
I currenlty have a main camera with a script attached:
using UnityEngine;
using System.Collections;
public class applovindemo_by_me : MonoBehaviour {
// Use this for initialization
void Start () {
AppLovin.InitializeSdk ();
AppLovin.PreloadInterstitial();
}
// Update is called once per frame
void Update () {
//if (Input.GetMouseButtonDown (0)) {
//AppLovin.PreloadInterstitial();
//AppLovin.ShowInterstitial();
AppLovin.ShowAd();
//}
}
}
Use AppLovin.ShowInterstitial(); to show the interstitial. And Use it in a regular public method instead of the Update method. You don’t want to call the AppLovin.ShowInterstitial(); every second.
As soon as you run the game, add this Code:
void Awake() {
AppLovin.SetSdkKey("your sdks key here, find it in applovin dashboar");
AppLovin.InitializeSdk ();
AppLovin.PreloadInterstitial();
}
Then whenever you decide to show the ads, call this method:
public void ShowAD()
{
AppLovin.ShowInterstitial ();
}