mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-04-01 20:32:55 +08:00
docs(admob): improve example (#1454)
This commit is contained in:
parent
92468c9b84
commit
14a1cb9ee7
@ -96,8 +96,9 @@ export interface AdExtras {
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { AdMob } from '@ionic-native/admob';
|
||||
* import { Platform } from 'ionic-angular';
|
||||
*
|
||||
* constructor(private admob: AdMob) { }
|
||||
* constructor(private admob: AdMob, private platform: Platform ) { }
|
||||
*
|
||||
* ionViewDidLoad() {
|
||||
* this.admob.onAdDismiss()
|
||||
@ -105,7 +106,13 @@ export interface AdExtras {
|
||||
* }
|
||||
*
|
||||
* onClick() {
|
||||
* this.admob.prepareInterstitial('YOUR_ADID')
|
||||
* let adId;
|
||||
* if(this.platform.is('android') {
|
||||
* adId = 'YOUR_ADID_ANDROID';
|
||||
* } else if (this.platform.is('ios')) {
|
||||
* adId = 'YOUR_ADID_IOS';
|
||||
* }
|
||||
* this.admob.prepareInterstitial(adId)
|
||||
* .then(() => { this.admob.showInterstitial(); });
|
||||
* }
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user