Skip to content

Commit acf3904

Browse files
committed
fix(admob): include error for failed event
1 parent 595710b commit acf3904

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/firebase-admob/nativead/index.android.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { AddChildFromBuilder, Application, CSSType, ImageSource, View } from '@nativescript/core';
2+
import { FirebaseError } from '@nativescript/firebase-core';
23
import { AdEventListener, AdEventType, ManagerRequestOptions, RequestOptions } from '../common';
34
import { IMediaContent, IMuteThisAdReason, INativeAd, INativeAdImage, IVideoController, MediaViewBase, NativeAdOptions, UnconfirmedClickListener, VideoStatus, AdChoicesPlacement, MediaAspectRatio, INativeAdLoader, NativeAdEventListener, NativeAdEventType, stretchProperty, NativeAdViewBase, mediaContentProperty } from './common';
45

@@ -26,7 +27,7 @@ export class NativeAdView extends NativeAdViewBase implements AddChildFromBuilde
2627
callback(this.#child);
2728
}
2829

29-
onLoaded(){
30+
onLoaded() {
3031
super.onLoaded();
3132
if (this.#child && (<any>this.#native).indexOfChild(this.#child.nativeView) === -1) {
3233
(<any>this.#native).addView(this.#child.nativeView);
@@ -175,6 +176,7 @@ export class NativeAdLoader implements INativeAdLoader {
175176
load(): void;
176177
load(arg?: any): void {
177178
const ref = new WeakRef(this);
179+
console.log(this.#nativeAdOptions, this.#adUnitId);
178180
this.#native = org.nativescript.firebase.admob.FirebaseAdmob.NativeAd.createLoader(
179181
Application.android.foregroundActivity || Application.android.startActivity,
180182
this.#adUnitId,
@@ -191,7 +193,7 @@ export class NativeAdLoader implements INativeAdLoader {
191193
nativeAd?._listener?.(AdEventType.CLOSED, null, null);
192194
break;
193195
case AdEventType.FAILED_TO_LOAD_EVENT:
194-
owner?._listener?.(AdEventType.FAILED_TO_LOAD_EVENT, null, null);
196+
owner?._listener?.(AdEventType.FAILED_TO_LOAD_EVENT, FirebaseError.fromNative(param1), null);
195197
break;
196198
case AdEventType.IMPRESSION:
197199
nativeAd?._listener?.(AdEventType.IMPRESSION, null, null);

0 commit comments

Comments
 (0)