Skip to content

Instantly share code, notes, and snippets.

@revmob-sdk
Created November 1, 2012 13:43
Show Gist options
  • Save revmob-sdk/3993698 to your computer and use it in GitHub Desktop.
Save revmob-sdk/3993698 to your computer and use it in GitHub Desktop.
RevMob Titanium
revmob.addEventListener('adDidReceived', function(e) {
Titanium.API.log('> Ad did received.');
});
revmob.addEventListener('adDidFail', function(e) {
Titanium.API.log('> Ad did Fail.');
});
revmob.addEventListener('userClickedInTheAd', function(e) {
Titanium.API.log('> click!');
});
revmob.addEventListener('userClosedTheAd', function(e) {
Titanium.API.log('> close!');
});
function RevMob(appIds) {
var moduleNames = { 'iPhone OS': 'com.revmob.titanium', 'android': 'com.revmob.ti.android' }
var revmobModule = require(moduleNames[Ti.Platform.name]);
revmobModule.startSession(appIds[Ti.Platform.name]);
return revmobModule;
}
// Just replace the ID below with your appID.
var revmob = new RevMob({ 'iPhone OS': '4fd619388d314b0008000213', 'android': '4f56aa6e3dc441000e005a20' });
revmob.showFullscreen();
revmob.setTestingMode(revmob.testingMode.withAds);
revmob.setTestingMode(revmob.testingMode.withoutAds);
<modules>
<module platform="iphone" version="0.1.1">com.revmob.titanium</module>
<module platform="android" version="0.1.1">com.revmob.ti.android</module>
</modules>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment