- Home /
Leadbolt ads integration
Hi, How to integrate Leadbolt ads into Unity project? I have downloaded Leadbolt SDK and placed pubxapp.jar and pubxappCom.jar into Plugins/Android.
This is my LeadboltIntegration.cs file:
using UnityEngine;
using System.Collections;
using System.Runtime.InteropServices;
using System;
public class LeadboltIntegration : MonoBehaviour
{
public string id;
static AndroidJavaObject adController;
void Start ()
{
Invoke ("Initialize",3);
Invoke ("LoadAd",5);
}
void Initialize ()
{
using(AndroidJavaClass unityPlayer = new AndroidJavaClass ("com.unity3d.player.UnityPlayer"))
{
using(AndroidJavaObject activity = unityPlayer.GetStatic<AndroidJavaObject> ("currentActivity"))
{
adController = new AndroidJavaObject ("com.pad.android.iappad.AdController", activity, id);
}
}
}
void LoadAd()
{
adController.Call ("setAsynchTask", true);
adController.Call ("loadAd");
}
public void OnApplicationQuit()
{
adController.Call ("destroyAd");
}
}
But application is crashing upon load.
Answer by PeteS · Mar 31, 2013 at 07:24 PM
Log in to Leadbolt and look up unity3d they have a sample scene with code available for unity3d. Its a unity package with all the required files to run. So far it worked for me but the sample ads take a few sec to pop up.
Hi!
I am trying to add lead bolt adds in unity and I successfully add it into unity but there is an issue that 1- adds are not clickable 2- and nor closing when i click on cross button
I have checked this in android and in android I am facing no issue that I have stated above, but just in unity......
can u help Here is Code
using UnityEngine;
using System.Collections;
public class $$anonymous$$BoltAdd : $$anonymous$$onoBehaviour {
// Use this for initialization
void Start () {
AndroidJavaClass jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
AndroidJavaObject jo = jc.GetStatic<AndroidJavaObject>("currentActivity");
using(AndroidJavaObject ad = new AndroidJavaObject("com.unity.wrapper.$$anonymous$$BoltUnity", jo)){
ad.Call("loadAd","837124071");
}
}
// Update is called once per frame
void Update () {
}
}
Your answer

Follow this Question
Related Questions
Admob Mediation with Chartboost Ad network setup 1 Answer
App crash on launch. 1 Answer
How can i make a Google Mobile Adsense in my Unity game ?? 1 Answer
Admob test ads not showing up? and the codes are perfect? 1 Answer
Unity Mediation Plug-In breaks the game with infinite Resolving Android Dependencies 0 Answers