Skip to content

Commit

Permalink
refactor(demo): import interface and PluginListenerHandle
Browse files Browse the repository at this point in the history
  • Loading branch information
rdlabo committed Oct 5, 2020
1 parent 1683bfd commit 0ca0d0d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions demo/angular/src/app/home/home.page.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Component, OnInit, OnDestroy } from '@angular/core';
import { Plugins } from '@capacitor/core';
import {PluginListenerHandle, Plugins} from '@capacitor/core';
import { ToastController } from '@ionic/angular';

import { AdOptions, AdSize, AdPosition } from '@capacitor-community/admob';
import { AdOptions, AdSize, AdPosition, AdMobRewardItem } from '@capacitor-community/admob';
const { AdMob } = Plugins;

@Component({
Expand Down Expand Up @@ -50,12 +50,9 @@ export class HomePage implements OnInit, OnDestroy {
/**
* for EventListener
*/
private eventOnAdSize;
private eventPrepareReward;
private eventRewardReceived: {
type: string;
amount: number;
};
private eventOnAdSize: PluginListenerHandle;
private eventPrepareReward: PluginListenerHandle
private eventRewardReceived: AdMobRewardItem;

public isLoading = false;

Expand Down Expand Up @@ -85,6 +82,9 @@ export class HomePage implements OnInit, OnDestroy {
this.isLoading = false;
});

/**
* RewardedVideo ad
*/
AdMob.addListener('onRewarded', (info) => {
this.eventRewardReceived = info;
});
Expand Down

0 comments on commit 0ca0d0d

Please sign in to comment.