Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(plugin): add admob pro plugin #147

Merged
merged 1 commit into from
Apr 29, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const DEVICE_READY_TIMEOUT = 2000;
declare var window;

import {ActionSheet} from './plugins/actionsheet';
import {AdMob} from './plugins/admob';
import {AppAvailability} from './plugins/appavailability';
import {AppRate} from './plugins/apprate';
import {AppVersion} from './plugins/appversion';
Expand Down Expand Up @@ -54,6 +55,7 @@ import {WebIntent} from './plugins/webintent';

export {
ActionSheet,
AdMob,
AppAvailability,
AppRate,
AppVersion,
Expand Down Expand Up @@ -107,6 +109,7 @@ export * from './plugins/plugin';
// Window export to use outside of a module loading system
window['IonicNative'] = {
ActionSheet: ActionSheet,
AdMob: AdMob,
AppAvailability: AppAvailability,
AppRate: AppRate,
AppVersion: AppVersion,
Expand Down
177 changes: 177 additions & 0 deletions src/plugins/admob.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
import {Plugin, Cordova} from './plugin';
import {Observable} from "rxjs/Observable";

/**
* @name AdMob
* @description
* @usage
*/
@Plugin({
plugin: 'cordova-plugin-admobpro',
pluginRef: 'AdMob',
repo: 'https://github.com/floatinghotspot/cordova-admob-pro'
})
export class AdMob {

// Static Methods

/**
*
* @param adIdOrOptions
*/
@Cordova()
static createBanner(adIdOrOptions : any) : Promise<any> {return}

/**
*
*/
@Cordova({
sync: true
})
static removeBanner() : void {}

/**
*
* @param position
*/
@Cordova({
sync: true
})
static showBanner(position : any) : void {}

/**
*
* @param x
* @param y
*/
@Cordova({
sync: true
})
static showBannerAtXY(x : number, y : number) : void {}

/**
*
*/
@Cordova({
sync: true
})
static hideBanner() : void {}

/**
*
* @param adIdOrOptions
*/
@Cordova()
static prepareInterstitial(adIdOrOptions : any) : Promise<any> {return}

/**
* Show interstitial
*/
@Cordova({
sync: true
})
static showInterstitial() : void {}

/**
*
*/
@Cordova()
static isInterstitialReady () : Promise<boolean> {return}

/**
* Prepare a reward video ad
* @param adIdOrOptions
*/
@Cordova()
static prepareRewardVideoAd(adIdOrOptions : any) : Promise<any> {return}

/**
* Show a reward video ad
*/
@Cordova({
sync : true
})
static showRewardVideoAd() : void {}

/**
* Sets the values for configuration and targeting
* @param options Returns a promise that resolves if the options are set successfully
*/
@Cordova()
static setOptions(options:any) : Promise<any> {return}

/**
* Get user ad settings
* @returns {Promise<any>} Returns a promise that resolves with the ad settings
*/
@Cordova()
static getAdSettings() : Promise<any> {return}

// Events

@Cordova({
eventObservable: true,
event: 'onBannerFailedToReceive'
})
static onBannerFailedToReceive () : Observable<any> {return}

@Cordova({
eventObservable: true,
event: 'onBannerReceive'
})
static onBannerReceive () : Observable<any> {return}

@Cordova({
eventObservable: true,
event: 'onBannerPresent'
})
static onBannerPresent () : Observable<any> {return}

@Cordova({
eventObservable: true,
event: 'onBannerLeaveApp'
})
static onBannerLeaveApp () : Observable<any> {return}

@Cordova({
eventObservable: true,
event: 'onBannerDismiss'
})
static onBannerDismiss () : Observable<any> {return}


@Cordova({
eventObservable: true,
event: 'onInterstitialFailedToReceive'
})
static onInterstitialFailedToReceive () : Observable<any> {return}


@Cordova({
eventObservable: true,
event: 'onInterstitialReceive'
})
static onInterstitialReceive () : Observable<any> {return}


@Cordova({
eventObservable: true,
event: 'onInterstitialPresent'
})
static onInterstitialPresent () : Observable<any> {return}


@Cordova({
eventObservable: true,
event: 'onInterstitialLeaveApp'
})
static onInterstitialLeaveApp () : Observable<any> {return}


@Cordova({
eventObservable: true,
event: 'onInterstitialDismiss'
})
static onInterstitialDismiss () : Observable<any> {return}

}