-
Notifications
You must be signed in to change notification settings - Fork 338
06. How To Use with Meteor
Raymond Xie edited this page Sep 30, 2015
·
7 revisions
- Cordova,
[sudo] npm install -g cordova
- Meteor,
[sudo] npm install -g meteor
Add plugin: meteor add cordova:[email protected]
Replace x.x.x with current version number, see the version here: https://www.npmjs.com/package/cordova-plugin-admobpro
Run the simluator (iOS): meteor run ios
or (Android), meteor run android
Also, make sure that your code is in Meteor.startup(), to ensure that the Cordova plugin is available.
eteor.startup(function () {
if (Meteor.isCordova) {
if (AdMob) {
AdMob.createBanner( {
adId: 'ca-app-pub-xxx/xxx',
position: AdMob.AD_POSITION.BOTTOM_CENTER,
isTesting: true,
autoShow: true,
success: function() {
console.log("Received ad");
},
error: function() {
console.log("No ad received");
}
});
} else {
console.log("No Admob");
}
} else {
console.log("No Cordova ");
}
}