I imported the package.
Then I re-wrote the xml file.
Then I attached this script to the main camera.
import System.Collections.Generic;
private var APP_IDS = new Dictionary.<String, String>();
APP_IDS["Android"] = "52db16f3e9e63d7009000004";
APP_IDS["IOS"] = "copy your iOS RevMob App ID here";
private var revmob:RevMob;
function Awake() {
revmob = RevMob.Start(APP_IDS, gameObject.name);
}
function Start(){
revmob.ShowFullscreen();
}
And it isn’t working… I get a NullReference error in the start function.
why?
I had this problem. Solved it by creating an empty gameobject and attaching this code (below) to it:
private var APP_IDS = new Dictionary.<String, String>();
private var revmob : RevMob;
function Awake() {
APP_IDS["Android"] = "LÖL";
APP_IDS["IOS"] = "QWERTYUIOP";
revmob = RevMob.Start(APP_IDS, this.gameObject.name);
}
function Start () {
revmob.ShowFullscreen();
}
The NullReferenceException doesn’t matter. Build onto the device and make sure the minimum click bid isnt too high - Learnt the hard way!
Make sure You are connected to the device ! You also get Logs about device not connected in Console.
I had the same problem.
For some reason I couldn’t call revmob.ShowFullscreen()
in the Start()
method.
Try doing that on Update()
or any other custom method after the Start has already finished.
It must have something to do with how Activities are loaded on the background.