1
1
import { AddChildFromBuilder , Application , CSSType , ImageSource , View } from '@nativescript/core' ;
2
+ import { FirebaseError } from '@nativescript/firebase-core' ;
2
3
import { AdEventListener , AdEventType , ManagerRequestOptions , RequestOptions } from '../common' ;
3
4
import { IMediaContent , IMuteThisAdReason , INativeAd , INativeAdImage , IVideoController , MediaViewBase , NativeAdOptions , UnconfirmedClickListener , VideoStatus , AdChoicesPlacement , MediaAspectRatio , INativeAdLoader , NativeAdEventListener , NativeAdEventType , stretchProperty , NativeAdViewBase , mediaContentProperty } from './common' ;
4
5
@@ -26,7 +27,7 @@ export class NativeAdView extends NativeAdViewBase implements AddChildFromBuilde
26
27
callback ( this . #child) ;
27
28
}
28
29
29
- onLoaded ( ) {
30
+ onLoaded ( ) {
30
31
super . onLoaded ( ) ;
31
32
if ( this . #child && ( < any > this . #native) . indexOfChild ( this . #child. nativeView ) === - 1 ) {
32
33
( < any > this . #native) . addView ( this . #child. nativeView ) ;
@@ -175,6 +176,7 @@ export class NativeAdLoader implements INativeAdLoader {
175
176
load ( ) : void ;
176
177
load ( arg ?: any ) : void {
177
178
const ref = new WeakRef ( this ) ;
179
+ console . log ( this . #nativeAdOptions, this . #adUnitId) ;
178
180
this . #native = org . nativescript . firebase . admob . FirebaseAdmob . NativeAd . createLoader (
179
181
Application . android . foregroundActivity || Application . android . startActivity ,
180
182
this . #adUnitId,
@@ -191,7 +193,7 @@ export class NativeAdLoader implements INativeAdLoader {
191
193
nativeAd ?. _listener ?.( AdEventType . CLOSED , null , null ) ;
192
194
break ;
193
195
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 ) ;
195
197
break ;
196
198
case AdEventType . IMPRESSION :
197
199
nativeAd ?. _listener ?.( AdEventType . IMPRESSION , null , null ) ;
0 commit comments