diff --git a/README.md b/README.md
index 18198567..d3d3c572 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,3 @@
-- [@nativescript/firebase-admob](packages/firebase-admob/README.md)
- [@nativescript/firebase-analytics](packages/firebase-analytics/README.md)
- [@nativescript/firebase-app-check](packages/firebase-app-check/README.md)
- [@nativescript/firebase-app-check-debug](packages/firebase-app-check-debug/README.md)
diff --git a/apps/demo-angular/package.json b/apps/demo-angular/package.json
index 7b018474..4d885186 100644
--- a/apps/demo-angular/package.json
+++ b/apps/demo-angular/package.json
@@ -7,7 +7,6 @@
"@nativescript/firebase-database": "file:../../dist/packages/firebase-database",
"@nativescript/firebase-firestore": "file:../../dist/packages/firebase-firestore",
"@nativescript/firebase-analytics": "file:../../dist/packages/firebase-analytics",
- "@nativescript/firebase-admob": "file:../../dist/packages/firebase-admob",
"@nativescript/firebase-crashlytics": "file:../../dist/packages/firebase-crashlytics",
"@nativescript/firebase-app-check": "file:../../dist/packages/firebase-app-check",
"@nativescript/firebase-remote-config": "file:../../dist/packages/firebase-remote-config",
diff --git a/apps/demo-angular/project.json b/apps/demo-angular/project.json
index 2e7235ab..2fddcebb 100644
--- a/apps/demo-angular/project.json
+++ b/apps/demo-angular/project.json
@@ -12,33 +12,8 @@
"production": true,
"uglify": true,
"release": true,
- "forDevice": true
- },
- "dependsOn": [
- {
- "target": "build.all",
- "dependencies": true
- }
- ]
- },
- "ios": {
- "executor": "@nativescript/nx:build",
- "options": {
- "platform": "ios",
- "noHmr": true
- },
- "dependsOn": [
- {
- "target": "build.all",
- "dependencies": true
- }
- ]
- },
- "android": {
- "executor": "@nativescript/nx:build",
- "options": {
- "platform": "android",
- "noHmr": true
+ "forDevice": true,
+ "tsConfig": "apps/demo-angular/tsconfig.json"
},
"dependsOn": [
{
@@ -48,13 +23,21 @@
]
},
"clean": {
- "executor": "@nativescript/nx:build",
- "options": {
- "clean": true
- }
+ "executor": "@nativescript/nx:clean",
+ "options": {}
},
"lint": {
"executor": "@nx/eslint:lint"
+ },
+ "debug": {
+ "executor": "@nativescript/nx:debug",
+ "options": {
+ "noHmr": true,
+ "uglify": false,
+ "release": false,
+ "forDevice": false,
+ "prepare": false
+ }
}
}
}
diff --git a/apps/demo-angular/src/app-routing.module.ts b/apps/demo-angular/src/app-routing.module.ts
index c440a096..131105c9 100644
--- a/apps/demo-angular/src/app-routing.module.ts
+++ b/apps/demo-angular/src/app-routing.module.ts
@@ -7,7 +7,6 @@ import { HomeComponent } from './home.component';
const routes: Routes = [
{ path: '', redirectTo: '/home', pathMatch: 'full' },
{ path: 'home', component: HomeComponent },
- { path: 'firebase-admob', loadChildren: () => import('./plugin-demos/firebase-admob.module').then((m) => m.FirebaseAdmobModule) },
{ path: 'firebase-analytics', loadChildren: () => import('./plugin-demos/firebase-analytics.module').then((m) => m.FirebaseAnalyticsModule) },
{ path: 'firebase-app-check', loadChildren: () => import('./plugin-demos/firebase-app-check.module').then((m) => m.FirebaseAppCheckModule) },
{ path: 'firebase-app-check-debug', loadChildren: () => import('./plugin-demos/firebase-app-check-debug.module').then((m) => m.FirebaseAppCheckDebugModule) },
diff --git a/apps/demo-angular/src/home.component.ts b/apps/demo-angular/src/home.component.ts
index d862ba7c..ba58d650 100644
--- a/apps/demo-angular/src/home.component.ts
+++ b/apps/demo-angular/src/home.component.ts
@@ -6,9 +6,6 @@ import { Component } from '@angular/core';
})
export class HomeComponent {
demos = [
- {
- name: 'firebase-admob',
- },
{
name: 'firebase-analytics',
},
diff --git a/apps/demo-angular/src/plugin-demos/firebase-admob.component.html b/apps/demo-angular/src/plugin-demos/firebase-admob.component.html
deleted file mode 100644
index 18562dcd..00000000
--- a/apps/demo-angular/src/plugin-demos/firebase-admob.component.html
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/apps/demo-angular/src/plugin-demos/firebase-admob.component.ts b/apps/demo-angular/src/plugin-demos/firebase-admob.component.ts
deleted file mode 100644
index db70f670..00000000
--- a/apps/demo-angular/src/plugin-demos/firebase-admob.component.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import { Component, NgZone } from '@angular/core';
-import { DemoSharedFirebaseAdmob } from '@demo/shared';
-import { } from '@nativescript/firebase-admob';
-
-@Component({
- selector: 'demo-firebase-admob',
- templateUrl: 'firebase-admob.component.html',
-})
-export class FirebaseAdmobComponent {
-
- demoShared: DemoSharedFirebaseAdmob;
-
- constructor(private _ngZone: NgZone) {}
-
- ngOnInit() {
- this.demoShared = new DemoSharedFirebaseAdmob();
- }
-
-}
\ No newline at end of file
diff --git a/apps/demo-angular/src/plugin-demos/firebase-admob.module.ts b/apps/demo-angular/src/plugin-demos/firebase-admob.module.ts
deleted file mode 100644
index c1add9b9..00000000
--- a/apps/demo-angular/src/plugin-demos/firebase-admob.module.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';
-import { NativeScriptCommonModule, NativeScriptRouterModule } from '@nativescript/angular';
-import { FirebaseAdmobComponent } from './firebase-admob.component';
-
-@NgModule({
- imports: [NativeScriptCommonModule, NativeScriptRouterModule.forChild([{ path: '', component: FirebaseAdmobComponent }])],
- declarations: [FirebaseAdmobComponent],
- schemas: [ NO_ERRORS_SCHEMA]
-})
-export class FirebaseAdmobModule {}
diff --git a/apps/demo-angular/tsconfig.json b/apps/demo-angular/tsconfig.json
index c55bd108..6bcd3a50 100644
--- a/apps/demo-angular/tsconfig.json
+++ b/apps/demo-angular/tsconfig.json
@@ -9,8 +9,6 @@
"@nativescript/firebase-database": ["packages/firebase-database/index.d.ts"],
"@nativescript/firebase-firestore": ["packages/firebase-firestore/index.d.ts"],
"@nativescript/firebase-analytics": ["packages/firebase-analytics/index.d.ts"],
- "@nativescript/firebase-admob": ["packages/firebase-admob/index.d.ts"],
- "@nativescript/firebase-admob/angular": ["packages/firebase-admob/angular/index.ts"],
"@nativescript/firebase-crashlytics": ["packages/firebase-crashlytics/index.d.ts"],
"@nativescript/firebase-app-check": ["packages/firebase-app-check/index.d.ts"],
"@nativescript/firebase-remote-config": ["packages/firebase-remote-config/index.d.ts"],
diff --git a/apps/demo-vue/app/app.ts b/apps/demo-vue/app/app.ts
index 5a4e594c..6371f772 100644
--- a/apps/demo-vue/app/app.ts
+++ b/apps/demo-vue/app/app.ts
@@ -21,8 +21,6 @@ import '@nativescript/firebase-performance';
import '@nativescript/firebase-remote-config';
import '@nativescript/firebase-storage';
-import { Admob } from '@nativescript/firebase-admob';
-
import { AppCheck } from '@nativescript/firebase-app-check-debug';
import { Application } from '@nativescript/core';
@@ -35,8 +33,6 @@ firebase()
firebase().crashlytics().setCrashlyticsCollectionEnabled(true);
});
-Admob.init();
-
const dynamicLinks = firebase().dynamicLinks();
dynamicLinks.onLink((link) => {
diff --git a/apps/demo-vue/app/components/Home.vue b/apps/demo-vue/app/components/Home.vue
index 4d68dea1..772d30bb 100644
--- a/apps/demo-vue/app/components/Home.vue
+++ b/apps/demo-vue/app/components/Home.vue
@@ -18,7 +18,6 @@
-
-
diff --git a/apps/demo-vue/package.json b/apps/demo-vue/package.json
index c4208bba..75f8005f 100644
--- a/apps/demo-vue/package.json
+++ b/apps/demo-vue/package.json
@@ -3,7 +3,6 @@
"description": "NativeScript Application",
"dependencies": {
"@nativescript/core": "file:../../node_modules/@nativescript/core",
- "@nativescript/firebase-admob": "file:../../packages/firebase-admob",
"@nativescript/firebase-analytics": "file:../../dist/packages/firebase-analytics",
"@nativescript/firebase-app-check": "file:../../packages/firebase-app-check",
"@nativescript/firebase-auth": "file:../../packages/firebase-auth",
diff --git a/apps/demo-vue/project.json b/apps/demo-vue/project.json
index b39ca6a6..e3fcf6a5 100644
--- a/apps/demo-vue/project.json
+++ b/apps/demo-vue/project.json
@@ -11,33 +11,8 @@
"production": true,
"uglify": true,
"release": true,
- "forDevice": true
- },
- "dependsOn": [
- {
- "target": "build.all",
- "dependencies": true
- }
- ]
- },
- "ios": {
- "executor": "@nativescript/nx:build",
- "options": {
- "platform": "ios",
- "noHmr": true
- },
- "dependsOn": [
- {
- "target": "build.all",
- "dependencies": true
- }
- ]
- },
- "android": {
- "executor": "@nativescript/nx:build",
- "options": {
- "platform": "android",
- "noHmr": true
+ "forDevice": true,
+ "tsConfig": "apps/demo-vue/tsconfig.json"
},
"dependsOn": [
{
@@ -47,13 +22,21 @@
]
},
"clean": {
- "executor": "@nativescript/nx:build",
- "options": {
- "clean": true
- }
+ "executor": "@nativescript/nx:clean",
+ "options": {}
},
"lint": {
"executor": "@nx/eslint:lint"
+ },
+ "debug": {
+ "executor": "@nativescript/nx:debug",
+ "options": {
+ "noHmr": true,
+ "uglify": false,
+ "release": false,
+ "forDevice": false,
+ "prepare": false
+ }
}
}
}
diff --git a/apps/demo-vue/tsconfig.json b/apps/demo-vue/tsconfig.json
index 5fffcfaf..e02a8e7a 100644
--- a/apps/demo-vue/tsconfig.json
+++ b/apps/demo-vue/tsconfig.json
@@ -11,8 +11,6 @@
"@nativescript/firebase-database": ["../../packages/firebase-database/index.d.ts"],
"@nativescript/firebase-firestore": ["../../packages/firebase-firestore/index.d.ts"],
"@nativescript/firebase-analytics": ["../../packages/firebase-analytics/index.d.ts"],
- "@nativescript/firebase-admob": ["../../packages/firebase-admob/index.d.ts"],
- "@nativescript/firebase-admob/angular": ["../../packages/firebase-admob/angular/index.ts"],
"@nativescript/firebase-crashlytics": ["../../packages/firebase-crashlytics/index.d.ts"],
"@nativescript/firebase-app-check": ["../../packages/firebase-app-check/index.d.ts"],
"@nativescript/firebase-remote-config": ["../../packages/firebase-remote-config/index.d.ts"],
diff --git a/apps/demo/package.json b/apps/demo/package.json
index 961c6101..8c2e8dad 100644
--- a/apps/demo/package.json
+++ b/apps/demo/package.json
@@ -5,9 +5,9 @@
"repository": "",
"dependencies": {
"@nativescript/core": "file:../../node_modules/@nativescript/core",
- "@nativescript/firebase-admob": "file:../../packages/firebase-admob",
"@nativescript/firebase-analytics": "file:../../dist/packages/firebase-analytics",
"@nativescript/firebase-app-check": "file:../../packages/firebase-app-check",
+ "@nativescript/firebase-app-check-debug": "file:../../packages/firebase-app-check-debug",
"@nativescript/firebase-auth": "file:../../packages/firebase-auth",
"@nativescript/firebase-core": "file:../../packages/firebase-core",
"@nativescript/firebase-crashlytics": "file:../../packages/firebase-crashlytics",
@@ -18,13 +18,12 @@
"@nativescript/firebase-in-app-messaging": "file:../../packages/firebase-in-app-messaging",
"@nativescript/firebase-installations": "file:../../packages/firebase-installations",
"@nativescript/firebase-messaging": "file:../../packages/firebase-messaging",
+ "@nativescript/firebase-messaging-core": "file:../../packages/firebase-messaging-core",
"@nativescript/firebase-performance": "file:../../packages/firebase-performance",
"@nativescript/firebase-remote-config": "file:../../packages/firebase-remote-config",
"@nativescript/firebase-storage": "file:../../packages/firebase-storage",
- "@nativescript/google-signin": "~2.1.0",
- "@nativescript/firebase-app-check-debug": "file:../../packages/firebase-app-check-debug",
- "@nativescript/firebase-messaging-core": "file:../../packages/firebase-messaging-core",
- "@nativescript/firebase-ui": "file:../../packages/firebase-ui"
+ "@nativescript/firebase-ui": "file:../../packages/firebase-ui",
+ "@nativescript/google-signin": "~2.1.0"
},
"devDependencies": {
"@nativescript/android": "~8.8.0",
diff --git a/apps/demo/project.json b/apps/demo/project.json
index f8f4a97f..1c4650e4 100644
--- a/apps/demo/project.json
+++ b/apps/demo/project.json
@@ -12,33 +12,8 @@
"production": true,
"uglify": true,
"release": true,
- "forDevice": true
- },
- "dependsOn": [
- {
- "target": "build.all",
- "dependencies": true
- }
- ]
- },
- "ios": {
- "executor": "@nativescript/nx:build",
- "options": {
- "platform": "ios",
- "noHmr": true
- },
- "dependsOn": [
- {
- "target": "build.all",
- "dependencies": true
- }
- ]
- },
- "android": {
- "executor": "@nativescript/nx:build",
- "options": {
- "platform": "android",
- "noHmr": true
+ "forDevice": true,
+ "tsConfig": "apps/demo/tsconfig.json"
},
"dependsOn": [
{
@@ -48,13 +23,21 @@
]
},
"clean": {
- "executor": "@nativescript/nx:build",
- "options": {
- "clean": true
- }
+ "executor": "@nativescript/nx:clean",
+ "options": {}
},
"lint": {
"executor": "@nx/eslint:lint"
+ },
+ "debug": {
+ "executor": "@nativescript/nx:debug",
+ "options": {
+ "noHmr": true,
+ "uglify": false,
+ "release": false,
+ "forDevice": false,
+ "prepare": false
+ }
}
}
}
diff --git a/apps/demo/src/app.ts b/apps/demo/src/app.ts
index 33a336b8..543aff3f 100644
--- a/apps/demo/src/app.ts
+++ b/apps/demo/src/app.ts
@@ -1,4 +1,5 @@
-import { Application, Utils } from '@nativescript/core';
+import { AndroidActivityNewIntentEventData, Application, Utils } from '@nativescript/core';
+
import { firebase } from '@nativescript/firebase-core';
import '@nativescript/firebase-analytics';
import '@nativescript/firebase-auth';
@@ -15,8 +16,6 @@ import '@nativescript/firebase-remote-config';
import '@nativescript/firebase-storage';
import '@nativescript/firebase-ui';
-import { Admob } from '@nativescript/firebase-admob';
-
import { AppCheck } from '@nativescript/firebase-app-check-debug';
AppCheck.setProviderFactory();
@@ -28,8 +27,6 @@ firebase()
firebase().crashlytics().setCrashlyticsCollectionEnabled(true);
});
-Admob.init();
-
const dynamicLinks = firebase().dynamicLinks();
dynamicLinks.onLink((link) => {
diff --git a/apps/demo/src/main-page.ts b/apps/demo/src/main-page.ts
index 33d5bbf2..16d94bbc 100644
--- a/apps/demo/src/main-page.ts
+++ b/apps/demo/src/main-page.ts
@@ -1,12 +1,12 @@
import { EventData, Page } from '@nativescript/core';
import { firebase } from '@nativescript/firebase-core';
import { MainViewModel } from './main-view-model';
-
+import { MessagingCore } from '@nativescript/firebase-messaging-core';
let didFire = false;
export function navigatingTo(args: EventData) {
const page = args.object;
page.bindingContext = new MainViewModel();
-
+ /*
if (global.isAndroid && !didFire) {
firebase()
.messaging()
@@ -25,4 +25,22 @@ export function navigatingTo(args: EventData) {
});
didFire = true;
}
+ */
+
+ if (global.isAndroid && !didFire) {
+ MessagingCore.getInstance()
+ .requestPermission()
+ .then(() => {
+ console.log('requestPermission', 'done');
+ MessagingCore.getInstance()
+ .registerDeviceForRemoteMessages()
+ .catch((e) => {
+ console.error('registerDeviceForRemoteMessages', e);
+ });
+ })
+ .catch((e) => {
+ console.error('requestPermission', e);
+ });
+ didFire = true;
+ }
}
diff --git a/apps/demo/src/main-view-model.ts b/apps/demo/src/main-view-model.ts
index d28ba3a1..13b7b070 100644
--- a/apps/demo/src/main-view-model.ts
+++ b/apps/demo/src/main-view-model.ts
@@ -2,9 +2,6 @@ import { Observable, Frame } from '@nativescript/core';
export class MainViewModel extends Observable {
demos = [
- {
- name: 'firebase-admob',
- },
{
name: 'firebase-analytics',
},
diff --git a/apps/demo/src/plugin-demos/firebase-admob.ts b/apps/demo/src/plugin-demos/firebase-admob.ts
deleted file mode 100644
index fe98f107..00000000
--- a/apps/demo/src/plugin-demos/firebase-admob.ts
+++ /dev/null
@@ -1,122 +0,0 @@
-import { Observable, EventData, Page, View, Label } from '@nativescript/core';
-import { DemoSharedFirebaseAdmob } from '@demo/shared';
-import { AdChoicesPlacement, NativeAdEventType, AdEventType, InterstitialAd, RewardedInterstitialAd, RewardedAd, BannerAd, BannerAdSize, Admob, AdsConsent, NativeAd, NativeAdLoader, NativeAdView } from '@nativescript/firebase-admob';
-
-export function navigatingTo(args: EventData) {
- const page = args.object;
- page.bindingContext = new DemoModel();
-}
-
-export class DemoModel extends DemoSharedFirebaseAdmob {
- get bannerAdUnit() {
- if (global.isAndroid) {
- return 'ca-app-pub-3940256099942544/6300978111';
- } else {
- return 'ca-app-pub-3940256099942544/2934735716';
- }
- }
-
- constructor() {
- super();
- //this.interstitial();
- //this.rewardedInterstitial();
- //this.rewarded();
- // ATTrackingManager.requestTrackingAuthorizationWithCompletionHandler((status) => {
- // console.log('ATTrackingManager', status);
- // });
- const testDevices = [];
- if (global.isIOS) {
- testDevices.push('b70c144077402b91cf8ecc5b93ac7791', 'EMULATOR');
- } else {
- testDevices.push('EMULATOR');
- }
- Admob.getInstance().requestConfiguration = { testDevices };
- }
-
- nativeAdLayoutChanged(event) {
- const view = event.object;
- const hlv = view.getViewById('headLineView') as Label;
- const mv = view.getViewById('mediaView');
- const bv = view.getViewById('bodyView');
- const iv = view.getViewById('iconView');
- }
- nativeAdLoaded(event) {
- const view = event.object;
- const loader = new NativeAdLoader('ca-app-pub-3940256099942544/3986624511', null, {
- nativeAdOptions: {
- adChoicesPlacement: AdChoicesPlacement.BOTTOM_LEFT,
- },
- });
- loader.onAdEvent((event, error, data) => {
- if (event === NativeAdEventType.LOADED) {
- const ad = data as NativeAd;
- const hlv = view.getViewById('headLineView') as Label;
- hlv.text = ad.headline;
- const mv = view.getViewById('mediaView');
- view.mediaView = mv;
- mv.mediaContent = ad.mediaContent;
- const bv = view.getViewById('bodyView');
- bv.text = ad.body;
- const iv = view.getViewById('iconView');
- iv.src = ad.icon.image;
- view.nativeAd = ad;
- console.log('nativead loaded');
- } else if (event === 'adFailedToLoad') {
- console.error('nativead failed to load', error);
- }
- });
- loader.load();
- }
-
- bannerLoaded(event) {
- const bannerAd = event.object as BannerAd;
-
- bannerAd.on('adLoaded', (args) => {
- console.log('bannerad loaded');
- });
- bannerAd.on('adFailedToLoad', (args) => {
- console.log('bannerad failed to load', args.error);
- });
- bannerAd.size = BannerAdSize.FULL_BANNER;
- bannerAd.load();
- }
-
- interstitial() {
- const ad = InterstitialAd.createForAdRequest('ca-app-pub-3940256099942544/4411468910');
- ad.onAdEvent((event, error, data) => {
- if (event === AdEventType.LOADED) {
- console.log('loaded');
- ad.show();
- } else if (event === AdEventType.FAILED_TO_LOAD_EVENT) {
- console.error('loading error', error);
- }
- });
- ad.load();
- }
-
- rewardedInterstitial() {
- const ad = RewardedInterstitialAd.createForAdRequest('ca-app-pub-3940256099942544/6978759866');
- ad.onAdEvent((event, error, data) => {
- if (event === AdEventType.LOADED) {
- console.log('loaded');
- ad.show();
- } else if (event === AdEventType.FAILED_TO_LOAD_EVENT) {
- console.error('loading error', error);
- }
- });
- ad.load();
- }
-
- rewarded() {
- const ad = RewardedAd.createForAdRequest('ca-app-pub-3940256099942544/1712485313');
- ad.onAdEvent((event, error, data) => {
- if (event === AdEventType.LOADED) {
- console.log('rewarded', 'loaded');
- ad.show();
- } else if (event === AdEventType.FAILED_TO_LOAD_EVENT) {
- console.error('loading error', error);
- }
- });
- ad.load();
- }
-}
diff --git a/apps/demo/src/plugin-demos/firebase-admob.xml b/apps/demo/src/plugin-demos/firebase-admob.xml
deleted file mode 100644
index 78fde495..00000000
--- a/apps/demo/src/plugin-demos/firebase-admob.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/apps/demo/tsconfig.json b/apps/demo/tsconfig.json
index 04555be8..154dc74f 100644
--- a/apps/demo/tsconfig.json
+++ b/apps/demo/tsconfig.json
@@ -11,8 +11,6 @@
"@nativescript/firebase-database": ["../../packages/firebase-database/index.d.ts"],
"@nativescript/firebase-firestore": ["../../packages/firebase-firestore/index.d.ts"],
"@nativescript/firebase-analytics": ["../../packages/firebase-analytics/index.d.ts"],
- "@nativescript/firebase-admob": ["../../packages/firebase-admob/index.d.ts"],
- "@nativescript/firebase-admob/angular": ["../../packages/firebase-admob/angular/index.ts"],
"@nativescript/firebase-crashlytics": ["../../packages/firebase-crashlytics/index.d.ts"],
"@nativescript/firebase-app-check": ["../../packages/firebase-app-check/index.d.ts"],
"@nativescript/firebase-remote-config": ["../../packages/firebase-remote-config/index.d.ts"],
diff --git a/migrations.json b/migrations.json
index b38e8f1b..a5031b2f 100644
--- a/migrations.json
+++ b/migrations.json
@@ -1,7 +1 @@
-{
- "migrations": [
- { "cli": "nx", "version": "5.2.0", "description": "Migrate tools to 5.2.0", "implementation": "./src/migrations/update-5-2-0/update-5-2-0", "package": "@nativescript/plugin-tools", "name": "update-to-5.2.0" },
- { "cli": "nx", "version": "5.3.0", "description": "Migrate tools to 5.3.0", "implementation": "./src/migrations/update-5-3-0/update-5-3-0", "package": "@nativescript/plugin-tools", "name": "update-to-5.3.0" },
- { "cli": "nx", "version": "5.4.0", "description": "Migrate tools to 5.4.0", "implementation": "./src/migrations/update-5-4-0/update-5-4-0", "package": "@nativescript/plugin-tools", "name": "update-to-5.4.0" }
- ]
-}
+{ "migrations": [{ "cli": "nx", "version": "5.5.0", "description": "Migrate tools to 5.5.0", "implementation": "./src/migrations/update-5-5-0/update-5-5-0", "package": "@nativescript/plugin-tools", "name": "update-to-5.5.0" }] }
diff --git a/nx.json b/nx.json
index 4e56d29d..8902bfa8 100644
--- a/nx.json
+++ b/nx.json
@@ -32,5 +32,21 @@
"useDaemonProcess": false,
"parallel": 1,
"useInferencePlugins": false,
- "defaultBase": "master"
+ "defaultBase": "master",
+ "release": {
+ "releaseTagPattern": "{version}-{projectName}",
+ "projects": ["packages/*"],
+ "projectsRelationship": "independent",
+ "changelog": {
+ "workspaceChangelog": false,
+ "projectChangelogs": {
+ "renderOptions": {
+ "authors": true,
+ "commitReferences": true,
+ "versionTitleDate": true
+ }
+ }
+ }
+ },
+ "useLegacyCache": true
}
diff --git a/package.json b/package.json
index 993358f8..4dd9168c 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "plugins",
- "version": "3.4.0-alpha.1",
+ "version": "4.0.0",
"license": "MIT",
"scripts": {
"postinstall": "husky && npx ts-patch install",
@@ -17,36 +17,41 @@
},
"private": true,
"devDependencies": {
- "@angular-devkit/build-angular": "^18.0.0",
- "@angular/animations": "^18.0.0",
- "@angular/common": "^18.0.0",
- "@angular/compiler": "^18.0.0",
- "@angular/compiler-cli": "^18.0.0",
- "@angular/core": "^18.0.0",
- "@angular/forms": "^18.0.0",
- "@angular/platform-browser": "^18.0.0",
- "@angular/platform-browser-dynamic": "^18.0.0",
- "@angular/router": "^18.0.0",
- "@nativescript/angular": "^18.0.0",
+ "@angular-devkit/build-angular": "^19.0.0",
+ "@angular/animations": "^19.0.0",
+ "@angular/common": "^19.0.0",
+ "@angular/compiler": "^19.0.0",
+ "@angular/compiler-cli": "^19.0.0",
+ "@angular/core": "^19.0.0",
+ "@angular/forms": "^19.0.0",
+ "@angular/platform-browser": "^19.0.0",
+ "@angular/platform-browser-dynamic": "^19.0.0",
+ "@angular/router": "^19.0.0",
+ "@nativescript/angular": "^19.0.0",
"@nativescript/core": "~8.8.0",
- "@nativescript/plugin-tools": "5.4.1",
+ "@nativescript/plugin-tools": "5.5.1",
"@nativescript/types": "~8.8.0",
"@nativescript/webpack": "~5.0.5",
- "@ngtools/webpack": "^18.0.0",
+ "@ngtools/webpack": "^19.0.0",
+ "@typescript-eslint/eslint-plugin": "^8.13.0",
+ "@typescript-eslint/parser": "^8.13.0",
+ "@typescript-eslint/utils": "^8.13.0",
"conventional-changelog-cli": "^2.2.2",
"husky": "~9.0.0",
"nativescript-vue": "~2.9.0",
"nativescript-vue-template-compiler": "~2.9.0",
- "ng-packagr": "^18.0.0",
+ "ng-packagr": "^19.0.0",
"rxjs": "~7.8.0",
"stacktrace-js": "~2.0.2",
- "typescript": "~5.5.0",
+ "typescript": "~5.6.0",
"vue": "~2.6.12",
- "zone.js": "~0.14.0"
+ "zone.js": "~0.15.0"
},
"lint-staged": {
"**/*.{js,ts,scss,json,html}": [
"npx prettier --write"
]
- }
+ },
+ "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e",
+ "dependencies": {}
}
diff --git a/packages/firebase-admob/.eslintrc.json b/packages/firebase-admob/.eslintrc.json
deleted file mode 100644
index be41074b..00000000
--- a/packages/firebase-admob/.eslintrc.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "extends": ["../../.eslintrc.json"],
- "ignorePatterns": ["!**/*", "node_modules/**/*"],
- "overrides": [
- {
- "files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
- "rules": {}
- },
- {
- "files": ["*.ts", "*.tsx"],
- "rules": {}
- },
- {
- "files": ["*.js", "*.jsx"],
- "rules": {}
- }
- ]
-}
diff --git a/packages/firebase-admob/README.md b/packages/firebase-admob/README.md
deleted file mode 100644
index c691411b..00000000
--- a/packages/firebase-admob/README.md
+++ /dev/null
@@ -1,725 +0,0 @@
-# @nativescript/firebase-admob
-
-A plugin that allows you to monetize your NativeScript app by integrating the [Google Mobile Ads SDK](https://developers.google.com/admob/android/sdk) into the app.
-
-> **Note:** Before you use this plugin, if you haven't already, setup your app for Firebase by following the instructions at [@nativescript/firebase-core](../firebase-core/).
-
-The `@nativescript/firebase-admob` plugin currently supports loading and displaying the following ad types:
-
-- [Banner](#banner-ads)
-- [Interstitial (full-screen)](#interstitial-ad)
-- [Native](#native-ads)
-- [Rewarded](#rewarded-ads)
-
-## Contents
-
-- [Installation](#installation)
-- [Setup Admob for iOS](#setup-admob-for-ios)
-- [Setup Admob for Android](#setup-admob-for-android)
-- [Use @nativescript/firebase-admob](#use-nativescriptfirebase-admob)
- - [Initialize the Mobile Ads SDK](#1-initialize-the-mobile-ads-sdk)
- - [Add your preferred ad format to the app](#2-add-your-preferred-ad-format-to-the-app)
- - [Banner ads](#banner-ads)
- - [Testing Banner ads in development mode](#testing-banner-ads-in-development-mode)
- - [Instantiate a Banner ad](#instantiate-a-banner-ad)
- - [Add Banner ad in NativeScript Core](#add-banner-ad-in-nativescript-core)
- - [Add Banner ad in NativeScript Angular](#add-banner-ad-in-nativescript-angular)
- - [Add Banner ad in NativeScript Vue](#add-banner-ad-in-nativescript-vue)
- - [Customize the banner ad size](#customize-the-banner-ad-size)
- - [Listen to a banner ad lifecycle events](#listen-to-a-banner-ad-lifecycle-events)
- - [Display a banner ad to the user](#display-a-banner-ad-to-the-user)
- - [Add an Interstitial ad](#add-an-interstitial-ad)
- - [Testing Interstitial ads in development](#testing-an-interstitial-ads-in-development)
- - [Display an Interstitial ad to the user](#display-an-interstitial-ad-to-the-user)
- - [Next steps](#next-steps)
- - [Native ads](#native-ads)
- - [Add a Native ad to your app](#add-a-native-ad-to-your-app)
- - [Adding a Native ad in NativeScript Core](#adding-a-native-ad-in-nativescript-core)
- - [Testing Native ads in development mode](#testing-native-ads-in-development-mode)
- - [NativeAdOptions interface](#nativeadoptions-interface)
- - [Next steps](#next-steps-1)
- - [Rewarded Ads](#rewarded-ads)
- - [Testing Rewarded ads in development mode](#testing-rewarded-ads-in-development-mode)
- - [Display a Rewarded ad](#display-a-rewarded-ad)
- - [Rewarded ad Events](#rewarded-ad-events)
- - [Targeting](#targeting)
- - [Child-directed setting](#child-directed-setting)
- - [For users under the age of consent](#for-users-under-the-age-of-consent)
- - [Ad content filtering](#ad-content-filtering)
-
-
-
-## Installation
-
-To install `@nativescript/firebase-admob`, run the following command in the root directory of the project:
-
-```cli
-npm install @nativescript/firebase-admob
-```
-
-## Setup Admob for iOS
-
-Update your `Info.plist` file at `App_Resources/iOS` with a `GADApplicationIdentifier` key with a string value of your AdMob app ID ([identified in the AdMob UI](https://support.google.com/admob/answer/7356431)).
-
-```xml
-GADApplicationIdentifier
-ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy
-```
-
-For more information about configuring the `Info.plist` and setting up your App ID, see [Update your Info.plist](https://developers.google.com/admob/ios/quick-start#update%5C_your%5C_infoplist).
-
-## Setup Admob for Android
-
-Add AdMob App ID ([identified in the AdMob UI](https://support.google.com/admob/answer/7356431)) to the app's `AndroidManifest.xml` file, found at `App_Resources/Android/src/main`. Failure to do so will result in a crash on app launch. Add the ID by adding a `` tag with name `com.google.android.gms.ads.APPLICATION_ID`, as shown below. For `android:value` insert your own AdMob App ID in quotes.
-
-```xml
-
-
-
-
-```
-
-See step 3. of [Configure your app](https://developers.google.com/admob/android/quick-start#import_the_mobile_ads_sdk) for more information about configuring AndroidManifest.xml and setting up the App ID.
-
-## Use @nativescript/firebase-admob
-
-To use the `@nativescript/firebase-admob` plugin, follow the steps below:
-
-### 1. Initialize the Mobile Ads SDK
-
-Before loading ads, initialize the Mobile Ads SDK by calling the static [init](#init) method on the Admob class. Call this method once, ideally right before the app boots, in the `main.ts` file.
-
-```ts
-import { Admob } from '@nativescript/firebase-admob';
-
-Admob.init();
-```
-
-### 2. Add your preferred ad format to the app
-
-The Mobile Ads SDK is now imported and you're ready to implement an ad. Click any of the links below to get detailed implementation steps for your desired ad format.
-
-- [Banner](#add-a-banner-ad)
-- [Interstitial (full-screen)](#interstitial-ad)
-- [Native](#native-ads)
-- [Rewarded](#rewarded-ads)
-
-### Banner ads
-
-Banner ads are rectangular ads that appear at the top or bottom of the device screen. They stay on screen while users are interacting with the app, and can refresh automatically after a certain period. If you're new to mobile advertising, they're a great place to start.
-
-#### Testing Banner ads in development mode
-
-> **Note:** When developing your app, make sure you use test ads rather than live, production ads. Failure to do so can lead to suspension of your account. Make sure you replace the test unit ID with your ad unit ID before publishing your app.
-
-To enable dedicated test ad unit ID for banners, visit the links below:
-
-- [Android demo units](https://developers.google.com/admob/android/test-ads#demo_ad_units)
-- [iOS demo units](https://developers.google.com/admob/ios/test-ads#demo_ad_units)
-
-Below are examples of adding a Banner ad in several NativeScript flavors.
-
-#### Add Banner ad in NativeScript Core
-
-Register the plugin namespace in the Page element under a prefix(`ui` for example), access the `BannerAd` view from the namespace via the prefix and add it to your XML.
-
-The `BannerAd` requires the following attributes to be set:
-
-- `unitId`
-- `BannerAdSize`: You can set this value in the callback function of the `layoutChanged` event. For more information, see [Customize the banner ad size](#customize-the-banner-ad-size)
-- `height` and `width`
-
-
-
-```xml
-
-
-
-
-
-
-```
-
-```js
-import { BannerAdSize } from '@nativescript/firebase-admob';
-
-export function loadBanner(args) {
- const banner = args.object;
- banner.size = new BannerAdSize(100, 100);
- banner.load();
-}
-```
-
-#### Add Banner ad in NativeScript Angular
-
-Register the `BannerAd` view by adding its `AdmobModule` to the `imports` array of the `@NgModule` decorator of the component where you want to use the view.
-
-```ts
-import { AdmobModule } from '@nativescript/firebase-admob/angular';
-
-@NgModule({
- imports: [
- AdmobModule
- ],
- declarations: [
- AppComponent
- ],
- bootstrap: [AppComponent]
-})
-```
-
-Next, add the `BannerAd` view to HTML. The `BannerAd` requires the following attributes to be set:
-
-- `unitId`
-- `BannerAdSize`: You can set this value in the callback function of the `layoutChanged` event. For more information, see [Customize the banner ad size](#customize-the-banner-ad-size)
-- `height` and `width`
-
-```html
-
-```
-
-#### Add Banner ad in NativeScript Vue
-
-Register the `BannerAd` view in the `app.ts` file as follows:
-
-```ts
-import { createApp } from 'nativescript-vue';
-import Admob from '@nativescript/firebase-admob/vue';
-import Home from './components/Home.vue';
-
-const app = createApp(Home);
-app.use(Admob);
-```
-
-And then add it to markup as follows. The `BannerAd` requires the following attributes to be set:
-
-- `unitId`
-- `BannerAdSize`: You can set this value in the callback function of the `layoutChanged` event. For more information, see [Customize the banner ad size](#customize-the-banner-ad-size)
-- `height` and `width`
-
-```xml
-
-```
-
-#### Customize the banner ad size
-
-To define a custom banner size, you have 2 options:
-
-- Instantiate the `BannerAdSize` class with the desired width and height and set it to the `size` attribute of `BannerAd`.
-
-```ts
-import { BannerAdSize } from '@nativescript/firebase-admob';
-
-banner.size = new BannerAdSize(300, 50);
-```
-
-- Set the `size` to any of the constants of the `BannerAdSize` class.
-
-The table below lists the available constants and the sizes they represent.
-
-| AdSize Constant | Size in dp (WxH) | Description |
-| :------------------------------------------------- | :------------------------------- | :--------------- |
-| `BANNER` | `320x50` | Standard Banner |
-| `LARGE_BANNER` | `320x100` | Large Banner |
-| `MEDIUM_RECTANGLE` | `320x250` | Medium Rectangle |
-| `FULL_BANNER` | `468x60` | Full-Size Banner |
-| `LEADERBOARD` | `728x90` | Leaderboard |
-| `createAnchoredAdaptiveBanner(width, orientation)` | Provided width x Adaptive height | Adaptive Banner |
-| `createInLineAdaptiveBanner(width, orientation)` | Provided width x Adaptive height | Adaptive Banner |
-
-#### Listen to a banner ad lifecycle events
-
-The plugin enables you to listen to different lifecycle events of an ad, such as when an ad is loaded. Register the events handlers before calling the `load` method.
-
-```ts
-const bannerView = event.object;
-
-// Called when an ad is successfully received.
-bannerView.on('adLoaded', (args) => {
- console.log('Ad loaded.');
-});
-
-// Called when an ad request failed.
-bannerView.on('adFailedToLoad', (args) => {
- console.log('Ad failed to load: ', args.error);
-});
-
-// Called when the user removes an overlay that covers the screen.
-bannerView.on('adClosed', (args) => {
- console.log('Ad closed.');
-});
-
-// Called when an impression occurs on the ad.
-bannerView.on('adImpression', (args) => {
- console.log('Ad impression.');
-});
-
-// Called when an tap/touch/click occurs on the ad.
-bannerView.on('adClicked', (args) => {
- console.log('Ad tapped');
-});
-```
-
-### Display a banner ad to the user
-
-To display a banner ad to the user, get the reference to the `BannerAd` view and call the `load` method on it.
-
-```ts
-bannerView.load();
-```
-
-### Add an Interstitial ad
-
-Interstitial ads are full-screen ads that cover the interface of an app until closed by the user. They're best used at natural pauses in the flow of an app's execution, such as between levels of a game or just after a task is completed.
-
-#### Testing Interstitial ads in development
-
-> **Note:** When your app is in development mode, make sure you use test ads rather than live, production ads. Failure to do so can lead to suspension of your account. Make sure you replace the test unit ID with your ad unit ID before publishing your app.
-> To enable dedicated test ad unit ID, visit the links below:
-
-- [Android demo units](https://developers.google.com/admob/android/test-ads#demo_ad_units)
-- [iOS demo units](https://developers.google.com/admob/ios/test-ads#demo_ad_units)
-
-### Display an Interstitial ad to the user
-
-To display an Interstitial ad to the user, follow the steps below:
-
-1. Import the `InterstitialAd` class from `@nativescript/firebase-admob`.
-
-```ts
-import { InterstitialAd } from '@nativescript/firebase-admob';
-```
-
-2. Create an Interstitial ad instance.
-
-Create an Interstitial ad instance by calling the static `createForAdRequest` on the class. The `createForAdRequest` method requires an adUnitId and you can optionally pass a [RequestOptions]() object.
-
-```ts
-import { InterstitialAd } from '@nativescript/firebase-admob';
-const ad = InterstitialAd.createForAdRequest('ca-app-pub-xxxxxxxxxxxxxxxx/yyyyyyyyyy');
-```
-
-3. Listen to the ad lifecycle events
-
-To listen for the ad lifecycle events, such as when the ad is display or dismissed, call the `onAdEvent` method on the ad instance, before displaying the ad, passing it a callback function to handle the events.
-
-```ts
-import { InterstitialAd } from '@nativescript/firebase-admob';
-
-const ad = InterstitialAd.createForAdRequest('ca-app-pub-xxxxxxxxxxxxxxxx/yyyyyyyyyy');
-
-ad.onAdEvent((event, error, data) => {
- switch (event) {
- case AdEventType.LOADED:
- break;
- case AdEventType.CLOSED:
- break;
- case AdEventType.OPENED:
- break;
- case AdEventType.IMPRESSION:
- break;
- case AdEventType.FAILED_TO_SHOW_FULL_SCREEN_CONTENT:
- break;
- }
-});
-```
-
-4. Load the ad
- You load the ad by calling the `load` method on the ad instance.
-
-```ts
-import { InterstitialAd } from '@nativescript/firebase-admob';
-
-const ad = InterstitialAd.createForAdRequest('ca-app-pub-xxxxxxxxxxxxxxxx/yyyyyyyyyy');
-
-ad.onAdEvent((event, error, data) => {
- switch (event) {
- case AdEventType.LOADED:
- break;
- case AdEventType.CLOSED:
- break;
- case AdEventType.OPENED:
- break;
- case AdEventType.IMPRESSION:
- break;
- case AdEventType.FAILED_TO_SHOW_FULL_SCREEN_CONTENT:
- break;
- }
-});
-
-ad.load();
-```
-
-5. Display the the ad
-
-To display the ad, call the `show` method on the ad instance. This method is called after the `load` method.
-
-```ts
-import { InterstitialAd } from '@nativescript/firebase-admob';
-
-const ad = InterstitialAd.createForAdRequest('ca-app-pub-xxxxxxxxxxxxxxxx/yyyyyyyyyy');
-
-ad.onAdEvent((event, error, data) => {
- switch (event) {
- case AdEventType.LOADED:
- break;
- case AdEventType.CLOSED:
- ad.show();
- break;
- case AdEventType.OPENED:
- break;
- case AdEventType.IMPRESSION:
- break;
- case AdEventType.FAILED_TO_SHOW_FULL_SCREEN_CONTENT:
- break;
- }
-});
-
-ad.load();
-```
-
-#### Next steps
-
-- See [Interstitial best practices](https://www.youtube.com/watch?v=r2RgFD3Apyo&index=5&list=PLOU2XLYxmsIKX0pUJV3uqp6N3NeHwHh0c) and [interstitial ad guidance](https://support.google.com/admob/answer/6066980).
-- Check out an [Interstitial ads case study](https://admob.google.com/home/resources/freaking-math-powers-revenue-increase-with-google-admob-support/).
-- If you haven't already, create your own interstitial ad unit in the [AdMob UI](https://apps.admob.com/).
-
-## Native Ads
-
-Native ads are ad assets that are presented to users via UI components that are native to the platform. They're shown using the same types of views with which you're already building your layouts, and can be formatted to match the visual design of the user experience in which they live. In coding terms, this means that when a native ad loads, your app receives a NativeAd object that contains its assets, and the app (rather than the Google Mobile Ads SDK) is then responsible for displaying them.
-
-### Adding a Native ad in NativeScript Core
-
-To add a Native ad to your {N} Core app, follow these steps:
-
-1. Register the plugin namespace under a prefix, `ui` (this can be any name), with the Page element.
-
-```xml
-
-```
-
-2. Use the prefix to access the `NativeAdView` and add it to markup.
-
-```xml
-
-
-
-
-
-
-```
-
-### Testing Native ads in development mode
-
-> **Note:** When developing your app, make sure you use test ad unit IDs rather than live, production ads. Failure to do so can lead to suspension of your account. Just make sure you replace the test ad unit ID with your own ad unit ID before publishing your app.
-
-To enable dedicated test ad unit ID, visit the links below:
-
-- [Android demo units](https://developers.google.com/admob/android/test-ads#demo_ad_units)
-- [iOS demo units](https://developers.google.com/admob/ios/test-ads#demo_ad_units)
-
-3. Import the `NativeAdLoader` class from `@nativescript/firebase-admob` in the view model file.
-
-```ts
-import { NativeAdLoader } from '@nativescript/firebase-admob';
-```
-
-The `NativeAdLoader` class is an interface for managing the the Native ad.
-
-4. Instantiate `NativeAdLoader`.
- Create an instance of `NativeAdLoader` by calling its constructor function. The constructor function accepts 3 parameters. The required adUnitId as the first parameter, optional RequestOptions and NativeAdOptions objects as the second and third parameter, respectively.
-
-```ts
-const loader = new NativeAdLoader('ca-app-pub-xxxxxxxxxxxxxxxx/yyyyyyyyyy', null, {
- nativeAdOptions: {
- adChoicesPlacement: AdChoicesPlacement.TOP_RIGHT,
- },
-});
-```
-
-5. Listen to the Native ad lifecycle events
-
-To listen to the Native ad [lifecycle events](), call the `onAdEvent` method on the `NativeAdLoader` instance when the `NativeAdView` has loaded.
-
-```xml
-
-
-
-
-
-
-
-
-```
-
-```ts
-function nativeAdLoaded(event) {
- const view = event.object;
-
- loader.onAdEvent((event, error, data) => {
- if (event === NativeAdEventType.LOADED) {
- const ad = data as NativeAd;
-
- const headLineView = view.getViewById('headLineView');
- headLineView.text = ad.headline;
- const mediaView = view.getViewById('mediaView');
- view.mediaView = mediaView;
- mediaView.mediaContent = ad.mediaContent;
- const callToActionButton = view.getViewById('callToActionView');
- view.callToActionView = callToActionButton;
- callToActionButton.text = ad.callToAction;
- const bodyView = view.getViewById('bodyView');
- bodyView.text = ad.body;
- view.nativeAd = ad;
- console.log('nativead loaded');
- } else if (event === 'adFailedToLoad') {
- console.log('nativead failed to load', error);
- }
- });
-}
-```
-
-6. Display the Native ad
- To display the Native ad, call the `load` method on a NativeAdLoader instance.
-
-```ts
-loader.load();
-```
-
-### NativeAdOptions interface
-
-A NativeAdOptions object is used to set the following options on the native ad.
-| Property | Type | Description |
-|:---------|:-----|:----------- |
-| `returnUrlsForImageAssets` | `boolean` | _Optional_: If set to `true`, the SDK will not load image asset content and native ad image URLs can be used to fetch content. Defaults to `false`. |
-| `multipleImages` | `boolean`| _Optional_: Some image assets contain a series of images. Setting this property to `true` tells the app to display all the images of an asset. The `false`(the default) value informs the app to display the first image from the series of images in an image asset. |
-| `adChoicesPlacement` | [AdChoicesPlacement](#adchoicesplacement) |_Optional_: The [AdChoices overlay](https://developers.google.com/admob/android/native/advanced#adchoices_overlay) is set to the top right corner by default. Apps can change which corner this overlay is rendered in by setting this property to one of the following: |
-| `videoOptions` | [videoOptions](#videooptions)| _Optional_: Used to set video options for video assets returned as part of a native ad. If an ad contains a video(if `ad.mediaContent.hasVideoContent = true`), display the video. |
-| `mediaAspectRatio` | [MediaAspectRatio](#mediaaspectratio) | _Optional_: This sets the aspect ratio for image or video to be returned for the native ad.
-
-#### AdChoicesPlacement
-
-```ts
-enum AdChoicesPlacement {
- TOP_LEFT = 'topLeft',
- TOP_RIGHT = 'topRight',
- BOTTOM_RIGHT = 'bottomRight',
- BOTTOM_LEFT = 'bottomLeft',
-}
-```
-
-#### videoOptions
-
-The `videoOptions` property is an object with the following properties:
-| Property | Type | Optional |
-|:---------|:----|:------- |
-| `startMuted` | `boolean` | _Yes_ |
-| `clickToExpandRequested` | `boolean` | _Yes_ |
-| `customControlsRequested` | `boolean` | _Yes_ |
-
-#### MediaAspectRatio
-
-```ts
-enum MediaAspectRatio {
- LANDSCAPE = 'landscape',
- PORTRAIT = 'portrait',
- SQUARE = 'square',
- ANY = 'any',
-}
-```
-
-That's it! Your app is now ready to display native ads.
-
-### Next steps
-
-- Learn more about native ads in our [native ad playbook](https://admob.google.com/home/resources/native-ads-playbook/).
-- See [native ads policies and guidelines](https://support.google.com/admob/answer/6329638) for implementing native ads.
-- Check out some customer success stories: [Case study 1](https://admob.google.com/home/resources/alarmmon-achieves-higher-rpm-with-admob-triggered-native-ads/), [Case Study 2](https://admob.google.com/home/resources/linghit-limited-doubles-ad-revenue-with-admob-native-ads/)
-
-## Rewarded Ads
-
-Rewarded ads are ads that users have the option of interacting with [in exchange for in-app rewards](https://support.google.com/admob/answer/7313578).
-
-### Testing Rewarded ads in development mode
-
-> **Note:** When developing your app, make sure you use test ads rather than live, production ads. Failure to do so can lead to suspension of your account. Make sure you replace the test unit ID with your ad unit ID before publishing your app.
-
-To enable dedicated test ad unit ID, visit the links below:
-
-- [Android demo units](https://developers.google.com/admob/android/test-ads#demo_ad_units)
-- [iOS demo units](https://developers.google.com/admob/ios/test-ads#demo_ad_units)
-
-### Display a Rewarded ad
-
-Follow these steps to display a Rewarded ad:
-
-1. Import the `RewardedAd` class from `@nativescript/firebase-admob`.
-
-```ts
-import { RewardedAd } from '@nativescript/firebase-admob';
-```
-
-2. Create a `RewardedAd` instance
-
-Create a Rewarded ad instance by calling the `createForAdRequest` static method on the `RewardedAd` class and passing it the ad unit id.
-
-```ts
-import { RewardedAd } from '@nativescript/firebase-admob';
-
-const ad = RewardedAd.createForAdRequest('ca-app-pub-xxxxxxxxxxxxxxxx/yyyyyyyyyy');
-```
-
-3. Listen to the ad lifecycle events
- Before you call the `load` method to load the ad, call the `onAdEvent` method passing it a callback function to handle the ad events.
-
-```ts
-import { RewardedAd } from '@nativescript/firebase-admob';
-
-const ad = RewardedAd.createForAdRequest('ca-app-pub-xxxxxxxxxxxxxxxx/yyyyyyyyyy');
-
-ad.onAdEvent((event, error, data) => {
- if (event === AdEventType.LOADED) {
- console.log('rewarded', 'loaded');
- } else if (event === AdEventType.FAILED_TO_LOAD_EVENT) {
- console.error('loading error', error);
- }
-});
-```
-
-4. Load the ad
- To load the ad, call the `load` method on the `RewardAd` instance.
-
-```ts
-import { RewardedAd } from '@nativescript/firebase-admob';
-
-const ad = RewardedAd.createForAdRequest('ca-app-pub-xxxxxxxxxxxxxxxx/yyyyyyyyyy');
-
-ad.onAdEvent((event, error, data) => {
- if (event === AdEventType.LOADED) {
- console.log('rewarded', 'loaded');
- } else if (event === AdEventType.FAILED_TO_LOAD_EVENT) {
- console.error('loading error', error);
- }
-});
-ad.load();
-```
-
-6. Display the ad
-
-To show the ad on the screen, call the `show()` method on the ad instance.
-
-```ts
-import { RewardedAd } from '@nativescript/firebase-admob';
-
-const ad = RewardedAd.createForAdRequest('ca-app-pub-xxxxxxxxxxxxxxxx/yyyyyyyyyy');
-
-ad.onAdEvent((event, error, data) => {
- if (event === AdEventType.LOADED) {
- console.log('rewarded', 'loaded');
- ad.show();
- } else if (event === AdEventType.FAILED_TO_LOAD_EVENT) {
- console.error('loading error', error);
- }
-});
-ad.load();
-```
-
-#### Rewarded ad Events
-
-RewardAd emits the following lifecycle events that you can listen to:
-
-```ts
-ad.onAdEvent((event, error, data) => {
- switch (event) {
- case AdEventType.LOADED:
- break;
- case AdEventType.CLOSED:
- break;
- case AdEventType.OPENED:
- break;
- case AdEventType.IMPRESSION:
- break;
- case AdEventType.FAILED_TO_SHOW_FULL_SCREEN_CONTENT:
- break;
- }
-});
-```
-
-`onAdEvent` with the event `rewarded_earned_reward`'is invoked when the user earns a reward. Be sure to implement this and reward the user for watching an ad.
-
-### Targeting
-
-The RequestConfiguration object collects the global configuration for every ad request and is applied by `firebase().admob().setRequestConfiguration()`.
-
-### Child-directed ads setting
-
-For child-directed ads setting, read [Child-directed setting](https://developers.google.com/admob/android/targeting#child-directed_setting).
-
-The following example indicates that you want your content treated as child-directed for purposes of COPPA:
-
-```ts
-import { Admob, RequestConfiguration } from '@nativescript/firebase-admob';
-
-const requestConfiguration: RequestConfiguration = {
- tagForChildDirectedTreatment: true,
-};
-Admob.getInstance().requestConfiguration = requestConfiguration;
-```
-
-### Handle ads requests for users under the age of consent
-
-To handle ads requests for users under the age of consent, read [Users under the age of consent](https://developers.google.com/admob/android/targeting#users_under_the_age_of_consent).
-
-The following example indicates that you want TFUA included in your ad request.
-
-```ts
-import { Admob, RequestConfiguration } from '@nativescript/firebase-admob';
-
-const requestConfiguration: RequestConfiguration = {
- tagForUnderAgeOfConsent: true,
-};
-Admob.getInstance().requestConfiguration = requestConfiguration;
-```
-
-If the tags to enable the Child-directed setting and `tagForUnderAgeOfConsent`are both set to `true`, the child-directed setting takes precedence.
-
-### Ad content filtering
-
-This setting can be set via `RequestConfiguration.maxAdContentRating`:
-
-AdMob ads returned for these requests have a content rating at or below that level. The possible values for this network extra are based on [digital content label classifications](https://support.google.com/admob/answer/7562142), and should be one of the following MaxAdContentRating objects:
-
-- MaxAdContentRating.G
-- MaxAdContentRating.PG
-- MaxAdContentRating.T
-- MaxAdContentRating.MA
-
-The following code configures a `RequestConfiguration` object to specify that an ad content returned should correspond to a digital content label designation no higher than G:
-
-```ts
-import { Admob, MaxAdContentRating, RequestConfiguration } from '@nativescript/firebase-admob';
-
-const requestConfiguration: RequestConfiguration = {
- maxAdContentRating: MaxAdContentRating.G,
-};
-Admob.getInstance().requestConfiguration = requestConfiguration;
-```
-
-## License
-
-Apache License Version 2.0
diff --git a/packages/firebase-admob/adsconsent/common.ts b/packages/firebase-admob/adsconsent/common.ts
deleted file mode 100644
index 89136c2f..00000000
--- a/packages/firebase-admob/adsconsent/common.ts
+++ /dev/null
@@ -1,49 +0,0 @@
-export enum AdsConsentStatus {
- REQUIRED,
- NOT_REQUIRED,
- OBTAINED,
- UNKNOWN,
-}
-
-export enum AdsConsentDebugGeography {
- DISABLED,
- EEA,
- NOT_EEA,
-}
-
-export abstract class AdsConsentBase {
- static isConsentFormAvailable(): boolean {
- throw new Error('unimplemented');
- }
-
- static loadForm(): Promise {
- return Promise.reject('unimplemented');
- }
- static setForceTesting(force: boolean) {
- throw new Error('unimplemented');
- }
- static reset(): void {
- throw new Error('unimplemented');
- }
-
- static addTestDevices(deviceIds: string[]) {
- throw new Error('unimplemented');
- }
-
- static getStatus(): AdsConsentStatus {
- throw new Error('unimplemented');
- }
-
- static requestInfoUpdate(): Promise {
- return Promise.reject('unimplemented');
- }
- static setDebugGeography(geography: AdsConsentDebugGeography) {
- throw new Error('unimplemented');
- }
- static setTagForUnderAgeOfConsent(tag: boolean) {
- throw new Error('unimplemented');
- }
- static showForm(): Promise {
- return Promise.reject('unimplemented');
- }
-}
diff --git a/packages/firebase-admob/adsconsent/index.android.ts b/packages/firebase-admob/adsconsent/index.android.ts
deleted file mode 100644
index dc9c635c..00000000
--- a/packages/firebase-admob/adsconsent/index.android.ts
+++ /dev/null
@@ -1,98 +0,0 @@
-import { Application, Utils } from '@nativescript/core';
-import { FirebaseError } from '@nativescript/firebase-core';
-import { AdsConsentBase, AdsConsentDebugGeography, AdsConsentStatus } from './common';
-
-export { AdsConsentStatus, AdsConsentDebugGeography };
-
-export class AdsConsent extends AdsConsentBase {
- static _geography: AdsConsentDebugGeography;
- static _deviceIds: string[];
- static _tagForUnderAgeOfConsent: boolean;
- static _consentForm: com.google.android.ump.ConsentForm;
- static _consentInfo: com.google.android.ump.ConsentInformation;
- static reset() {
- org.nativescript.firebase.admob.FirebaseAdmob.AdConsent.reset(Utils.android.getApplicationContext());
- }
- static addTestDevices(deviceIds: string[]) {
- this._deviceIds = deviceIds;
- }
- static getStatus(): AdsConsentStatus {
- return org.nativescript.firebase.admob.FirebaseAdmob.AdConsent.getStatus(Utils.android.getApplicationContext()) as any;
- }
- static requestInfoUpdate(): Promise {
- return new Promise((resolve, reject) => {
- const info = {};
- if (this._geography) {
- info['geography'] = this._geography;
- }
-
- if (this._deviceIds) {
- info['deviceIds'] = this._deviceIds;
- }
-
- if (typeof this._tagForUnderAgeOfConsent === 'boolean') {
- info['tagForUnderAgeOfConsent'] = this._tagForUnderAgeOfConsent;
- }
-
- org.nativescript.firebase.admob.FirebaseAdmob.AdConsent.requestInfoUpdate(
- Application.android.foregroundActivity || Application.android.startActivity,
- JSON.stringify(info),
- new org.nativescript.firebase.admob.FirebaseAdmob.Callback({
- onSuccess(value) {
- resolve();
- },
- onError(error) {
- reject(FirebaseError.fromNative(error));
- },
- })
- );
- });
- }
- static setDebugGeography(geography: AdsConsentDebugGeography) {
- this._geography = geography;
- }
- static setTagForUnderAgeOfConsent(tag: boolean) {
- this._tagForUnderAgeOfConsent = tag;
- }
-
- static isConsentFormAvailable() {
- if (!this._consentInfo) {
- this._consentInfo = com.google.android.ump.UserMessagingPlatform.getConsentInformation(Utils.android.getApplicationContext());
- }
- return this._consentInfo.isConsentFormAvailable();
- }
-
- static showForm(): Promise {
- return new Promise((resolve, reject) => {
- org.nativescript.firebase.admob.FirebaseAdmob.AdConsent.show(
- Application.android.foregroundActivity || Application.android.startActivity,
- this._consentForm,
- new org.nativescript.firebase.admob.FirebaseAdmob.Callback({
- onSuccess(val) {
- resolve();
- },
- onError(error) {
- reject(FirebaseError.fromNative(error));
- },
- })
- );
- });
- }
-
- static loadForm() {
- return new Promise((resolve, reject) => {
- org.nativescript.firebase.admob.FirebaseAdmob.AdConsent.load(
- Utils.android.getApplicationContext(),
- new org.nativescript.firebase.admob.FirebaseAdmob.Callback({
- onSuccess(form) {
- AdsConsent._consentForm = form;
- resolve();
- },
- onError(error) {
- reject(FirebaseError.fromNative(error));
- },
- })
- );
- });
- }
-}
diff --git a/packages/firebase-admob/adsconsent/index.d.ts b/packages/firebase-admob/adsconsent/index.d.ts
deleted file mode 100644
index 9cb491ae..00000000
--- a/packages/firebase-admob/adsconsent/index.d.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { AdsConsentStatus, AdsConsentDebugGeography } from "./common";
-export { AdsConsentStatus, AdsConsentDebugGeography };
-
-export declare class AdsConsent extends AdsConsentBase {
- static reset();
- static addTestDevices(deviceIds: string[]);
- static getStatus(): AdsConsentStatus;
- static requestInfoUpdate(): Promise;
- static setDebugGeography(geography: AdsConsentDebugGeography);
- static setTagForUnderAgeOfConsent(tag: boolean);
- static isConsentFormAvailable();
- static showForm(): Promise;
- static loadForm(): Promise;
-}
diff --git a/packages/firebase-admob/adsconsent/index.ios.ts b/packages/firebase-admob/adsconsent/index.ios.ts
deleted file mode 100644
index 16c3a6e6..00000000
--- a/packages/firebase-admob/adsconsent/index.ios.ts
+++ /dev/null
@@ -1,109 +0,0 @@
-import { FirebaseError } from '@nativescript/firebase-core';
-import { topViewController } from '../utils';
-import { AdsConsentBase, AdsConsentDebugGeography, AdsConsentStatus } from './common';
-
-export { AdsConsentStatus, AdsConsentDebugGeography };
-
-export class AdsConsent extends AdsConsentBase {
- static _geography: AdsConsentDebugGeography;
- static _deviceIds: string[];
- static _tagForUnderAgeOfConsent: boolean;
- static _consentForm: UMPConsentForm;
- static reset() {
- UMPConsentInformation.sharedInstance.reset();
- }
- static addTestDevices(deviceIds: string[]) {
- this._deviceIds = deviceIds;
- }
- static getStatus(): AdsConsentStatus {
- switch (UMPConsentInformation.sharedInstance.consentStatus) {
- case UMPConsentStatus.NotRequired:
- return AdsConsentStatus.NOT_REQUIRED;
- case UMPConsentStatus.Obtained:
- return AdsConsentStatus.OBTAINED;
- case UMPConsentStatus.Required:
- return AdsConsentStatus.REQUIRED;
- case UMPConsentStatus.Unknown:
- return AdsConsentStatus.UNKNOWN;
- }
- }
- static requestInfoUpdate(): Promise {
- return new Promise((resolve, reject) => {
- const request = UMPRequestParameters.new();
- switch (this._geography) {
- case AdsConsentDebugGeography.DISABLED:
- request.debugSettings.geography = UMPDebugGeography.Disabled;
- break;
- case AdsConsentDebugGeography.EEA:
- request.debugSettings.geography = UMPDebugGeography.EEA;
- break;
- case AdsConsentDebugGeography.NOT_EEA:
- request.debugSettings.geography = UMPDebugGeography.NotEEA;
- break;
- }
-
- if (Array.isArray(this._deviceIds)) {
- request.debugSettings.testDeviceIdentifiers = this._deviceIds.map((item) => {
- if (item === 'EMULATOR') {
- if (typeof GADSimulatorID) {
- return GADSimulatorID;
- }
- return '';
- }
- return item;
- }) as any;
- }
-
- if (typeof this._tagForUnderAgeOfConsent === 'boolean') {
- request.tagForUnderAgeOfConsent = this._tagForUnderAgeOfConsent;
- }
-
- UMPConsentInformation.sharedInstance.requestConsentInfoUpdateWithParametersCompletionHandler(request, (error) => {
- if (error) {
- reject(FirebaseError.fromNative(error));
- } else {
- resolve();
- }
- });
- });
- }
- static setDebugGeography(geography: AdsConsentDebugGeography) {
- this._geography = geography;
- }
- static setTagForUnderAgeOfConsent(tag: boolean) {
- this._tagForUnderAgeOfConsent = tag;
- }
-
- static isConsentFormAvailable() {
- switch (UMPConsentInformation.sharedInstance.formStatus) {
- case UMPFormStatus.Available:
- return true;
- default:
- return false;
- }
- }
-
- static showForm(): Promise {
- return new Promise((resolve, reject) => {
- this._consentForm.presentFromViewControllerCompletionHandler(topViewController(), (error) => {
- if (error) {
- reject(FirebaseError.fromNative(error));
- } else {
- resolve();
- }
- });
- });
- }
- static loadForm() {
- return new Promise((resolve, reject) => {
- UMPConsentForm.loadWithCompletionHandler((form, error) => {
- if (error) {
- reject(FirebaseError.fromNative(error));
- } else {
- AdsConsent._consentForm = form;
- resolve();
- }
- });
- });
- }
-}
diff --git a/packages/firebase-admob/angular/.eslintrc.json b/packages/firebase-admob/angular/.eslintrc.json
deleted file mode 100644
index 47e8b721..00000000
--- a/packages/firebase-admob/angular/.eslintrc.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "extends": ["../.eslintrc.json"],
- "overrides": [
- {
- "files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
- "rules": {}
- },
- {
- "files": ["*.ts", "*.tsx"],
- "rules": {
- "@nx/enforce-module-boundaries": [
- "error",
- {
- "allowCircularSelfDependency": true
- }
- ]
- }
- },
- {
- "files": ["*.js", "*.jsx"],
- "rules": {}
- }
- ]
-}
diff --git a/packages/firebase-admob/angular/banner-ad-directive.ts b/packages/firebase-admob/angular/banner-ad-directive.ts
deleted file mode 100644
index 1e5f3921..00000000
--- a/packages/firebase-admob/angular/banner-ad-directive.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-import { Directive } from '@angular/core';
-
-@Directive({
- selector: 'BannerAd',
-})
-export class BannerAdDirective {}
diff --git a/packages/firebase-admob/angular/index.ts b/packages/firebase-admob/angular/index.ts
deleted file mode 100644
index eec7c325..00000000
--- a/packages/firebase-admob/angular/index.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import { NgModule } from '@angular/core';
-import { registerElement } from '@nativescript/angular';
-
-import { BannerAdDirective } from './banner-ad-directive';
-import { NativeAdViewDirective } from './native-ad-view-directive';
-import { MediaViewDirective } from './media-view-directive';
-
-export * from './banner-ad-directive';
-export * from './native-ad-view-directive';
-export * from './media-view-directive';
-
-@NgModule({
- declarations: [BannerAdDirective, NativeAdViewDirective, MediaViewDirective],
- exports: [BannerAdDirective, NativeAdViewDirective, MediaViewDirective],
-})
-// @ts-ignore
-export class AdmobModule {}
-
-registerElement('NativeAdView', () => require('@nativescript/firebase-admob').NativeAdView);
-registerElement('BannerAd', () => require('@nativescript/firebase-admob').BannerAd);
-registerElement('MediaView', () => require('@nativescript/firebase-admob').MediaView);
diff --git a/packages/firebase-admob/angular/media-view-directive.ts b/packages/firebase-admob/angular/media-view-directive.ts
deleted file mode 100644
index 86d24ee9..00000000
--- a/packages/firebase-admob/angular/media-view-directive.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-import { Directive } from '@angular/core';
-
-@Directive({
- selector: 'MediaView',
-})
-export class MediaViewDirective {}
diff --git a/packages/firebase-admob/angular/native-ad-view-directive.ts b/packages/firebase-admob/angular/native-ad-view-directive.ts
deleted file mode 100644
index b14b5b0a..00000000
--- a/packages/firebase-admob/angular/native-ad-view-directive.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-import { Directive } from '@angular/core';
-
-@Directive({
- selector: 'NativeAdView',
-})
-export class NativeAdViewDirective {}
diff --git a/packages/firebase-admob/angular/ng-package.json b/packages/firebase-admob/angular/ng-package.json
deleted file mode 100644
index f8ea05b8..00000000
--- a/packages/firebase-admob/angular/ng-package.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "$schema": "../../../node_modules/ng-packagr/ng-package.schema.json",
- "lib": {
- "entryFile": "index.ts"
- },
- "allowedNonPeerDependencies": ["."],
- "dest": "../../../dist/packages/firebase-admob/angular"
-}
diff --git a/packages/firebase-admob/angular/package.json b/packages/firebase-admob/angular/package.json
deleted file mode 100644
index 59d4c9a0..00000000
--- a/packages/firebase-admob/angular/package.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "name": "nativescript-firebase-admob-angular"
-}
diff --git a/packages/firebase-admob/angular/tsconfig.angular.json b/packages/firebase-admob/angular/tsconfig.angular.json
deleted file mode 100644
index 8d3aefc2..00000000
--- a/packages/firebase-admob/angular/tsconfig.angular.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "extends": "../../../node_modules/ng-packagr/lib/ts/conf/tsconfig.ngc.json",
- "compilerOptions": {
- "types": ["node"],
- "baseUrl": ".",
- "paths": {
- "@nativescript/firebase-admob": ["../../../dist/packages/firebase-admob"]
- },
- "outDir": "../../../dist/out-tsc",
- "declarationDir": "../../../dist/out-tsc"
- },
- "files": ["index.ts"]
-}
diff --git a/packages/firebase-admob/angular/tsconfig.json b/packages/firebase-admob/angular/tsconfig.json
deleted file mode 100644
index c0b256a9..00000000
--- a/packages/firebase-admob/angular/tsconfig.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "extends": "../../../tsconfig.base.json",
- "compilerOptions": {
- "outDir": "../../../dist/out-tsc",
- "rootDir": "."
- }
-}
diff --git a/packages/firebase-admob/common.ts b/packages/firebase-admob/common.ts
deleted file mode 100644
index 56d01e96..00000000
--- a/packages/firebase-admob/common.ts
+++ /dev/null
@@ -1,104 +0,0 @@
-import { CSSType, Property, View } from '@nativescript/core';
-import { IRewardedItem, RequestOptions } from '.';
-
-export abstract class BannerAdSizeBase {
- static get BANNER(): BannerAdSizeBase {
- throw new Error('unimplemented');
- }
-
- static get FULL_BANNER(): BannerAdSizeBase {
- throw new Error('unimplemented');
- }
-
- static get LARGE_BANNER(): BannerAdSizeBase {
- throw new Error('unimplemented');
- }
-
- static get LEADERBOARD(): BannerAdSizeBase {
- throw new Error('unimplemented');
- }
-
- static get MEDIUM_RECTANGLE(): BannerAdSizeBase {
- throw new Error('unimplemented');
- }
-
- static get SMART_BANNER(): BannerAdSizeBase {
- throw new Error('unimplemented');
- }
-
- static get ADAPTIVE_BANNER(): BannerAdSizeBase {
- throw new Error('unimplemented');
- }
-
- static get FLUID(): BannerAdSizeBase {
- throw new Error('unimplemented');
- }
-
- static get WIDE_SKYSCRAPER(): BannerAdSizeBase {
- throw new Error('unimplemented');
- }
-
- static get INVALID(): BannerAdSizeBase {
- throw new Error('unimplemented');
- }
-
- static get SEARCH(): BannerAdSizeBase {
- throw new Error('unimplemented');
- }
-}
-
-export const sizeProperty = new Property({
- name: 'size',
-});
-
-export const unitIdProperty = new Property({
- name: 'unitId',
-});
-
-@CSSType('BannerAd')
-export abstract class BannerAdBase extends View {
- static onAdClickedEvent = 'adClicked';
- static onAdClosedEvent = 'adClosed';
- static onAdFailedToLoadEvent = 'adFailedToLoad';
- static onAdLoadedEvent = 'adLoaded';
- static onAdOpenedEvent = 'adOpened';
- static onAdImpression = 'adImpression';
- static onAdFailedToShowFullScreenContent = 'adFailedToShowFullScreenContent';
- size: BannerAdSizeBase;
- unitId: BannerAdSizeBase;
-
- abstract load(options?: RequestOptions);
-
- abstract isLoading(): boolean;
-}
-
-sizeProperty.register(BannerAdBase);
-unitIdProperty.register(BannerAdBase);
-
-export enum MaxAdContentRating {
- G = 'G',
- MA = 'MA',
- PG = 'PG',
- T = 'T',
- UNSPECIFIED = 'UNSPECIFIED',
-}
-
-export enum AdEventType {
- CLICKED = 'adClicked',
- CLOSED = 'adClosed',
- LOADED = 'adLoaded',
- OPENED = 'adOpened',
- IMPRESSION = 'adImpression',
- FAILED_TO_SHOW_FULL_SCREEN_CONTENT = 'adFailedToShowFullScreenContent',
- FAILED_TO_LOAD_EVENT = 'adFailedToLoad',
-}
-
-export enum RewardedAdEventType {
- EARNED_REWARD = 'rewarded_earned_reward',
- LOADED = 'rewarded_loaded',
-}
-
-export enum AdapterStatusState {
- NOT_READY,
- READY,
-}
diff --git a/packages/firebase-admob/index.android.ts b/packages/firebase-admob/index.android.ts
deleted file mode 100644
index 943803ad..00000000
--- a/packages/firebase-admob/index.android.ts
+++ /dev/null
@@ -1,789 +0,0 @@
-import { Application, Utils } from '@nativescript/core';
-import lazy from '@nativescript/core/utils/lazy';
-import { IAdmob, AdEventListener, RequestConfiguration, AdShowOptions, IInterstitialAd, RequestOptions, IRewardedAd, IRewardedInterstitialAd, IRewardedItem, ServerSideVerificationOptions, AdapterStatus } from '.';
-import { AdEventType, BannerAdBase, RewardedAdEventType, MaxAdContentRating, unitIdProperty, BannerAdSizeBase, sizeProperty } from './common';
-
-export { MaxAdContentRating, AdEventType };
-
-export * from './adsconsent';
-export * from './nativead';
-
-export class AdmobError extends Error {
- _native: java.lang.Exception;
- static fromNative(native: java.lang.Exception, message?: string) {
- const error = new AdmobError(message || native?.getMessage?.());
- error._native = native;
- return error;
- }
-
- get native() {
- return this._native;
- }
-
- intoNative() {
- if (!this._native) {
- return new java.lang.Exception(this.message);
- }
- return this._native;
- }
-}
-
-let defaultAdmob: Admob;
-
-if (!global.__admob) {
- Object.defineProperty(global, '__admob', {
- value: () => {
- if (!defaultAdmob) {
- defaultAdmob = new Admob();
- }
- return defaultAdmob;
- },
- writable: false,
- });
-}
-
-@NativeClass()
-class AdListener extends com.google.android.gms.ads.AdListener {
- _owner: WeakRef;
-
- constructor(owner: WeakRef) {
- super();
- this._owner = owner;
- return global.__native(this);
- }
-
- onAdLoaded() {
- const owner = this._owner?.get?.();
- if (!owner) {
- return;
- }
- owner.notify({
- eventName: BannerAd.onAdLoadedEvent,
- object: owner,
- });
- }
-
- onAdClicked() {
- const owner = this._owner?.get?.();
- if (!owner) {
- return;
- }
- owner.notify({
- eventName: BannerAd.onAdClickedEvent,
- object: owner,
- });
- }
-
- onAdFailedToLoad(error: com.google.android.gms.ads.LoadAdError) {
- const owner = this._owner?.get?.();
- if (!owner) {
- return;
- }
- owner.notify({
- eventName: BannerAd.onAdFailedToLoadEvent,
- object: owner,
- error: AdmobError.fromNative(error as any),
- });
- }
-
- onAdClosed() {
- const owner = this._owner?.get?.();
- if (!owner) {
- return;
- }
- owner.notify({
- eventName: BannerAd.onAdClosedEvent,
- object: owner,
- });
- }
-
- onAdImpression() {
- const owner = this._owner?.get?.();
- if (!owner) {
- return;
- }
- owner.notify({
- eventName: BannerAd.onAdImpression,
- object: owner,
- });
- }
-
- onAdOpened() {
- const owner = this._owner?.get?.();
- if (!owner) {
- return;
- }
- owner.notify({
- eventName: BannerAd.onAdOpenedEvent,
- object: owner,
- });
- }
-}
-
-export class AdRequest {
- _native: com.google.android.gms.ads.AdRequest;
-
- static fromNative(request: com.google.android.gms.ads.AdRequest) {
- if (request instanceof com.google.android.gms.ads.AdRequest) {
- const ret = new AdRequest();
- ret._native = request;
- return ret;
- }
- return null;
- }
-
- get contentUrl(): string {
- return this.native.getContentUrl();
- }
-
- get keywords(): string[] {
- const kw = this.native.getKeywords().toArray();
- const count = kw.length;
- const ret = [];
- for (let i = 0; i < count; i++) {
- ret.push(kw[i]);
- }
- return ret;
- }
-
- get neighboringContentUrls(): string[] {
- const urls = this.native.getNeighboringContentUrls();
- const count = urls.size();
- const ret = [];
- for (let i = 0; i < count; i++) {
- ret.push(urls.get(i));
- }
- return ret;
- }
-
- isTestDevice(): boolean {
- return this.native.isTestDevice(Utils.android.getApplicationContext());
- }
-
- get native() {
- return this._native;
- }
-
- get android() {
- return this.native;
- }
-}
-
-export class InterstitialAd implements IInterstitialAd {
- _native: com.google.android.gms.ads.interstitial.InterstitialAd;
- _adUnitId: string;
- _requestOptions?: RequestOptions;
- _loaded = false;
- _nativeRequest: com.google.android.gms.ads.AdRequest;
-
- static createForAdRequest(adUnitId: string, requestOptions?: RequestOptions): InterstitialAd {
- const ad = new InterstitialAd();
- ad._adUnitId = adUnitId;
- ad._requestOptions = requestOptions;
- return ad;
- }
-
- get adUnitId(): string {
- return this._adUnitId;
- }
-
- _setNative(value) {
- this._native = value;
- }
-
- _setLoaded(value) {
- this._loaded = value;
- }
-
- _onAdEvent?: AdEventListener;
-
- get loaded(): boolean {
- return this._loaded;
- }
-
- load(): void {
- const ref = new WeakRef(this);
- this._nativeRequest = org.nativescript.firebase.admob.FirebaseAdmob.InterstitialAd.load(
- Application.android.foregroundActivity || Application.android.startActivity,
- this._adUnitId,
- JSON.stringify(this._requestOptions || {}),
- new org.nativescript.firebase.admob.FirebaseAdmob.AdCallback({
- onEvent(event: string, dataOrError: any) {
- const owner = ref.get?.();
- switch (event) {
- case AdEventType.LOADED:
- owner._setNative?.(dataOrError);
- owner?._onAdEvent(AdEventType.LOADED, null, owner);
- owner?._setLoaded(true);
- break;
- case AdEventType.CLOSED:
- owner?._onAdEvent(AdEventType.CLOSED, null, owner);
- owner?._setLoaded(false);
- break;
- case AdEventType.FAILED_TO_SHOW_FULL_SCREEN_CONTENT:
- owner?._onAdEvent(AdEventType.FAILED_TO_SHOW_FULL_SCREEN_CONTENT, AdmobError.fromNative(dataOrError), owner);
- break;
- case AdEventType.IMPRESSION:
- owner?._onAdEvent(AdEventType.IMPRESSION, null, owner);
- break;
- case AdEventType.OPENED:
- owner?._onAdEvent(AdEventType.OPENED, null, owner);
- break;
- case AdEventType.FAILED_TO_LOAD_EVENT:
- owner?._onAdEvent(AdEventType.FAILED_TO_LOAD_EVENT, AdmobError.fromNative(dataOrError), owner);
- break;
- }
- },
- })
- );
- }
-
- onAdEvent(listener: AdEventListener) {
- this._onAdEvent = listener;
- }
-
- show(showOptions?: AdShowOptions) {
- if (typeof showOptions?.immersiveModeEnabled === 'boolean') {
- this.native.setImmersiveMode(showOptions?.immersiveModeEnabled);
- }
- this.native.show(Application.android.foregroundActivity || Application.android.startActivity);
- }
-
- get native() {
- return this._native;
- }
-
- get android() {
- return this.native;
- }
-
- get request() {
- return AdRequest.fromNative(this._nativeRequest);
- }
-}
-
-export class RewardedInterstitialAd implements IRewardedInterstitialAd {
- _native: com.google.android.gms.ads.rewardedinterstitial.RewardedInterstitialAd;
- _adUnitId: string;
- _requestOptions?: RequestOptions;
- _loaded = false;
- _nativeRequest: com.google.android.gms.ads.AdRequest;
-
- static createForAdRequest(adUnitId: string, requestOptions?: RequestOptions): RewardedInterstitialAd {
- const ad = new RewardedInterstitialAd();
- ad._adUnitId = adUnitId;
- ad._requestOptions = requestOptions;
- return ad;
- }
-
- get adUnitId(): string {
- return this._adUnitId;
- }
-
- _setNative(value) {
- this._native = value;
- }
-
- _setLoaded(value) {
- this._loaded = value;
- }
-
- get loaded(): boolean {
- return this._loaded;
- }
-
- load(): void {
- const ref = new WeakRef(this);
- this._nativeRequest = org.nativescript.firebase.admob.FirebaseAdmob.RewardedInterstitialAd.load(
- Application.android.foregroundActivity || Application.android.startActivity,
- this._adUnitId,
- JSON.stringify(this._requestOptions || {}),
- new org.nativescript.firebase.admob.FirebaseAdmob.AdCallback({
- onEvent(event: string, dataOrError: any) {
- const owner = ref.get?.();
- switch (event) {
- case AdEventType.LOADED:
- owner._setNative?.(dataOrError);
- owner?._onAdEvent(AdEventType.LOADED, null, owner);
- owner?._setLoaded(true);
- break;
- case AdEventType.CLOSED:
- owner?._onAdEvent(AdEventType.CLOSED, null, owner);
- owner?._setLoaded(false);
- break;
- case AdEventType.FAILED_TO_SHOW_FULL_SCREEN_CONTENT:
- owner?._onAdEvent(AdEventType.FAILED_TO_SHOW_FULL_SCREEN_CONTENT, AdmobError.fromNative(dataOrError), owner);
- break;
- case AdEventType.IMPRESSION:
- owner?._onAdEvent(AdEventType.IMPRESSION, null, owner);
- break;
- case AdEventType.OPENED:
- owner?._onAdEvent(AdEventType.OPENED, null, owner);
- break;
- case AdEventType.FAILED_TO_LOAD_EVENT:
- owner?._onAdEvent(AdEventType.FAILED_TO_LOAD_EVENT, AdmobError.fromNative(dataOrError), owner);
- break;
- }
- },
- })
- );
- }
-
- _onAdEvent: AdEventListener;
-
- onAdEvent(listener: AdEventListener) {
- this._onAdEvent = listener;
- }
-
- show(showOptions?: AdShowOptions) {
- if (typeof showOptions?.immersiveModeEnabled === 'boolean') {
- this.native.setImmersiveMode(showOptions?.immersiveModeEnabled);
- }
- const ref = new WeakRef(this);
- org.nativescript.firebase.admob.FirebaseAdmob.RewardedInterstitialAd.show(
- Application.android.foregroundActivity || Application.android.startActivity,
- this.native,
- new org.nativescript.firebase.admob.FirebaseAdmob.Callback({
- onSuccess(reward): void {
- ref.get()?._onAdEvent?.(RewardedAdEventType.EARNED_REWARD, null, RewardedItem.fromNative(reward));
- },
- onError(error): void {},
- })
- );
- }
-
- setServerSideVerificationOptions(options: ServerSideVerificationOptions): void {
- if (this.native) {
- const ssvo = new com.google.android.gms.ads.rewarded.ServerSideVerificationOptions.Builder();
- if (options.customData) {
- ssvo.setCustomData(options.customData);
- }
- if (options.userId) {
- ssvo.setUserId(options.userId);
- }
- this.native.setServerSideVerificationOptions(ssvo.build());
- }
- }
-
- get native() {
- return this._native;
- }
-
- get android() {
- return this.native;
- }
-
- get request() {
- return AdRequest.fromNative(this._nativeRequest);
- }
-}
-
-export class RewardedAd implements IRewardedAd {
- _native: com.google.android.gms.ads.rewarded.RewardedAd;
- _adUnitId: string;
- _requestOptions?: RequestOptions;
- _loaded = false;
- _nativeRequest: com.google.android.gms.ads.AdRequest;
-
- static createForAdRequest(adUnitId: string, requestOptions?: RequestOptions): RewardedAd {
- const reward = new RewardedAd();
- reward._adUnitId = adUnitId;
- reward._requestOptions = requestOptions;
- return reward;
- }
-
- get adUnitId(): string {
- return this._adUnitId;
- }
-
- get loaded(): boolean {
- return this._loaded;
- }
-
- _setNative(value) {
- this._native = value;
- }
-
- _setLoaded(value) {
- this._loaded = value;
- }
-
- load(): void {
- const ref = new WeakRef(this);
- this._nativeRequest = org.nativescript.firebase.admob.FirebaseAdmob.RewardedAd.load(
- Application.android.foregroundActivity || Application.android.startActivity,
- this.adUnitId,
- JSON.stringify(this._requestOptions || {}),
- new org.nativescript.firebase.admob.FirebaseAdmob.AdCallback({
- onEvent(event: string, dataOrError: any) {
- const owner = ref.get?.();
- if (!owner) {
- return;
- }
- switch (event) {
- case AdEventType.LOADED:
- owner._setNative(dataOrError);
- owner._onAdEvent(AdEventType.LOADED, null, owner);
- owner._setLoaded(true);
- break;
- case AdEventType.CLOSED:
- owner._onAdEvent(AdEventType.CLOSED, null, owner);
- owner._setLoaded(false);
- break;
- case AdEventType.FAILED_TO_SHOW_FULL_SCREEN_CONTENT:
- owner._onAdEvent(AdEventType.FAILED_TO_SHOW_FULL_SCREEN_CONTENT, AdmobError.fromNative(dataOrError), owner);
- break;
- case AdEventType.IMPRESSION:
- owner._onAdEvent(AdEventType.IMPRESSION, null, owner);
- break;
- case AdEventType.OPENED:
- owner._onAdEvent(AdEventType.OPENED, null, owner);
- break;
- case AdEventType.FAILED_TO_LOAD_EVENT:
- owner._onAdEvent(AdEventType.FAILED_TO_LOAD_EVENT, AdmobError.fromNative(dataOrError), owner);
- break;
- }
- },
- })
- );
- }
-
- _onAdEvent: AdEventListener;
-
- onAdEvent(listener: AdEventListener) {
- this._onAdEvent = listener;
- }
-
- show(showOptions?: AdShowOptions) {
- if (typeof showOptions?.immersiveModeEnabled === 'boolean') {
- this.native.setImmersiveMode(showOptions?.immersiveModeEnabled);
- }
- const ref = new WeakRef(this);
- org.nativescript.firebase.admob.FirebaseAdmob.RewardedAd.show(
- Application.android.foregroundActivity || Application.android.startActivity,
- this.native,
- new org.nativescript.firebase.admob.FirebaseAdmob.Callback({
- onSuccess(reward): void {
- ref.get()?._onAdEvent?.(RewardedAdEventType.EARNED_REWARD, null, RewardedItem.fromNative(reward));
- },
- onError(error): void {},
- })
- );
- }
-
- setServerSideVerificationOptions(options: ServerSideVerificationOptions): void {
- if (this.native) {
- const ssvo = new com.google.android.gms.ads.rewarded.ServerSideVerificationOptions.Builder();
- if (options.customData) {
- ssvo.setCustomData(options.customData);
- }
- if (options.userId) {
- ssvo.setUserId(options.userId);
- }
- this.native.setServerSideVerificationOptions(ssvo.build());
- }
- }
-
- get native() {
- return this._native;
- }
-
- get android() {
- return this.native;
- }
-
- get request() {
- return AdRequest.fromNative(this._nativeRequest);
- }
-}
-
-export class RewardedItem implements IRewardedItem {
- _native: com.google.android.gms.ads.rewarded.RewardItem;
-
- static fromNative(reward: com.google.android.gms.ads.rewarded.RewardItem) {
- if (reward instanceof com.google.android.gms.ads.rewarded.RewardItem) {
- const item = new RewardedItem();
- item._native = reward;
- return item;
- }
- return null;
- }
-
- get amount(): number {
- return this.native?.getAmount?.();
- }
-
- get type(): string {
- return this.native?.getType();
- }
-
- get native() {
- return this._native;
- }
-
- get android() {
- return this.native;
- }
-}
-
-const BANNER = lazy(() => com.google.android.gms.ads.AdSize.BANNER);
-const FULL_BANNER = lazy(() => com.google.android.gms.ads.AdSize.FULL_BANNER);
-const LARGE_BANNER = lazy(() => com.google.android.gms.ads.AdSize.LARGE_BANNER);
-const LEADERBOARD = lazy(() => com.google.android.gms.ads.AdSize.LEADERBOARD);
-const MEDIUM_RECTANGLE = lazy(() => com.google.android.gms.ads.AdSize.MEDIUM_RECTANGLE);
-
-const FLUID = lazy(() => com.google.android.gms.ads.AdSize.FLUID);
-const WIDE_SKYSCRAPER = lazy(() => com.google.android.gms.ads.AdSize.WIDE_SKYSCRAPER);
-const SEARCH = lazy(() => com.google.android.gms.ads.AdSize.SEARCH);
-const INVALID = lazy(() => com.google.android.gms.ads.AdSize.INVALID);
-const FULL_WIDTH = lazy(() => com.google.android.gms.ads.AdSize.FULL_WIDTH);
-const AUTO_HEIGHT = lazy(() => com.google.android.gms.ads.AdSize.AUTO_HEIGHT);
-
-export class BannerAdSize extends BannerAdSizeBase {
- _native: com.google.android.gms.ads.AdSize;
-
- constructor(width?: number, height?: number) {
- super();
- if (width && height) {
- this._native = new com.google.android.gms.ads.AdSize(width, height);
- }
- }
-
- static fromNative(size: com.google.android.gms.ads.AdSize) {
- const banner = new BannerAdSize();
- if (size instanceof com.google.android.gms.ads.AdSize) {
- banner._native = size;
- } else {
- banner._native = com.google.android.gms.ads.AdSize.INVALID;
- }
- return banner;
- }
-
- static get BANNER(): BannerAdSize {
- return BannerAdSize.fromNative(BANNER());
- }
-
- static get FULL_BANNER(): BannerAdSize {
- return BannerAdSize.fromNative(FULL_BANNER());
- }
-
- static get LARGE_BANNER(): BannerAdSize {
- return BannerAdSize.fromNative(LARGE_BANNER());
- }
-
- static get LEADERBOARD(): BannerAdSize {
- return BannerAdSize.fromNative(LEADERBOARD());
- }
-
- static get MEDIUM_RECTANGLE(): BannerAdSize {
- return BannerAdSize.fromNative(MEDIUM_RECTANGLE());
- }
-
- static createAnchoredAdaptiveBanner(width: number, orientation: 'portrait' | 'landscape' | 'device' = 'device'): BannerAdSize {
- switch (orientation) {
- case 'portrait':
- return BannerAdSize.fromNative(com.google.android.gms.ads.AdSize.getPortraitAnchoredAdaptiveBannerAdSize(Application.android.foregroundActivity || Application.android.startActivity, width));
- case 'landscape':
- return BannerAdSize.fromNative(com.google.android.gms.ads.AdSize.getLandscapeAnchoredAdaptiveBannerAdSize(Application.android.foregroundActivity || Application.android.startActivity, width));
- default:
- return BannerAdSize.fromNative(com.google.android.gms.ads.AdSize.getCurrentOrientationAnchoredAdaptiveBannerAdSize(Application.android.foregroundActivity || Application.android.startActivity, width));
- }
- }
-
- static createInLineAdaptiveBanner(width: number, maxHeight = 0, orientation: 'portrait' | 'landscape' | 'device' = 'device'): BannerAdSize {
- if (maxHeight > 0) {
- BannerAdSize.fromNative(com.google.android.gms.ads.AdSize.getInlineAdaptiveBannerAdSize(width, maxHeight));
- }
- switch (orientation) {
- case 'portrait':
- return BannerAdSize.fromNative(com.google.android.gms.ads.AdSize.getPortraitInlineAdaptiveBannerAdSize(Application.android.foregroundActivity || Application.android.startActivity, width));
- case 'landscape':
- return BannerAdSize.fromNative(com.google.android.gms.ads.AdSize.getLandscapeInlineAdaptiveBannerAdSize(Application.android.foregroundActivity || Application.android.startActivity, width));
- default:
- return BannerAdSize.fromNative(com.google.android.gms.ads.AdSize.getCurrentOrientationInlineAdaptiveBannerAdSize(Application.android.foregroundActivity || Application.android.startActivity, width));
- }
- }
-
- static get FLUID(): BannerAdSize {
- return BannerAdSize.fromNative(FLUID());
- }
-
- static get WIDE_SKYSCRAPER(): BannerAdSize {
- return BannerAdSize.fromNative(WIDE_SKYSCRAPER());
- }
-
- static get INVALID(): BannerAdSize {
- return BannerAdSize.fromNative(INVALID());
- }
-
- static get SEARCH(): BannerAdSize {
- return BannerAdSize.fromNative(SEARCH());
- }
-
- get native() {
- return this._native;
- }
-
- get android() {
- return this.native;
- }
-}
-
-export class BannerAd extends BannerAdBase {
- _native: com.google.android.gms.ads.AdView;
- _listener;
- _nativeRequest: com.google.android.gms.ads.AdRequest;
- [sizeProperty.setNative](value) {
- if (this._native) {
- this._native.setAdSize(value?.native);
- }
- }
-
- [unitIdProperty.setNative](value) {
- if (this._native) {
- this._native.setAdUnitId(value);
- }
- }
-
- createNativeView() {
- this._native = new com.google.android.gms.ads.AdView(this._context);
- return this._native;
- }
-
- initNativeView() {
- super.initNativeView();
- this._listener = new AdListener(new WeakRef(this));
- this._native.setAdListener(this._listener);
- }
-
- load(options?: RequestOptions) {
- if (this._native) {
- this._nativeRequest = org.nativescript.firebase.admob.FirebaseAdmob.BannerAd.load(JSON.stringify(options || {}), this._native);
- }
- }
-
- isLoading(): boolean {
- return this._native?.isLoading?.();
- }
-
- get request() {
- return AdRequest.fromNative(this._nativeRequest);
- }
-}
-
-export class Admob implements IAdmob {
- constructor() {
- if (defaultAdmob) {
- return defaultAdmob;
- }
- defaultAdmob = this as Admob;
- }
-
- static init(): Promise<{ [key: string]: AdapterStatus }> {
- return new Promise((resolve, reject) => {
- com.google.android.gms.ads.MobileAds.initialize(
- Utils.android.getApplicationContext(),
- new com.google.android.gms.ads.initialization.OnInitializationCompleteListener({
- onInitializationComplete(status: com.google.android.gms.ads.initialization.InitializationStatus) {
- let data = {};
- try {
- data = JSON.parse(org.nativescript.firebase.admob.FirebaseAdmob.toJSONStatusMap(status.getAdapterStatusMap()));
- } catch (e) {}
- resolve(data);
- },
- })
- );
- });
- }
-
- static getInstance(): Admob {
- return new Admob();
- }
-
- set requestConfiguration(requestConfiguration: RequestConfiguration) {
- try {
- const parsedConfiguration: any = { ...requestConfiguration };
- if (typeof parsedConfiguration.tagForChildDirectedTreatment === 'boolean') {
- parsedConfiguration.tagForChildDirectedTreatment = String(parsedConfiguration.tagForChildDirectedTreatment);
- } else {
- parsedConfiguration.tagForChildDirectedTreatment = 'unspecified';
- }
-
- if (typeof parsedConfiguration.tagForUnderAgeOfConsent === 'boolean') {
- parsedConfiguration.tagForUnderAgeOfConsent = String(parsedConfiguration.tagForUnderAgeOfConsent);
- } else {
- parsedConfiguration.tagForUnderAgeOfConsent = 'unspecified';
- }
- org.nativescript.firebase.admob.FirebaseAdmob.setRequestConfiguration(JSON.stringify(requestConfiguration));
- } catch (e) {}
- }
-
- get requestConfiguration(): RequestConfiguration {
- const ret: RequestConfiguration = {};
- const config = com.google.android.gms.ads.MobileAds.getRequestConfiguration();
-
- switch (config.getTagForChildDirectedTreatment()) {
- case com.google.android.gms.ads.RequestConfiguration.TAG_FOR_CHILD_DIRECTED_TREATMENT_TRUE:
- ret.tagForChildDirectedTreatment = true;
- break;
- case com.google.android.gms.ads.RequestConfiguration.TAG_FOR_CHILD_DIRECTED_TREATMENT_FALSE:
- ret.tagForChildDirectedTreatment = false;
- break;
- default:
- // noop
- break;
- }
-
- switch (config.getTagForUnderAgeOfConsent()) {
- case com.google.android.gms.ads.RequestConfiguration.TAG_FOR_UNDER_AGE_OF_CONSENT_TRUE:
- ret.tagForUnderAgeOfConsent = true;
- break;
- case com.google.android.gms.ads.RequestConfiguration.TAG_FOR_UNDER_AGE_OF_CONSENT_FALSE:
- ret.tagForUnderAgeOfConsent = false;
- break;
- default:
- // noop
- break;
- }
-
- switch (config.getMaxAdContentRating()) {
- case com.google.android.gms.ads.RequestConfiguration.MAX_AD_CONTENT_RATING_G:
- ret.maxAdContentRating = MaxAdContentRating.G;
- break;
- case com.google.android.gms.ads.RequestConfiguration.MAX_AD_CONTENT_RATING_MA:
- ret.maxAdContentRating = MaxAdContentRating.MA;
- break;
- case com.google.android.gms.ads.RequestConfiguration.MAX_AD_CONTENT_RATING_PG:
- ret.maxAdContentRating = MaxAdContentRating.PG;
- break;
- case com.google.android.gms.ads.RequestConfiguration.MAX_AD_CONTENT_RATING_T:
- ret.maxAdContentRating = MaxAdContentRating.T;
- break;
- default:
- // noop
- break;
- }
-
- ret.testDevices = [];
-
- const devices = config.getTestDeviceIds();
- if (devices) {
- const count = devices.size();
- for (let i = 0; i < count; i++) {
- ret.testDevices.push(devices.get(i));
- }
- }
- return ret;
- }
-
- setRequestConfiguration(requestConfiguration: RequestConfiguration) {
- this.requestConfiguration = requestConfiguration;
- }
- getRequestConfiguration(): RequestConfiguration {
- return this.requestConfiguration;
- }
-
- get app() {
- return global?.__defaultFirebaseApp;
- }
-}
diff --git a/packages/firebase-admob/index.d.ts b/packages/firebase-admob/index.d.ts
deleted file mode 100644
index 5d350a0e..00000000
--- a/packages/firebase-admob/index.d.ts
+++ /dev/null
@@ -1,244 +0,0 @@
-import { Application } from '@nativescript/core';
-
-import { IAdmob, IInterstitialAd, IRewardedAd, BannerAdBase, IRewardedInterstitialAd, RewardedAdEventType, MaxAdContentRating, ServerSideVerificationOptions } from './common';
-
-export { MaxAdContentRating, RewardedAdEventType };
-
-export type AdEventListener = (type: AdEventType | RewardedAdEventType, error?: Error, data?: any | IRewardedItem) => void;
-
-export * from './adsconsent';
-export * from './nativead';
-
-export interface AdShowOptions {
- immersiveModeEnabled: undefined | false | true;
-}
-
-export interface RequestConfiguration {
- maxAdContentRating?: MaxAdContentRating.G | MaxAdContentRating.PG | MaxAdContentRating.T | MaxAdContentRating.MA;
- tagForChildDirectedTreatment?: undefined | false | true;
- tagForUnderAgeOfConsent?: undefined | false | true;
- testDevices?: string[];
-}
-
-export interface RequestOptions {
- contentUrl?: undefined | string;
- keywords?: string[];
- networkExtras?: undefined | { [key: string]: string };
- requestAgent?: undefined | string;
- requestNonPersonalizedAdsOnly?: undefined | false | true;
-}
-
-export interface ManagerRequestOptions extends RequestOptions {
- publisherProvidedId?: string;
- customTargeting?: { [key: string]: string | string[] };
- categoryExclusions?: string[];
- adString?: string;
-}
-
-export interface IRewardedItem {
- amount: number;
- type: string;
-}
-
-export interface TestIds {
- BANNER: string;
- INTERSTITIAL: string;
- REWARDED: string;
-}
-
-export interface IAdmob {
- app: FirebaseApp;
-
- setRequestConfiguration(requestConfiguration: RequestConfiguration);
-}
-
-export interface AdapterStatus {
- description: string;
- latency: number;
- initializationState: AdapterStatusState;
-}
-
-export interface IMobileAd {
- adUnitId: string;
- loaded: boolean;
-
- load(): void;
-
- onAdEvent(listener?: AdEventListener);
-
- show(showOptions?: AdShowOptions);
-}
-
-export interface IRewardedInterstitialAd extends IInterstitialAd {
- setServerSideVerificationOptions(options: ServerSideVerificationOptions): void;
-}
-
-export interface ServerSideVerificationOptions {
- userId: string;
- customData: string;
-}
-
-export interface IInterstitialAd extends IMobileAd {}
-
-export interface IRewardedAd extends IMobileAd {
- setServerSideVerificationOptions(options: ServerSideVerificationOptions): void;
-}
-
-export declare class AdRequest {
- readonly contentUrl: string;
-
- readonly keywords: string[];
-
- readonly neighboringContentUrls: string[];
-
- readonly native: any;
- readonly android: any;
- readonly ios: any;
-
- isTestDevice(): boolean;
-}
-
-export declare class InterstitialAd implements IInterstitialAd {
- static createForAdRequest(adUnitId: string): InterstitialAd;
- static createForAdRequest(adUnitId: string, requestOptions?: RequestOptions): InterstitialAd;
-
- readonly adUnitId: string;
- readonly loaded: boolean;
-
- load(): void;
-
- onAdEvent(listener: AdEventListener);
-
- show(showOptions?: AdShowOptions);
-
- readonly native: any;
- readonly android: any;
- readonly ios: any;
-}
-
-export declare class RewardedInterstitialAd implements IRewardedInterstitialAd {
- static createForAdRequest(adUnitId: string): RewardedInterstitialAd;
- static createForAdRequest(adUnitId: string, requestOptions?: RequestOptions): RewardedInterstitialAd;
-
- readonly adUnitId: string;
- readonly loaded: boolean;
-
- load(): void;
-
- onAdEvent(listener: AdEventListener);
-
- show(showOptions?: AdShowOptions);
-
- setServerSideVerificationOptions(options: ServerSideVerificationOptions): void;
-
- readonly native: any;
- readonly android: any;
- readonly ios: any;
-}
-
-export declare class RewardedAd implements IRewardedAd {
- static createForAdRequest(adUnitId: string): RewardedAd;
- static createForAdRequest(adUnitId: string, requestOptions?: RequestOptions): RewardedAd;
-
- readonly adUnitId: string;
- readonly loaded: boolean;
-
- load(): void;
-
- onAdEvent(listener: AdEventListener);
-
- show(showOptions?: AdShowOptions);
-
- setServerSideVerificationOptions(options: ServerSideVerificationOptions): void;
-
- readonly native: any;
- readonly android: any;
- readonly ios: any;
-}
-
-export declare class RewardedItem implements IRewardedItem {
- readonly amount: number;
-
- readonly type: string;
-
- readonly native: any;
- readonly android: any;
- readonly ios: any;
-}
-
-export declare class BannerAd extends BannerAdBase {
- size: BannerAdSize;
-
- unitId: string;
-
- load(options?: RequestOptions);
-
- isLoading(): boolean;
-
- on(event: 'adClicked', callback: (args: any) => void, thisArg?: any);
- on(event: 'adLoaded', callback: (args: any) => void, thisArg?: any);
- on(event: 'adClosed', callback: (args: any) => void, thisArg?: any);
- on(event: 'adImpression', callback: (args: any) => void, thisArg?: any);
- on(event: 'adFailedToLoad', callback: (args: any) => void, thisArg?: any);
-}
-
-export declare class BannerAdSize extends BannerAdSizeBase {
- constructor(width: number, height: number);
-
- static readonly BANNER: BannerAdSize;
-
- static readonly FULL_BANNER: BannerAdSize;
-
- static readonly LARGE_BANNER: BannerAdSize;
-
- static readonly LEADERBOARD: BannerAdSize;
-
- static readonly MEDIUM_RECTANGLE: BannerAdSize;
-
- static readonly FLUID: BannerAdSize;
-
- static readonly WIDE_SKYSCRAPER: BannerAdSize;
-
- static readonly INVALID: BannerAdSize;
-
- static readonly SEARCH: BannerAdSize;
-
- static createAnchoredAdaptiveBanner(width: number, orientation: 'portrait' | 'landscape' | 'device' = 'device'): BannerAdSize;
-
- static createInLineAdaptiveBanner(width: number, maxHeight: number = 0, orientation: 'portrait' | 'landscape' | 'device' = 'device'): BannerAdSize;
-
- readonly native: any;
- readonly android: any;
- readonly ios: any;
-}
-
-export declare class Admob implements IAdmob {
- readonly app: any;
-
- static init(): Promise<{ [key: string]: AdapterStatus }>;
-
- static getInstance(): Admob;
-
- requestConfiguration: RequestConfiguration;
-
- /**
- * @deprecated Use requestConfiguration
- */
- setRequestConfiguration(requestConfiguration: RequestConfiguration);
-
- /**
- * @deprecated Use requestConfiguration
- */
- getRequestConfiguration(requestConfiguration: RequestConfiguration);
-}
-
-export enum AdapterStatusState {
- NOT_READY,
- READY,
-}
-
-export interface AdapterStatus {
- description: string;
- latency: number;
- initializationState: AdapterStatusState;
-}
diff --git a/packages/firebase-admob/index.ios.ts b/packages/firebase-admob/index.ios.ts
deleted file mode 100644
index f6e6fd5e..00000000
--- a/packages/firebase-admob/index.ios.ts
+++ /dev/null
@@ -1,724 +0,0 @@
-import { Utils } from '@nativescript/core';
-import { IAdmob, AdEventListener, RequestConfiguration, AdShowOptions, IInterstitialAd, RequestOptions, IRewardedAd, ServerSideVerificationOptions, IRewardedInterstitialAd, IRewardedItem, AdapterStatus } from '.';
-import { MaxAdContentRating, AdEventType, BannerAdBase, RewardedAdEventType, unitIdProperty, BannerAdSizeBase, sizeProperty } from './common';
-import { topViewController, toSerializeRequestOptions } from './utils';
-
-export { MaxAdContentRating, AdEventType };
-
-export * from './adsconsent';
-export * from './nativead';
-
-export class AdmobError extends Error {
- _native: NSError;
- static fromNative(native: NSError, message?: string) {
- const error = new AdmobError(message || native?.localizedDescription);
- error._native = native;
- return error;
- }
-
- get native() {
- return this._native;
- }
-
- intoNative() {
- if (!this._native) {
- const exception = NSException.exceptionWithNameReasonUserInfo(NSGenericException, this.message, null);
- const info = {};
- info['ExceptionName'] = exception.name;
- info['ExceptionReason'] = exception.reason;
- info['ExceptionCallStackReturnAddresses'] = exception.callStackReturnAddresses;
- info['ExceptionCallStackSymbols'] = exception.callStackSymbols;
- info['ExceptionUserInfo'] = exception.userInfo;
- const error = NSError.alloc().initWithDomainCodeUserInfo('NativeScript', 1000, info as any);
- return error;
- }
- return this._native;
- }
-}
-
-let defaultAdmob: Admob;
-
-if (!global.__admob) {
- Object.defineProperty(global, '__admob', {
- value: () => {
- if (!defaultAdmob) {
- defaultAdmob = new Admob();
- }
- return defaultAdmob;
- },
- writable: false,
- });
-}
-
-export class AdRequest {
- _native: GADRequest;
-
- static fromNative(request: GADRequest) {
- if (request instanceof GADRequest) {
- const ret = new AdRequest();
- ret._native = request;
- return ret;
- }
- return null;
- }
-
- get contentUrl(): string {
- return this._native.contentURL;
- }
-
- get keywords(): string[] {
- const kw = this._native.keywords;
- const count = kw.count;
- const ret = [];
- for (let i = 0; i < count; i++) {
- ret.push(kw.objectAtIndex(i));
- }
- return ret;
- }
-
- get neighboringContentUrls(): string[] {
- const urls = this._native.keywords;
- const count = urls.count;
- const ret = [];
- for (let i = 0; i < count; i++) {
- ret.push(urls.objectAtIndex(i));
- }
- return ret;
- }
-
- isTestDevice(): boolean {
- // todo
- return false;
- }
-
- get native() {
- return this._native;
- }
-
- get ios() {
- return this.native;
- }
-}
-
-export class InterstitialAd implements IInterstitialAd {
- _native: GADInterstitialAd;
- _adUnitId: string;
- _requestOptions?: RequestOptions;
- _delegate: GADFullScreenContentDelegateImpl;
- _loaded = false;
- _nativeRequest: GADRequest;
-
- static createForAdRequest(adUnitId: string, requestOptions?: RequestOptions): InterstitialAd {
- const ad = new InterstitialAd();
- ad._adUnitId = adUnitId;
- ad._requestOptions = requestOptions;
- ad._delegate = GADFullScreenContentDelegateImpl.initWithOwner(new WeakRef(ad));
- return ad;
- }
-
- get adUnitId(): string {
- return this._adUnitId;
- }
-
- get loaded(): boolean {
- return this._loaded;
- }
-
- load(): void {
- const ref = new WeakRef(this);
- const request = toSerializeRequestOptions(this._requestOptions);
- GADInterstitialAd.loadWithAdUnitIDRequestCompletionHandler(this._adUnitId, request, (ad, error) => {
- if (error) {
- ref.get()?._onAdEvent?.(AdEventType.FAILED_TO_LOAD_EVENT, AdmobError.fromNative(error));
- } else {
- ad.fullScreenContentDelegate = ref.get()?._delegate;
- ref.get()?._setNative(ad);
- ref.get()?._setLoaded(true);
- ref.get()?._onAdEvent?.(AdEventType.LOADED);
- }
- });
- this._nativeRequest = request;
- }
-
- _setNative(value) {
- this._native = value;
- }
-
- _setLoaded(value) {
- this._loaded = value;
- }
-
- _onAdEvent: AdEventListener;
-
- onAdEvent(listener: AdEventListener) {
- this._onAdEvent = listener;
- }
-
- show(showOptions?: AdShowOptions) {
- this._native.presentFromRootViewController(topViewController());
- }
-
- get request() {
- return AdRequest.fromNative(this._nativeRequest);
- }
-}
-
-export class RewardedInterstitialAd implements IRewardedInterstitialAd {
- _native: GADRewardedInterstitialAd;
- _adUnitId: string;
- _requestOptions?: RequestOptions;
- _loaded = false;
- _delegate: GADFullScreenContentDelegateImpl;
- _nativeRequest: GADRequest;
-
- static createForAdRequest(adUnitId: string, requestOptions?: RequestOptions): RewardedInterstitialAd {
- const ad = new RewardedInterstitialAd();
- ad._adUnitId = adUnitId;
- ad._requestOptions = requestOptions;
- ad._delegate = GADFullScreenContentDelegateImpl.initWithOwner(new WeakRef(ad));
- return ad;
- }
-
- get adUnitId(): string {
- return this._adUnitId;
- }
-
- get loaded(): boolean {
- return this._loaded;
- }
-
- load(): void {
- const ref = new WeakRef(this);
- const request = toSerializeRequestOptions(this._requestOptions);
- GADRewardedInterstitialAd.loadWithAdUnitIDRequestCompletionHandler(this._adUnitId, request, (ad, error) => {
- if (error) {
- ref.get()?._onAdEvent?.(AdEventType.FAILED_TO_LOAD_EVENT, AdmobError.fromNative(error));
- } else {
- ad.fullScreenContentDelegate = ref.get()?._delegate;
- ref.get()?._setNative(ad);
- ref.get()?._setLoaded(true);
- ref.get()?._onAdEvent?.(AdEventType.LOADED);
- }
- });
- this._nativeRequest = request;
- }
-
- _setNative(value) {
- this._native = value;
- }
-
- _setLoaded(value) {
- this._loaded = value;
- }
-
- _onAdEvent: AdEventListener;
-
- onAdEvent(listener: AdEventListener) {
- this._onAdEvent = listener;
- }
-
- show(showOptions?: AdShowOptions) {
- this.native.presentFromRootViewControllerUserDidEarnRewardHandler(topViewController(), () => {
- this._onAdEvent?.(RewardedAdEventType.EARNED_REWARD, null, RewardedItem.fromNative(this.native.adReward));
- });
- }
-
- setServerSideVerificationOptions(options: ServerSideVerificationOptions): void {
- if (this.native) {
- const ssvo = GADServerSideVerificationOptions.new();
- if (options.customData) {
- ssvo.customRewardString = options.customData;
- }
- if (options.userId) {
- ssvo.userIdentifier = options.userId;
- }
- this.native.serverSideVerificationOptions = ssvo;
- }
- }
-
- get native() {
- return this._native;
- }
-
- get ios() {
- return this.native;
- }
-
- get request() {
- return AdRequest.fromNative(this._nativeRequest);
- }
-}
-
-export class RewardedAd implements IRewardedAd {
- _native: GADRewardedAd;
- _adUnitId: string;
- _requestOptions?: RequestOptions;
- _delegate: GADFullScreenContentDelegateImpl;
- _loaded = false;
- _nativeRequest: GADRequest;
- get loaded() {
- return this._loaded;
- }
-
- static createForAdRequest(adUnitId: string, requestOptions?: RequestOptions): RewardedAd {
- const reward = new RewardedAd();
- reward._adUnitId = adUnitId;
- reward._requestOptions = requestOptions;
- reward._delegate = GADFullScreenContentDelegateImpl.initWithOwner(new WeakRef(reward));
- return reward;
- }
-
- get adUnitId(): string {
- return this._adUnitId;
- }
-
- load(): void {
- const request = toSerializeRequestOptions(this._requestOptions);
- const ref = new WeakRef(this);
- GADRewardedAd.loadWithAdUnitIDRequestCompletionHandler(this._adUnitId, request, (ad, error) => {
- if (error) {
- ref.get()?._onAdEvent?.(AdEventType.FAILED_TO_LOAD_EVENT, AdmobError.fromNative(error));
- } else {
- ad.fullScreenContentDelegate = ref.get()?._delegate;
- ref.get()?._setNative(ad);
- ref.get()?._setLoaded(true);
- ref.get()?._onAdEvent?.(AdEventType.LOADED);
- }
- });
- this._nativeRequest = request;
- }
-
- _setNative(value) {
- this._native = value;
- }
-
- _setLoaded(value) {
- this._loaded = value;
- }
-
- _onAdEvent: AdEventListener;
-
- onAdEvent(listener: AdEventListener) {
- this._onAdEvent = listener;
- }
-
- show(showOptions?: AdShowOptions) {
- this.native.presentFromRootViewControllerUserDidEarnRewardHandler(topViewController(), () => {
- this._onAdEvent?.(RewardedAdEventType.EARNED_REWARD, null, RewardedItem.fromNative(this.native.adReward));
- });
- }
-
- setServerSideVerificationOptions(options: ServerSideVerificationOptions): void {
- if (this.native) {
- const ssvo = GADServerSideVerificationOptions.new();
- if (options.customData) {
- ssvo.customRewardString = options.customData;
- }
- if (options.userId) {
- ssvo.userIdentifier = options.userId;
- }
- this.native.serverSideVerificationOptions = ssvo;
- }
- }
-
- get native() {
- return this._native;
- }
-
- get ios() {
- return this.native;
- }
-
- get request() {
- return AdRequest.fromNative(this._nativeRequest);
- }
-}
-
-export class RewardedItem implements IRewardedItem {
- _native: GADAdReward;
-
- static fromNative(reward: GADAdReward) {
- if (reward instanceof GADAdReward) {
- const item = new RewardedItem();
- item._native = reward;
- return item;
- }
- return null;
- }
-
- get amount(): number {
- return this.native?.amount?.floatValue;
- }
-
- get type(): string {
- return this.native?.type;
- }
-
- get native() {
- return this._native;
- }
-
- get android() {
- return this.native;
- }
-}
-
-export class BannerAdSize extends BannerAdSizeBase {
- _native: GADAdSize;
-
- constructor(width: number, height: number, native?) {
- super();
- if (typeof width === 'number' && typeof height === 'number') {
- this._native = GADAdSizeFromCGSize(CGSizeMake(width, height));
- } else if (arguments[2] instanceof GADAdSize) {
- this._native = arguments[2];
- } else {
- this._native = GADAdSizeInvalid;
- }
- }
-
- static fromNative(size: GADAdSize) {
- return new BannerAdSize(null, null, size);
- }
-
- static get BANNER(): BannerAdSize {
- return BannerAdSize.fromNative(TNSGA.createBanner(NSCGABannersSize.Banner));
- }
-
- static get FULL_BANNER(): BannerAdSize {
- return BannerAdSize.fromNative(TNSGA.createBanner(NSCGABannersSize.FullBanner));
- }
-
- static get LARGE_BANNER(): BannerAdSize {
- return BannerAdSize.fromNative(TNSGA.createBanner(NSCGABannersSize.LargeBanner));
- }
-
- static get LEADERBOARD(): BannerAdSize {
- return BannerAdSize.fromNative(TNSGA.createBanner(NSCGABannersSize.LeaderBoard));
- }
-
- static get MEDIUM_RECTANGLE(): BannerAdSize {
- return BannerAdSize.fromNative(TNSGA.createBanner(NSCGABannersSize.MediumRectangle));
- }
-
- static createAnchoredAdaptiveBanner(width: number, orientation: 'portrait' | 'landscape' | 'device' = 'device'): BannerAdSize {
- let nativeOrientation: Orientation = Orientation.Device;
- if (orientation === 'portrait') {
- nativeOrientation = Orientation.Portrait;
- } else if (orientation === 'landscape') {
- nativeOrientation = Orientation.Landscape;
- }
-
- return BannerAdSize.fromNative(TNSGA.createAnchoredAdaptiveBanner(width, nativeOrientation));
- }
-
- static createInLineAdaptiveBanner(width: number, maxHeight: number = 0, orientation: 'portrait' | 'landscape' | 'device' = 'device'): BannerAdSize {
- let nativeOrientation: Orientation = Orientation.Device;
- if (orientation === 'portrait') {
- nativeOrientation = Orientation.Portrait;
- } else if (orientation === 'landscape') {
- nativeOrientation = Orientation.Landscape;
- }
-
- return BannerAdSize.fromNative(TNSGA.createInlineAdaptiveBanner(width, maxHeight, nativeOrientation));
- }
-
- static get FLUID(): BannerAdSize {
- return BannerAdSize.fromNative(TNSGA.createBanner(NSCGABannersSize.Fluid));
- }
-
- static get WIDE_SKYSCRAPER(): BannerAdSize {
- return BannerAdSize.fromNative(TNSGA.createBanner(NSCGABannersSize.WideSkyScraper));
- }
-
- static get INVALID(): BannerAdSize {
- return BannerAdSize.fromNative(TNSGA.createBanner(NSCGABannersSize.Invalid));
- }
-
- static get SEARCH(): BannerAdSize {
- console.error('BannerAdSize', 'SEARCH', 'not supported on iOS');
- return BannerAdSize.INVALID;
- }
-
- get native() {
- return this._native;
- }
-
- get ios() {
- return this.native;
- }
-}
-
-export class BannerAd extends BannerAdBase {
- _isLoading = false;
-
- _setIsLoading(value) {
- this._isLoading = value;
- }
-
- isLoading(): boolean {
- return this._isLoading;
- }
-
- _native: GADBannerView;
- _delegate: GADBannerViewDelegateImpl;
-
- _nativeRequest: GADRequest;
-
- createNativeView() {
- this._native = GADBannerView.new();
- this._delegate = GADBannerViewDelegateImpl.initWithOwner(new WeakRef(this));
- return this._native;
- }
-
- initNativeView() {
- this._native.delegate = this._delegate;
- }
-
- onLoaded() {
- super.onLoaded();
- this._native.rootViewController = topViewController();
- }
-
- load(options: RequestOptions = {}) {
- this._isLoading = true;
- const request = toSerializeRequestOptions(options);
- this._native?.loadRequest?.(request);
- this._nativeRequest = request;
- }
-
- [sizeProperty.setNative](value) {
- if (this._native) {
- this._native.adSize = value?.native;
- }
- }
-
- [unitIdProperty.setNative](value) {
- if (this._native) {
- this._native.adUnitID = value;
- }
- }
-
- public onMeasure(widthMeasureSpec: number, heightMeasureSpec: number) {
- const nativeView = this.nativeView;
- if (nativeView) {
- const width = Utils.layout.getMeasureSpecSize(widthMeasureSpec);
- const height = Utils.layout.getMeasureSpecSize(heightMeasureSpec);
- this.setMeasuredDimension(width, height);
- }
- }
-
- get request() {
- return AdRequest.fromNative(this._nativeRequest);
- }
-}
-
-export class Admob implements IAdmob {
- constructor() {
- if (defaultAdmob) {
- return defaultAdmob;
- }
- defaultAdmob = this;
- }
-
- static init(): Promise<{ [key: string]: AdapterStatus }> {
- return new Promise((resolve, reject) => {
- GADMobileAds.sharedInstance().startWithCompletionHandler((status) => {
- const data = {};
- const keys = status.adapterStatusesByClassName.allKeys;
- const count = keys.count;
- for (let i = 0; i < count; i++) {
- const key = keys.objectAtIndex(i);
- const obj = status.adapterStatusesByClassName.objectForKey(key);
-
- data[key] = {
- description: obj.description,
- latency: obj.latency,
- state: obj.state,
- };
- }
- resolve(data);
- });
- });
- }
-
- static getInstance(): Admob {
- return new Admob();
- }
-
- _requestConfiguration: RequestConfiguration = {};
-
- set requestConfiguration(requestConfiguration: RequestConfiguration) {
- switch (requestConfiguration?.maxAdContentRating) {
- case MaxAdContentRating.G:
- GADMobileAds.sharedInstance().requestConfiguration.maxAdContentRating = GADMaxAdContentRatingGeneral;
- break;
- case MaxAdContentRating.MA:
- GADMobileAds.sharedInstance().requestConfiguration.maxAdContentRating = GADMaxAdContentRatingMatureAudience;
- break;
- case MaxAdContentRating.PG:
- GADMobileAds.sharedInstance().requestConfiguration.maxAdContentRating = GADMaxAdContentRatingParentalGuidance;
- break;
- case MaxAdContentRating.T:
- GADMobileAds.sharedInstance().requestConfiguration.maxAdContentRating = GADMaxAdContentRatingTeen;
- break;
- }
-
- if (typeof requestConfiguration?.tagForChildDirectedTreatment === 'boolean') {
- this._requestConfiguration.tagForChildDirectedTreatment = requestConfiguration.tagForChildDirectedTreatment;
- GADMobileAds.sharedInstance().requestConfiguration.tagForChildDirectedTreatment = Number(requestConfiguration.tagForChildDirectedTreatment);
- }
-
- if (typeof requestConfiguration?.tagForUnderAgeOfConsent === 'boolean') {
- this._requestConfiguration.tagForUnderAgeOfConsent = requestConfiguration.tagForUnderAgeOfConsent;
- GADMobileAds.sharedInstance().requestConfiguration.tagForUnderAgeOfConsent = Number(requestConfiguration.tagForUnderAgeOfConsent);
- }
-
- if (Array.isArray(requestConfiguration?.testDevices)) {
- GADMobileAds.sharedInstance().requestConfiguration.testDeviceIdentifiers = requestConfiguration.testDevices.map((item) => {
- if (item === 'EMULATOR') {
- if (typeof GADSimulatorID) {
- return GADSimulatorID;
- }
- return '';
- }
- return item;
- }) as any;
- }
- }
-
- get requestConfiguration(): RequestConfiguration {
- const ret: RequestConfiguration = Object.assign({}, ...(this._requestConfiguration as any));
-
- const config = GADMobileAds.sharedInstance().requestConfiguration;
-
- switch (config.maxAdContentRating) {
- case GADMaxAdContentRatingGeneral:
- ret.maxAdContentRating = MaxAdContentRating.G;
- break;
- case GADMaxAdContentRatingMatureAudience:
- ret.maxAdContentRating = MaxAdContentRating.MA;
- break;
- case GADMaxAdContentRatingParentalGuidance:
- ret.maxAdContentRating = MaxAdContentRating.PG;
- break;
- case GADMaxAdContentRatingTeen:
- ret.maxAdContentRating = MaxAdContentRating.T;
- break;
- default:
- // noop
- break;
- }
-
- ret.testDevices = [];
-
- const devices = config.testDeviceIdentifiers;
- if (devices) {
- const count = devices.count;
- for (let i = 0; i < count; i++) {
- ret.testDevices.push(devices.objectAtIndex(i));
- }
- }
- return ret;
- }
-
- setRequestConfiguration(requestConfiguration: RequestConfiguration) {
- this.requestConfiguration = requestConfiguration;
- }
-
- getRequestConfiguration(): RequestConfiguration {
- return this.requestConfiguration;
- }
-
- get app() {
- return global?.__defaultFirebaseApp;
- }
-}
-
-@NativeClass
-@ObjCClass(GADFullScreenContentDelegate)
-class GADFullScreenContentDelegateImpl extends NSObject implements GADFullScreenContentDelegate {
- _owner: WeakRef | WeakRef | WeakRef;
-
- static initWithOwner(owner: WeakRef | WeakRef | WeakRef): GADFullScreenContentDelegateImpl {
- const delegate = GADFullScreenContentDelegateImpl.new();
- delegate._owner = owner;
- return delegate;
- }
-
- adDidDismissFullScreenContent(ad: GADFullScreenPresentingAd): void {
- this._owner?.get()?._onAdEvent?.(AdEventType.CLOSED, null, this._owner.get?.());
- this._owner?.get()?._setLoaded(false);
- }
-
- adDidFailToPresentFullScreenContentWithError(ad: GADFullScreenPresentingAd, error: NSError): void {
- this._owner?.get()?._onAdEvent?.(AdEventType.FAILED_TO_SHOW_FULL_SCREEN_CONTENT, AdmobError.fromNative(error), this._owner.get?.());
- }
-
- adDidPresentFullScreenContent(ad: GADFullScreenPresentingAd): void {
- this._owner?.get()?._onAdEvent?.(AdEventType.OPENED, null, this._owner.get?.());
- }
-
- adDidRecordClick(ad: GADFullScreenPresentingAd) {
- this._owner?.get()?._onAdEvent?.(AdEventType.CLICKED, null, this._owner.get?.());
- }
-
- adDidRecordImpression(ad: GADFullScreenPresentingAd): void {
- this._owner?.get()?._onAdEvent?.(AdEventType.IMPRESSION, null, this._owner.get?.());
- }
-
- adWillDismissFullScreenContent(ad: GADFullScreenPresentingAd): void {}
-}
-
-@NativeClass
-@ObjCClass(GADBannerViewDelegate)
-class GADBannerViewDelegateImpl extends NSObject implements GADBannerViewDelegate {
- _owner: WeakRef;
-
- static initWithOwner(owner: WeakRef): GADBannerViewDelegateImpl {
- const delegate = GADBannerViewDelegateImpl.new();
- delegate._owner = owner;
- return delegate;
- }
-
- bannerViewDidDismissScreen(bannerView: GADBannerView): void {
- this._owner?.get()?.notify?.({
- eventName: AdEventType.CLOSED,
- object: this._owner?.get(),
- });
- }
-
- bannerViewDidFailToReceiveAdWithError(bannerView: GADBannerView, error: NSError): void {
- this._owner?.get()?.notify?.({
- eventName: AdEventType.FAILED_TO_LOAD_EVENT,
- object: this._owner?.get(),
- error: AdmobError.fromNative(error),
- });
- }
-
- bannerViewDidReceiveAd?(bannerView: GADBannerView): void {
- this._owner?.get()?.notify?.({
- eventName: AdEventType.LOADED,
- object: this._owner?.get(),
- });
- this._owner?.get()?._setIsLoading(false);
- }
-
- bannerViewDidRecordClick?(bannerView: GADBannerView): void {
- this._owner?.get()?.notify?.({
- eventName: AdEventType.CLICKED,
- object: this._owner?.get(),
- });
- }
-
- bannerViewDidRecordImpression?(bannerView: GADBannerView): void {
- this._owner?.get()?.notify?.({
- eventName: AdEventType.IMPRESSION,
- object: this._owner?.get(),
- });
- }
-
- bannerViewWillDismissScreen?(bannerView: GADBannerView): void {}
-
- bannerViewWillPresentScreen?(bannerView: GADBannerView): void {}
-}
diff --git a/packages/firebase-admob/nativead/common.ts b/packages/firebase-admob/nativead/common.ts
deleted file mode 100644
index a915044a..00000000
--- a/packages/firebase-admob/nativead/common.ts
+++ /dev/null
@@ -1,76 +0,0 @@
-import { ContainerView, ContentView, CoreTypes, CSSType, Property, View } from '@nativescript/core';
-import { AdEventType } from '../common';
-import { IMediaContent, INativeAd } from '.';
-
-@CSSType('NativeAdView')
-export abstract class NativeAdViewBase extends ContentView {
- abstract adChoicesView: View;
-
- abstract advertiserView: View;
-
- abstract bodyView: View;
-
- abstract callToActionView: View;
-
- abstract headlineView: View;
-
- abstract iconView: View;
-
- abstract imageView: View;
-
- abstract mediaView: MediaViewBase;
-
- abstract nativeAd: INativeAd;
-
- abstract priceView: View;
-
- abstract starRatingView: View;
-
- abstract storeView: View;
-}
-
-export const stretchProperty = new Property({
- name: 'stretch',
- defaultValue: 'aspectFit',
- affectsLayout: global.isIOS,
-});
-
-export const mediaContentProperty = new Property({
- name: 'mediaContent',
-});
-
-@CSSType('MediaView')
-export class MediaViewBase extends ContainerView {
- mediaContent: IMediaContent;
- stretch: CoreTypes.ImageStretchType;
-}
-
-stretchProperty.register(MediaViewBase);
-mediaContentProperty.register(MediaViewBase);
-
-export enum VideoStatus {
- Unstarted,
- Playing,
- Paused,
- Ended,
-}
-
-export enum MediaAspectRatio {
- LANDSCAPE = 'landscape',
- PORTRAIT = 'portrait',
- SQUARE = 'square',
- ANY = 'any',
-}
-
-export enum AdChoicesPlacement {
- TOP_LEFT = 'topLeft',
- TOP_RIGHT = 'topRight',
- BOTTOM_RIGHT = 'bottomRight',
- BOTTOM_LEFT = 'bottomLeft',
-}
-
-export enum NativeAdEventType {
- LOADED = 'native_ad_loaded',
-}
-
-export type NativeAdEventListener = (type: AdEventType | NativeAdEventType, error?: Error, data?: any | INativeAd) => void;
diff --git a/packages/firebase-admob/nativead/index.android.ts b/packages/firebase-admob/nativead/index.android.ts
deleted file mode 100644
index baf4affd..00000000
--- a/packages/firebase-admob/nativead/index.android.ts
+++ /dev/null
@@ -1,607 +0,0 @@
-import { AddChildFromBuilder, Application, ImageSource, View } from '@nativescript/core';
-import { FirebaseError } from '@nativescript/firebase-core';
-import { ManagerRequestOptions, RequestOptions, AdEventListener } from '..';
-import { AdEventType } from '../common';
-import { NativeAdEventListener, NativeAdViewBase, MediaViewBase, mediaContentProperty, stretchProperty, MediaAspectRatio, AdChoicesPlacement, VideoStatus, NativeAdEventType } from './common';
-import { IMediaContent, IMuteThisAdReason, INativeAd, INativeAdImage, IVideoController, NativeAdOptions, UnconfirmedClickListener, INativeAdLoader } from '.';
-
-export { AdChoicesPlacement, AdEventType, VideoStatus, MediaAspectRatio, NativeAdEventType };
-
-const NATIVE_AD_LOADED_EVENT = 'adNativeAdLoaded';
-const AD_MANAGER_AD_VIEW_LOADED_EVENT = 'adManagerAdViewLoaded';
-
-export class NativeAdView extends NativeAdViewBase implements AddChildFromBuilder {
- _native: com.google.android.gms.ads.nativead.NativeAdView;
- _child: View;
- createNativeView() {
- this._native = new com.google.android.gms.ads.nativead.NativeAdView(this._context);
- return this._native;
- }
-
- _addChildFromBuilder(name: string, value: any): void {
- this.content = value;
- }
-
- _adChoicesView: View;
- get adChoicesView(): View {
- return this._adChoicesView;
- }
-
- set adChoicesView(value) {
- this._adChoicesView = value;
- this._native.setAdChoicesView(value?.nativeView);
- }
-
- _advertiserView: View;
- get advertiserView(): View {
- return this._advertiserView;
- }
-
- set advertiserView(value) {
- this._advertiserView = value;
- this._native.setAdvertiserView(value?.nativeView);
- }
-
- _bodyView: View;
- get bodyView(): View {
- return this._bodyView;
- }
-
- set bodyView(value) {
- this._bodyView = value;
- this._native.setBodyView(value?.nativeView);
- }
-
- _callToActionView: View;
- get callToActionView(): View {
- return this._callToActionView;
- }
-
- set callToActionView(value) {
- this._callToActionView = value;
- this._native.setCallToActionView(value?.nativeView);
- }
-
- _headlineView: View;
- get headlineView(): View {
- return this._headlineView;
- }
-
- set headlineView(value) {
- this._headlineView = value;
- this._native.setHeadlineView(value?.nativeView);
- }
-
- _iconView: View;
- get iconView(): View {
- return this._iconView;
- }
-
- set iconView(value) {
- this._iconView = value;
- this._native.setIconView(value?.nativeView);
- }
-
- _imageView: View;
- get imageView(): View {
- return this._imageView;
- }
-
- set imageView(value) {
- this.imageView = value;
- this._native.setImageView(value?.nativeView);
- }
-
- _mediaView: MediaView;
- get mediaView(): MediaView {
- return this._mediaView;
- }
-
- set mediaView(value) {
- this._native.setMediaView(value?.native);
- this._mediaView = value;
- }
-
- _nativeAd: NativeAd;
- get nativeAd(): NativeAd {
- return this._nativeAd;
- }
-
- set nativeAd(value) {
- this._native.setNativeAd(value?.native || null);
- this._nativeAd = value;
- }
-
- _priceView: View;
- get priceView(): View {
- return this._priceView;
- }
-
- set priceView(value) {
- this._priceView = value;
- this._native.setPriceView(value?.nativeView);
- }
-
- _starRatingView: View;
- get starRatingView(): View {
- return this._starRatingView;
- }
-
- set starRatingView(value) {
- this._starRatingView = value;
- this._native.setStarRatingView(value?.nativeView);
- }
-
- _storeView: View;
- get storeView(): View {
- return this._storeView;
- }
-
- set storeView(value) {
- this._priceView = value;
- this._native.setStoreView(value?.nativeView);
- }
-}
-
-export class NativeAdLoader implements INativeAdLoader {
- _adUnitId: string;
- _nativeAdOptions?: NativeAdOptions;
- _requestOptions?: RequestOptions;
- _listener: NativeAdEventListener;
- _native: com.google.android.gms.ads.AdLoader;
-
- constructor(adUnitId: string, requestOptions: RequestOptions = {}, nativeAdOptions: NativeAdOptions = {}) {
- this._adUnitId = adUnitId;
- this._requestOptions = requestOptions;
- this._nativeAdOptions = nativeAdOptions;
- }
- isLoading(): boolean {
- return this.native?.isLoading?.() ?? false;
- }
-
- load(maxAdCount?: number): void;
- load(requestOptions?: ManagerRequestOptions): void;
- load(): void;
- load(arg?: any): void {
- const ref = new WeakRef(this);
- this._native = org.nativescript.firebase.admob.FirebaseAdmob.NativeAd.createLoader(
- Application.android.foregroundActivity || Application.android.startActivity,
- this._adUnitId,
- JSON.stringify(this._nativeAdOptions || {}),
- new org.nativescript.firebase.admob.FirebaseAdmob.AdLoaderCallback({
- onEvent(event: string, param1: any): void {
- const owner = ref.get();
- let nativeAd: NativeAd;
- switch (event) {
- case AdEventType.CLICKED:
- nativeAd?._listener?.(AdEventType.CLICKED, null, null);
- break;
- case AdEventType.CLOSED:
- nativeAd?._listener?.(AdEventType.CLOSED, null, null);
- break;
- case AdEventType.FAILED_TO_LOAD_EVENT:
- owner?._listener?.(AdEventType.FAILED_TO_LOAD_EVENT, FirebaseError.fromNative(param1), null);
- break;
- case AdEventType.IMPRESSION:
- nativeAd?._listener?.(AdEventType.IMPRESSION, null, null);
- break;
- case AdEventType.LOADED:
- owner?._listener?.(AdEventType.LOADED, null, null);
- break;
- case AdEventType.OPENED:
- owner?._listener?.(AdEventType.OPENED, null, null);
- break;
- case NATIVE_AD_LOADED_EVENT:
- nativeAd = NativeAd.fromNative(param1);
- owner?._listener?.(NativeAdEventType.LOADED, null, nativeAd);
- break;
- case AD_MANAGER_AD_VIEW_LOADED_EVENT:
- // returns adManagerAdView view
- break;
- }
- },
- })
- );
- if (arg) {
- if (typeof arg === 'number') {
- org.nativescript.firebase.admob.FirebaseAdmob.NativeAd.load(this._native, JSON.stringify(this._requestOptions), arg);
- }
-
- if (typeof arg === 'object') {
- org.nativescript.firebase.admob.FirebaseAdmob.NativeAd.load(this._native, JSON.stringify(arg), true);
- }
- } else {
- org.nativescript.firebase.admob.FirebaseAdmob.NativeAd.load(this._native, JSON.stringify(this._requestOptions), false);
- }
- }
-
- onAdEvent(listener: NativeAdEventListener) {
- this._listener = listener;
- }
-
- get native() {
- return this._native;
- }
-
- get android() {
- return this.native;
- }
-}
-
-export class NativeAd implements INativeAd {
- _adUnitId: string;
- _native: com.google.android.gms.ads.nativead.NativeAd;
- _listener: AdEventListener;
-
- static fromNative(nativeAd: com.google.android.gms.ads.nativead.NativeAd) {
- if (nativeAd instanceof com.google.android.gms.ads.nativead.NativeAd) {
- const ad = new NativeAd();
- ad._native = nativeAd;
- return ad;
- }
- return null;
- }
-
- get adUnitId(): string {
- return this._adUnitId;
- }
-
- onAdEvent(listener: AdEventListener) {
- this._listener = listener;
- }
-
- destroy(): void {
- this.native?.destroy?.();
- }
-
- get native() {
- return this._native;
- }
-
- get android() {
- return this.native;
- }
-
- get body() {
- return this.native?.getBody();
- }
-
- get callToAction() {
- return this.native?.getCallToAction?.();
- }
-
- get headline() {
- return this.native?.getHeadline?.();
- }
-
- get price() {
- return this.native?.getPrice?.();
- }
-
- get mediaContent() {
- return MediaContent.fromNative(this.native?.getMediaContent?.());
- }
-
- get customMuteThisAdAvailable() {
- return this.native?.isCustomMuteThisAdEnabled?.();
- }
-
- isCustomClickGestureEnabled(): boolean {
- return this.native?.isCustomClickGestureEnabled?.();
- }
- enableCustomClickGesture(): void {
- this.native?.enableCustomClickGesture?.();
- }
-
- get advertiser(): string {
- return this.native?.getAdvertiser?.();
- }
-
- recordCustomClickGesture() {
- this.native?.recordCustomClickGesture?.();
- }
-
- _unconfirmedClickListener?: UnconfirmedClickListener;
- _unconfirmedClickListenerNative?: com.google.android.gms.ads.nativead.NativeAd.UnconfirmedClickListener;
- setUnconfirmedClickListener(listener?: UnconfirmedClickListener): void {
- if (this._unconfirmedClickListener) {
- this.native.setUnconfirmedClickListener(null);
- this._unconfirmedClickListener = null;
- }
-
- if (listener) {
- const ref = new WeakRef(this);
- this._unconfirmedClickListenerNative = new com.google.android.gms.ads.nativead.NativeAd.UnconfirmedClickListener({
- onUnconfirmedClickReceived(param0: string): void {
- const owner = ref.get();
- if (owner) {
- owner._unconfirmedClickListener?.unconfirmedClickReceived?.(param0);
- }
- },
- onUnconfirmedClickCancelled(): void {
- const owner = ref.get();
- if (owner) {
- owner._unconfirmedClickListener?.unconfirmedClickCancelled?.();
- }
- },
- });
- this._unconfirmedClickListener = listener;
- this.native?.setUnconfirmedClickListener(this._unconfirmedClickListenerNative);
- }
- }
-
- get icon() {
- return NativeAdImage.fromNative(this.native?.getIcon?.());
- }
-
- get store() {
- return this.native?.getStore?.();
- }
-
- get starRating() {
- return this.native?.getStarRating?.().doubleValue();
- }
-
- get muteThisAdReasons() {
- const result = [];
- const reasons = this.native?.getMuteThisAdReasons?.();
- if (reasons) {
- const size = reasons.size();
- for (let i = 0; i < size; i++) {
- result.push(MuteThisAdReason.fromNative(reasons.get(i)));
- }
- }
- return result;
- }
-
- muteThisAdWithReason(reason: MuteThisAdReason) {
- if (reason?.native) {
- this.native?.muteThisAd?.(reason.native);
- }
- }
-
- get images() {
- const result = [];
- const images = this.native?.getImages?.();
- if (images) {
- const size = images.size();
- for (let i = 0; i < size; i++) {
- result.push(NativeAdImage.fromNative(images.get(i)));
- }
- }
- return result;
- }
-}
-
-export class MediaContent implements IMediaContent {
- _native: com.google.android.gms.ads.MediaContent;
-
- static fromNative(content: com.google.android.gms.ads.MediaContent): MediaContent {
- if (content instanceof com.google.android.gms.ads.MediaContent) {
- const mediaContent = new MediaContent();
- mediaContent._native = content;
- return mediaContent;
- }
- return null;
- }
-
- get aspectRatio(): number {
- return this.native?.getAspectRatio?.();
- }
-
- get currentTime(): number {
- return this.native?.getCurrentTime?.();
- }
- get duration(): number {
- return this.native?.getDuration?.();
- }
-
- get mainImage(): any {
- return this.native?.getMainImage?.();
- }
-
- set mainImage(value) {
- this.native.setMainImage(value);
- }
-
- get hasVideoContent(): boolean {
- return this.native?.hasVideoContent();
- }
-
- get native() {
- return this._native;
- }
-
- get android() {
- return this.native;
- }
-}
-
-let VideoLifecycleCallbacks;
-
-function ensureVideoLifecycleCallbacks() {
- if (VideoLifecycleCallbacks) {
- return;
- }
-
- class VideoLifecycleCallbacksImpl extends com.google.android.gms.ads.VideoController.VideoLifecycleCallbacks {
- _owner: WeakRef;
- constructor(owner: WeakRef) {
- super();
- this._owner = owner;
- return global.__native(this);
- }
- public onVideoPlay(): void {
- const owner = this._owner?.get?.();
- if (owner) {
- owner._status = VideoStatus.Playing;
- }
- }
- public onVideoStart(): void {
- const owner = this._owner?.get?.();
- if (owner) {
- owner._status = VideoStatus.Playing;
- }
- }
- public onVideoPause(): void {
- const owner = this._owner?.get?.();
- if (owner) {
- owner._status = VideoStatus.Paused;
- }
- }
- public onVideoMute(param0: boolean): void {}
- public onVideoEnd(): void {
- const owner = this._owner?.get?.();
- if (owner) {
- owner._status = VideoStatus.Ended;
- }
- }
- }
-
- VideoLifecycleCallbacks = VideoLifecycleCallbacksImpl;
-}
-
-export class VideoController implements IVideoController {
- _native: com.google.android.gms.ads.VideoController;
- _status: VideoStatus = VideoStatus.Unstarted;
-
- static fromNative(controller: com.google.android.gms.ads.VideoController) {
- if (controller instanceof com.google.android.gms.ads.VideoController) {
- ensureVideoLifecycleCallbacks();
- const ctrl = new VideoController();
- ctrl._native = controller;
- controller.setVideoLifecycleCallbacks(new VideoLifecycleCallbacks(new WeakRef(this)));
- return ctrl;
- }
- return null;
- }
-
- clickToExpandEnabled(): boolean {
- return this.native?.isClickToExpandEnabled?.();
- }
- customControlsEnabled(): boolean {
- return this.native?.isCustomControlsEnabled?.();
- }
- pause(): void {
- this.native?.pause?.();
- }
- play(): void {
- this.native?.play?.();
- }
- get mute() {
- return this.native?.isMuted?.();
- }
-
- set mute(value) {
- this.native?.mute?.(value);
- }
- stop(): void {
- this.native?.stop?.();
- }
-
- get status() {
- return this._status;
- }
-
- get native() {
- return this._native;
- }
-
- get android() {
- return this.native;
- }
-}
-
-export class MediaView extends MediaViewBase {
- _contentView: com.google.android.gms.ads.nativead.MediaView;
- createNativeView() {
- this._contentView = new com.google.android.gms.ads.nativead.MediaView(this._context);
- return this._contentView;
- }
-
- [mediaContentProperty.setNative](content) {
- if (this._contentView) {
- this._contentView?.setMediaContent(content?.native || null);
- }
- }
-
- [stretchProperty.setNative](value) {
- if (!this._contentView) {
- return;
- }
- switch (value) {
- case 'aspectFit':
- this.nativeViewProtected.setScaleType(android.widget.ImageView.ScaleType.FIT_CENTER);
- break;
- case 'aspectFill':
- this.nativeViewProtected.setScaleType(android.widget.ImageView.ScaleType.CENTER_CROP);
- break;
- case 'fill':
- this.nativeViewProtected.setScaleType(android.widget.ImageView.ScaleType.FIT_XY);
- break;
- case 'none':
- default:
- this.nativeViewProtected.setScaleType(android.widget.ImageView.ScaleType.MATRIX);
- break;
- }
- }
-
- get native() {
- return this._contentView;
- }
-}
-
-export class NativeAdImage implements INativeAdImage {
- _native: com.google.android.gms.ads.nativead.NativeAd.Image;
- static fromNative(image: com.google.android.gms.ads.nativead.NativeAd.Image) {
- if (image instanceof com.google.android.gms.ads.nativead.NativeAd.Image) {
- const nativeAdImage = new NativeAdImage();
- nativeAdImage._native = image;
- return nativeAdImage;
- }
- return null;
- }
-
- get image() {
- return new ImageSource(org.nativescript.firebase.admob.FirebaseAdmob.getBitmap(this.native?.getDrawable?.() || null));
- }
-
- get url(): string {
- return this.native?.getUri?.().toString?.();
- }
-
- get scale(): number {
- return this.native?.getScale?.();
- }
-
- get native() {
- return this._native;
- }
-
- get android() {
- return this.native;
- }
-}
-
-export class MuteThisAdReason implements IMuteThisAdReason {
- _native: com.google.android.gms.ads.MuteThisAdReason;
- static fromNative(reason: com.google.android.gms.ads.MuteThisAdReason) {
- if (reason instanceof com.google.android.gms.ads.MuteThisAdReason) {
- const muteThisAdReason = new MuteThisAdReason();
- muteThisAdReason._native = reason;
- return muteThisAdReason;
- }
- return null;
- }
- get description(): string {
- return this.native?.getDescription?.();
- }
-
- get native() {
- return this._native;
- }
-
- get android() {
- return this.native;
- }
-}
diff --git a/packages/firebase-admob/nativead/index.d.ts b/packages/firebase-admob/nativead/index.d.ts
deleted file mode 100644
index 53899cd3..00000000
--- a/packages/firebase-admob/nativead/index.d.ts
+++ /dev/null
@@ -1,229 +0,0 @@
-import { ImageSource, CoreTypes, AddChildFromBuilder } from '@nativescript/core';
-import { FirebaseError } from '@nativescript/firebase-core';
-import { AdEventListener, AdEventType, ManagerRequestOptions, RequestOptions } from '../common';
-import { topViewController, toSerializeManagerRequestOptions, toSerializeRequestOptions } from '../utils';
-import { AdChoicesPlacement, MediaAspectRatio, MediaViewBase, NativeAdEventListener, NativeAdEventType, VideoStatus } from './common';
-
-export { VideoStatus, AdEventType, AdChoicesPlacement, MediaAspectRatio, NativeAdEventType };
-
-export interface IMediaContent {
- aspectRatio: number;
- currentTime: number;
- duration: number;
- mainImage: any;
- hasVideoContent: boolean;
-}
-
-export interface IVideoController {
- status: VideoStatus;
-
- clickToExpandEnabled(): boolean;
-
- customControlsEnabled(): boolean;
-
- pause(): void;
-
- play(): void;
-
- mute: boolean;
-
- stop(): void;
-}
-
-export interface NativeAdOptions {
- nativeAdOptions?: {
- adChoicesPlacement?: AdChoicesPlacement;
- mediaAspectRatio?: MediaAspectRatio;
- customMuteThisAd?: boolean;
- multipleImages?: boolean;
- returnUrlsForImageAssets?: boolean;
- videoOptions?: {
- startMuted?: boolean;
- clickToExpandRequested?: boolean;
- customControlsRequested?: boolean;
- };
- };
- adSizes?: BannerAdSizeBase[];
- adManagerAdViewOptions?: {
- manualImpressionsEnabled?: boolean;
- shouldDelayBannerRendering?: boolean;
- };
-}
-
-export interface IResponseInfo {}
-
-export interface UnconfirmedClickListener {
- unconfirmedClickReceived?(value: string);
- unconfirmedClickCancelled?(): void;
-}
-
-export interface IMuteThisAdReason {
- description: string;
-}
-
-export interface INativeAdLoader {
- isLoading(): boolean;
- load(maxAdCount?: number): void;
- load(requestOptions?: ManagerRequestOptions): void;
- load(): void;
- onAdEvent(listener: NativeAdEventListener);
-}
-
-export interface INativeAd {
- adUnitId: string;
- onAdEvent(listener: AdEventListener);
- destroy(): void;
- advertiser: string;
- body: string;
- callToAction: string;
- headline: string;
- price: string;
- isCustomClickGestureEnabled(): boolean;
- enableCustomClickGesture(): void;
- recordCustomClickGesture(): void;
- setUnconfirmedClickListener(listener?: UnconfirmedClickListener): void;
- images: INativeAdImage[];
- icon: INativeAdImage;
- store: string;
- starRating: number;
- muteThisAdReasons: IMuteThisAdReason[];
-}
-
-export declare class NativeAdView extends NativeAdViewBase implements AddChildFromBuilder {
- adChoicesView: View;
-
- advertiserView: View;
-
- bodyView: View;
-
- callToActionView: View;
-
- headlineView: View;
-
- iconView: View;
-
- imageView: View;
-
- mediaView: MediaView;
-
- nativeAd: NativeAd;
-
- priceView: View;
-
- starRatingView: View;
-
- storeView: View;
-}
-
-export declare class NativeAdLoader implements INativeAdLoader {
- constructor(adUnitId: string);
- constructor(adUnitId: string, requestOptions: RequestOptions);
- constructor(adUnitId: string, requestOptions: RequestOptions, nativeAdOptions: NativeAdOptions);
-
- isLoading(): boolean;
-
- load(maxAdCount?: number): void;
- load(requestOptions?: ManagerRequestOptions): void;
- load(): void;
- load(arg?: any): void;
-
- onAdEvent(listener: NativeAdEventListener);
-
- readonly native;
- readonly android;
- readonly ios;
-}
-
-export declare class NativeAd implements INativeAd {
- readonly adUnitId: string;
- onAdEvent(listener: AdEventListener);
-
- destroy(): void;
-
- readonly native;
- readonly android;
- readonly ios;
-
- readonly getAdvertiser: string;
-
- readonly body: string;
-
- readonly callToAction: string;
- readonly headline: string;
-
- readonly price: string;
-
- readonly mediaContent: MediaContent;
-
- readonly customMuteThisAdAvailable: boolean;
-
- isCustomClickGestureEnabled(): boolean;
-
- enableCustomClickGesture(): void;
-
- readonly advertiser: string;
-
- recordCustomClickGesture(): void;
-
- setUnconfirmedClickListener(listener?: UnconfirmedClickListener): void;
-
- readonly icon: NativeAdImage;
-
- readonly store: string;
-
- readonly starRating: number;
-
- readonly muteThisAdReasons: MuteThisAdReason[];
-
- muteThisAdWithReason(reason: MuteThisAdReason);
-
- readonly images: NativeAdImage[];
-}
-
-export declare class MediaContent implements IMediaContent {
- readonly aspectRatio: number;
- readonly currentTime: number;
- readonly duration: number;
- mainImage: any;
- readonly hasVideoContent: boolean;
- readonly native;
- readonly android;
- readonly ios;
-}
-
-export declare class VideoController implements IVideoController {
- readonly status: VideoStatus;
-
- clickToExpandEnabled(): boolean;
- customControlsEnabled(): boolean;
- pause(): void;
- play(): void;
- mute: boolean;
- stop(): void;
- readonly native;
- readonly android;
- readonly ios;
-}
-
-export declare class MediaView extends MediaViewBase {
- mediaContent: MediaContent;
- stretch: CoreTypes.ImageStretchType;
-}
-
-export interface INativeAdImage {
- image: any;
- url: string;
- scale: number;
-}
-
-export declare class NativeAdImage implements INativeAdImage {
- readonly image: ImageSource;
-
- readonly url: string;
-
- readonly scale: number;
-
- readonly native;
- readonly android;
- readonly ios;
-}
diff --git a/packages/firebase-admob/nativead/index.ios.ts b/packages/firebase-admob/nativead/index.ios.ts
deleted file mode 100644
index f4d30f9a..00000000
--- a/packages/firebase-admob/nativead/index.ios.ts
+++ /dev/null
@@ -1,737 +0,0 @@
-import { AddChildFromBuilder, ImageSource, Utils, View } from '@nativescript/core';
-import { FirebaseError } from '@nativescript/firebase-core';
-import { topViewController, toSerializeManagerRequestOptions, toSerializeRequestOptions } from '../utils';
-import { AdEventType } from '../common';
-import { ManagerRequestOptions, RequestOptions, AdEventListener } from '..';
-import { NativeAdEventListener, NativeAdViewBase, MediaViewBase, mediaContentProperty, stretchProperty, MediaAspectRatio, AdChoicesPlacement, VideoStatus, NativeAdEventType } from './common';
-import { IMediaContent, IMuteThisAdReason, INativeAd, INativeAdImage, IVideoController, NativeAdOptions, UnconfirmedClickListener, INativeAdLoader } from '.';
-
-declare const AdLoaderAdType;
-
-export { AdChoicesPlacement, AdEventType, VideoStatus, MediaAspectRatio, NativeAdEventType };
-
-export class NativeAdView extends NativeAdViewBase implements AddChildFromBuilder {
- _native: GADNativeAdView;
- _child: View;
- createNativeView() {
- this._native = GADNativeAdView.new();
- return this._native;
- }
-
- _addChildFromBuilder(name: string, value: any): void {
- this.content = value;
- }
-
- // public eachChildView(callback: (child: View) => boolean): void {
- // if (this._child) {
- // callback(this._child);
- // }
- // }
-
- _adChoicesView: View;
- get adChoicesView(): View {
- return this._adChoicesView;
- }
-
- set adChoicesView(value) {
- this._adChoicesView = value;
- this._native.adChoicesView = value?.nativeView;
- }
-
- _advertiserView: View;
- get advertiserView(): View {
- return this._advertiserView;
- }
-
- set advertiserView(value) {
- this._advertiserView = value;
- this._native.advertiserView = value?.nativeView;
- }
-
- _bodyView: View;
- get bodyView(): View {
- return this._bodyView;
- }
-
- set bodyView(value) {
- this._bodyView = value;
- this._native.bodyView = value?.nativeView;
- }
-
- _callToActionView: View;
- get callToActionView(): View {
- return this._callToActionView;
- }
-
- set callToActionView(value) {
- this._callToActionView = value;
- this._native.callToActionView = value?.nativeView;
- }
-
- _headlineView: View;
- get headlineView(): View {
- return this._headlineView;
- }
-
- set headlineView(value) {
- this._headlineView = value;
- this._native.headlineView = value?.nativeView;
- }
-
- _iconView: View;
- get iconView(): View {
- return this._iconView;
- }
-
- set iconView(value) {
- this._iconView = value;
- this._native.iconView = value?.nativeView;
- }
-
- _imageView: View;
- get imageView(): View {
- return this._imageView;
- }
-
- set imageView(value) {
- this.imageView = value;
- this._native.imageView = value?.nativeView;
- }
-
- _mediaView: MediaView;
- get mediaView(): MediaView {
- return this._mediaView;
- }
-
- set mediaView(value) {
- this._native.mediaView = value?.native;
- this._mediaView = value;
- }
-
- _nativeAd: NativeAd;
- get nativeAd(): NativeAd {
- return this._nativeAd;
- }
-
- set nativeAd(value) {
- this._native.nativeAd = value?.native;
- this._nativeAd = value;
- }
-
- _priceView: View;
- get priceView(): View {
- return this._priceView;
- }
-
- set priceView(value) {
- this._priceView = value;
- this._native.priceView = value?.nativeView;
- }
-
- _starRatingView: View;
- get starRatingView(): View {
- return this._starRatingView;
- }
-
- set starRatingView(value) {
- this._starRatingView = value;
- this._native.starRatingView = value?.nativeView;
- }
-
- _storeView: View;
- get storeView(): View {
- return this._storeView;
- }
-
- set storeView(value) {
- this._priceView = value;
- this._native.storeView = value?.nativeView;
- }
-}
-
-export class NativeAdLoader implements INativeAdLoader {
- _adUnitId: string;
- _nativeAdOptions?: NativeAdOptions;
- _requestOptions?: RequestOptions;
- _listener: NativeAdEventListener;
- _native: GADAdLoader;
- _delegate: GADAdLoaderDelegateImpl;
- constructor(adUnitId: string, requestOptions: RequestOptions = {}, nativeAdOptions: NativeAdOptions = {}) {
- this._adUnitId = adUnitId;
- this._requestOptions = requestOptions;
- this._nativeAdOptions = nativeAdOptions;
- this._delegate = GADAdLoaderDelegateImpl.initWithOwner(new WeakRef(this));
- }
- isLoading(): boolean {
- return this.native?.loading ?? false;
- }
-
- load(maxAdCount?: number): void;
- load(requestOptions?: ManagerRequestOptions): void;
- load(): void;
- load(arg?: any): void {
- const options: GADAdLoaderOptions[] = [];
- if (this._nativeAdOptions) {
- const managerOptions = this._nativeAdOptions?.adManagerAdViewOptions;
- if (managerOptions) {
- if (typeof managerOptions.manualImpressionsEnabled === 'boolean') {
- const opt = GAMBannerViewOptions.new();
- opt.enableManualImpressions = managerOptions.manualImpressionsEnabled;
- options.push(opt);
- }
- }
-
- const nativeAdOptions = this._nativeAdOptions?.nativeAdOptions;
- if (nativeAdOptions?.adChoicesPlacement) {
- const placement = GADNativeAdViewAdOptions.new();
- switch (nativeAdOptions.adChoicesPlacement) {
- case AdChoicesPlacement.BOTTOM_LEFT:
- placement.preferredAdChoicesPosition = GADAdChoicesPosition.BottomLeftCorner;
- break;
- case AdChoicesPlacement.BOTTOM_RIGHT:
- placement.preferredAdChoicesPosition = GADAdChoicesPosition.BottomRightCorner;
- break;
- case AdChoicesPlacement.TOP_LEFT:
- placement.preferredAdChoicesPosition = GADAdChoicesPosition.TopLeftCorner;
- break;
- case AdChoicesPlacement.TOP_RIGHT:
- placement.preferredAdChoicesPosition = GADAdChoicesPosition.TopRightCorner;
- break;
- }
- options.push(placement);
- }
-
- if (typeof nativeAdOptions?.customMuteThisAd === 'boolean') {
- const customMuteThisAd = GADNativeMuteThisAdLoaderOptions.new();
- customMuteThisAd.customMuteThisAdRequested = nativeAdOptions.customMuteThisAd;
- options.push(customMuteThisAd);
- }
-
- if (nativeAdOptions?.mediaAspectRatio) {
- const mediaAspectRatio = GADNativeAdMediaAdLoaderOptions.new();
- switch (nativeAdOptions.mediaAspectRatio) {
- case MediaAspectRatio.LANDSCAPE:
- mediaAspectRatio.mediaAspectRatio = GADMediaAspectRatio.Landscape;
- break;
- case MediaAspectRatio.PORTRAIT:
- mediaAspectRatio.mediaAspectRatio = GADMediaAspectRatio.Portrait;
- break;
- case MediaAspectRatio.SQUARE:
- mediaAspectRatio.mediaAspectRatio = GADMediaAspectRatio.Square;
- break;
- case MediaAspectRatio.ANY:
- mediaAspectRatio.mediaAspectRatio = GADMediaAspectRatio.Any;
- break;
- }
- options.push(mediaAspectRatio);
- }
-
- if (typeof nativeAdOptions?.multipleImages === 'boolean') {
- const multipleImagesKey = GADNativeAdImageAdLoaderOptions.new();
- multipleImagesKey.shouldRequestMultipleImages = nativeAdOptions.multipleImages;
- options.push(multipleImagesKey);
- }
-
- // probably handled already
- if (typeof nativeAdOptions?.returnUrlsForImageAssets === 'boolean') {
- }
-
- const videoOptions = nativeAdOptions?.videoOptions;
- if (videoOptions) {
- const videoOpts = GADVideoOptions.new();
- if (typeof videoOptions.clickToExpandRequested === 'boolean') {
- videoOpts.clickToExpandRequested = videoOptions.clickToExpandRequested;
- }
-
- if (typeof videoOptions.customControlsRequested === 'boolean') {
- videoOpts.customControlsRequested = videoOptions.customControlsRequested;
- }
-
- if (typeof videoOptions.startMuted === 'boolean') {
- videoOpts.startMuted = videoOptions.startMuted;
- }
-
- options.push(videoOpts);
- }
- }
-
- if (typeof arg === 'number') {
- const numberOfAds = GADMultipleAdsAdLoaderOptions.new();
- numberOfAds.numberOfAds = arg;
- options.push(numberOfAds);
- }
-
- this._native = GADAdLoader.alloc().initWithAdUnitIDRootViewControllerAdTypesOptions(this._adUnitId, topViewController(), [TNSGA.AdLoaderAdTypeToString(AdLoaderAdType.Native)], options);
- this._native.delegate = this._delegate;
-
- if (arg) {
- if (typeof arg === 'number') {
- this._native.loadRequest(toSerializeRequestOptions(this._requestOptions));
- }
-
- if (typeof arg === 'object') {
- this._native.loadRequest(toSerializeManagerRequestOptions(arg));
- }
- } else {
- this._native.loadRequest(toSerializeRequestOptions(this._requestOptions));
- }
- }
-
- onAdEvent(listener: NativeAdEventListener) {
- this._listener = listener;
- }
-
- get native() {
- return this._native;
- }
-
- get ios() {
- return this.native;
- }
-}
-
-export class NativeAd implements INativeAd {
- _adUnitId: string;
- _native?: GADNativeAd;
- _listener: AdEventListener;
- _delegate: GADNativeAdDelegateImpl;
- static fromNative(nativeAd: GADNativeAd) {
- if (nativeAd instanceof GADNativeAd) {
- const ad = new NativeAd();
- ad._native = nativeAd;
- ad._delegate = GADNativeAdDelegateImpl.initWithOwner(new WeakRef(ad));
- nativeAd.delegate = ad._delegate;
- return ad;
- }
- return null;
- }
-
- get adUnitId(): string {
- return this._adUnitId;
- }
-
- onAdEvent(listener: AdEventListener) {
- this._listener = listener;
- }
-
- destroy(): void {}
-
- get native() {
- return this._native;
- }
-
- get ios() {
- return this.native;
- }
-
- get body() {
- return this.native?.body;
- }
-
- get callToAction() {
- return this.native?.callToAction;
- }
-
- get headline() {
- return this.native?.headline;
- }
-
- get price() {
- return this.native?.price;
- }
-
- get mediaContent() {
- return MediaContent.fromNative(this.native?.mediaContent);
- }
-
- get customMuteThisAdAvailable() {
- return this.native.customMuteThisAdAvailable;
- }
- isCustomClickGestureEnabled(): boolean {
- return this.native?.customClickGestureEnabled;
- }
- enableCustomClickGesture(): void {
- this.native?.enableCustomClickGestures?.();
- }
-
- get advertiser(): string {
- return this.native?.advertiser;
- }
-
- recordCustomClickGesture() {
- this.native?.recordCustomClickGesture?.();
- }
-
- _unconfirmedClickListener?: UnconfirmedClickListener;
- _unconfirmedClickDelegate?: GADNativeAdUnconfirmedClickDelegateImpl;
- setUnconfirmedClickListener(listener?: UnconfirmedClickListener): void {
- this.native.unconfirmedClickDelegate;
- if (this._unconfirmedClickListener) {
- this.native.unconfirmedClickDelegate = null;
- this._unconfirmedClickListener = null;
- }
-
- if (listener) {
- this._unconfirmedClickDelegate = GADNativeAdUnconfirmedClickDelegateImpl.initWithOwner(new WeakRef(this));
- this._unconfirmedClickListener = listener;
- if (this.native) {
- this.native.unconfirmedClickDelegate = this._unconfirmedClickDelegate;
- }
- }
- }
-
- get icon() {
- return NativeAdImage.fromNative(this.native.icon);
- }
-
- get store() {
- return this.native?.store;
- }
-
- get starRating() {
- return this.native?.starRating?.floatValue;
- }
-
- get muteThisAdReasons() {
- const result = [];
- const reasons = this.native?.muteThisAdReasons;
- if (reasons) {
- const size = reasons.count;
- for (let i = 0; i < size; i++) {
- result.push(MuteThisAdReason.fromNative(reasons.objectAtIndex(i)));
- }
- }
- return result;
- }
-
- muteThisAdWithReason(reason: MuteThisAdReason) {
- if (reason?.native) {
- this.native?.muteThisAdWithReason?.(reason.native);
- }
- }
-
- get images() {
- const result = [];
- const images = this.native?.images;
- if (images) {
- const size = images.count;
- for (let i = 0; i < size; i++) {
- result.push(NativeAdImage.fromNative(images.objectAtIndex(i)));
- }
- }
- return result;
- }
-}
-
-export class MediaContent implements IMediaContent {
- _native: GADMediaContent;
-
- static fromNative(content: GADMediaContent): MediaContent {
- if (content instanceof GADMediaContent) {
- const mediaContent = new MediaContent();
- mediaContent._native = content;
- return mediaContent;
- }
- return null;
- }
-
- get aspectRatio(): number {
- return this.native?.aspectRatio;
- }
-
- get currentTime(): number {
- return this.native?.currentTime;
- }
- get duration(): number {
- return this.native?.duration;
- }
-
- get mainImage(): any {
- return this.native?.mainImage;
- }
-
- set mainImage(value) {
- this.native.mainImage = value;
- }
-
- get hasVideoContent(): boolean {
- return this.native?.hasVideoContent;
- }
-
- get native() {
- return this._native;
- }
-
- get ios() {
- return this.native;
- }
-}
-
-export class VideoController implements IVideoController {
- _status = VideoStatus.Unstarted;
- _native: GADVideoController;
- _delegate: GADVideoControllerDelegateImpl;
- _isMute: boolean = false;
- static fromNative(controller: GADVideoController) {
- if (controller instanceof GADVideoController) {
- const ctrl = new VideoController();
- ctrl._native = controller;
- ctrl._delegate = GADVideoControllerDelegateImpl.initWithOwner(new WeakRef(ctrl));
- ctrl._native.delegate = ctrl._delegate;
- return ctrl;
- }
- return null;
- }
-
- get status() {
- return this._status;
- }
-
- clickToExpandEnabled(): boolean {
- return this.native?.clickToExpandEnabled?.();
- }
- customControlsEnabled(): boolean {
- return this.native?.customControlsEnabled?.();
- }
- pause(): void {
- this.native?.pause?.();
- }
- play(): void {
- this.native?.play?.();
- }
- get mute() {
- return this._isMute;
- }
-
- set mute(value) {
- this.native?.setMute?.(value);
- }
- stop(): void {
- this.native?.stop?.();
- }
-
- get native() {
- return this._native;
- }
-
- get aniosdroid() {
- return this.native;
- }
-}
-
-export class MediaView extends MediaViewBase {
- _contentView: GADMediaView;
- createNativeView() {
- this._contentView = GADMediaView.new();
- this._contentView.contentMode = UIViewContentMode.ScaleAspectFit;
- return this._contentView;
- }
-
- public onMeasure(widthMeasureSpec: number, heightMeasureSpec: number) {
- const nativeView = this.nativeView;
- if (nativeView) {
- const width = Utils.layout.getMeasureSpecSize(widthMeasureSpec);
- const height = Utils.layout.getMeasureSpecSize(heightMeasureSpec);
- this.setMeasuredDimension(width, height);
- }
- }
-
- [mediaContentProperty.setNative](content) {
- if (this._contentView) {
- this._contentView.mediaContent = content?.native || null;
- }
- }
-
- [stretchProperty.setNative](value) {
- if (!this._contentView) {
- return;
- }
- switch (value) {
- case 'aspectFit':
- this._contentView.contentMode = UIViewContentMode.ScaleAspectFit;
- break;
- case 'aspectFill':
- this._contentView.contentMode = UIViewContentMode.ScaleAspectFill;
- break;
- case 'fill':
- this._contentView.contentMode = UIViewContentMode.ScaleToFill;
- break;
- case 'none':
- default:
- this._contentView.contentMode = UIViewContentMode.TopLeft;
- break;
- }
- }
-
- get native() {
- return this._contentView;
- }
-}
-
-export class NativeAdImage implements INativeAdImage {
- _native: GADNativeAdImage;
- static fromNative(image: GADNativeAdImage) {
- if (image instanceof GADNativeAdImage) {
- const img = new NativeAdImage();
- img._native = image;
- return img;
- }
- return null;
- }
-
- get image() {
- return new ImageSource(this.native?.image);
- }
-
- get url(): string {
- return this.native?.imageURL?.absoluteString;
- }
-
- get scale(): number {
- return this.native?.scale;
- }
-
- get native() {
- return this._native;
- }
-
- get ios() {
- return this.native;
- }
-}
-
-export class MuteThisAdReason implements IMuteThisAdReason {
- _native: GADMuteThisAdReason;
- static fromNative(reason: GADMuteThisAdReason) {
- if (reason instanceof GADMuteThisAdReason) {
- const muteThisAdReason = new MuteThisAdReason();
- muteThisAdReason._native = reason;
- return muteThisAdReason;
- }
- return null;
- }
- get description(): string {
- return this.native?.reasonDescription;
- }
-
- get native() {
- return this._native;
- }
-
- get ios() {
- return this.native;
- }
-}
-
-@NativeClass
-@ObjCClass(GADNativeAdDelegate)
-class GADNativeAdDelegateImpl extends NSObject implements GADNativeAdDelegate {
- _owner: WeakRef;
- static initWithOwner(owner: WeakRef) {
- const delegate = GADNativeAdDelegateImpl.new();
- delegate._owner = owner;
- return delegate;
- }
-
- nativeAdDidDismissScreen(nativeAd: GADNativeAd): void {
- this._owner?.get?.()._listener?.(AdEventType.CLOSED, null, null);
- }
-
- nativeAdDidRecordClick(nativeAd: GADNativeAd): void {
- this._owner?.get?.()._listener?.(AdEventType.CLICKED, null, null);
- }
-
- nativeAdDidRecordImpression(nativeAd: GADNativeAd): void {
- this._owner?.get?.()._listener?.(AdEventType.IMPRESSION, null, null);
- }
-
- nativeAdIsMuted(nativeAd: GADNativeAd): void {}
-
- nativeAdWillDismissScreen(nativeAd: GADNativeAd): void {}
-
- nativeAdWillPresentScreen(nativeAd: GADNativeAd): void {}
-}
-
-@NativeClass
-@ObjCClass(GADNativeAdLoaderDelegate)
-class GADAdLoaderDelegateImpl extends NSObject implements GADNativeAdLoaderDelegate {
- _owner: WeakRef;
- static initWithOwner(owner: WeakRef) {
- const delegate = GADAdLoaderDelegateImpl.new();
- delegate._owner = owner;
- return delegate;
- }
- adLoaderDidFailToReceiveAdWithError(adLoader: GADAdLoader, error: NSError): void {
- this._owner?.get?.()._listener?.(AdEventType.FAILED_TO_LOAD_EVENT, FirebaseError.fromNative(error), null);
- }
- adLoaderDidFinishLoading(adLoader: GADAdLoader): void {
- this._owner?.get?.()._listener?.(AdEventType.LOADED);
- }
-
- adLoaderDidReceiveNativeAd(adLoader: GADAdLoader, nativeAd: GADNativeAd): void {
- this._owner?.get?.()._listener?.(NativeAdEventType.LOADED, null, NativeAd.fromNative(nativeAd));
- }
-}
-
-@NativeClass
-@ObjCClass(GADNativeAdUnconfirmedClickDelegate)
-class GADNativeAdUnconfirmedClickDelegateImpl extends NSObject implements GADNativeAdUnconfirmedClickDelegate {
- _owner: WeakRef;
- static initWithOwner(owner: WeakRef) {
- const delegate = GADNativeAdUnconfirmedClickDelegateImpl.new();
- delegate._owner = owner;
- return delegate;
- }
- nativeAdDidCancelUnconfirmedClick(nativeAd: GADNativeAd): void {
- this._owner?.get?.()._unconfirmedClickListener?.unconfirmedClickCancelled?.();
- }
- nativeAdDidReceiveUnconfirmedClickOnAssetID(nativeAd: GADNativeAd, assetID: string): void {
- this._owner?.get?.()._unconfirmedClickListener?.unconfirmedClickReceived?.(assetID);
- }
-}
-
-@NativeClass
-@ObjCClass(GADVideoControllerDelegate)
-class GADVideoControllerDelegateImpl extends NSObject implements GADVideoControllerDelegate {
- _owner: WeakRef;
- static initWithOwner(owner: WeakRef): GADVideoControllerDelegateImpl {
- const delegate = GADVideoControllerDelegateImpl.new();
- delegate._owner = owner;
- return delegate;
- }
-
- videoControllerDidEndVideoPlayback(videoController: GADVideoController): void {
- const owner = this._owner?.get?.();
- if (owner) {
- owner._status = VideoStatus.Ended;
- }
- }
-
- videoControllerDidMuteVideo(videoController: GADVideoController): void {
- const owner = this._owner?.get?.();
- if (owner) {
- owner._isMute = true;
- }
- }
-
- videoControllerDidPauseVideo(videoController: GADVideoController): void {
- const owner = this._owner?.get?.();
- if (owner) {
- owner._status = VideoStatus.Paused;
- }
- }
-
- videoControllerDidPlayVideo(videoController: GADVideoController): void {
- const owner = this._owner?.get?.();
- if (owner) {
- owner._status = VideoStatus.Playing;
- }
- }
-
- videoControllerDidUnmuteVideo(videoController: GADVideoController): void {
- const owner = this._owner?.get?.();
- if (owner) {
- owner._isMute = false;
- }
- }
-}
diff --git a/packages/firebase-admob/package.json b/packages/firebase-admob/package.json
deleted file mode 100644
index 950e4749..00000000
--- a/packages/firebase-admob/package.json
+++ /dev/null
@@ -1,38 +0,0 @@
-{
- "name": "@nativescript/firebase-admob",
- "version": "3.4.0-alpha.1",
- "description": "NativeScript Firebase - Admob",
- "main": "index",
- "typings": "index.d.ts",
- "nativescript": {
- "platforms": {
- "ios": "6.0.0",
- "android": "6.0.0"
- }
- },
- "repository": {
- "type": "git",
- "url": "https://github.com/NativeScript/firebase.git"
- },
- "keywords": [
- "NativeScript",
- "JavaScript",
- "TypeScript",
- "iOS",
- "Android",
- "Firebase",
- "Ads",
- "AdMob"
- ],
- "author": {
- "name": "NativeScript",
- "email": "oss@nativescript.org"
- },
- "bugs": {
- "url": "https://github.com/NativeScript/firebase/issues"
- },
- "license": "Apache-2.0",
- "homepage": "https://github.com/NativeScript/firebase",
- "readmeFilename": "README.md",
- "bootstrapper": "@nativescript/plugin-seed"
-}
diff --git a/packages/firebase-admob/platforms/android/AndroidManifest.xml b/packages/firebase-admob/platforms/android/AndroidManifest.xml
deleted file mode 100644
index 149a6140..00000000
--- a/packages/firebase-admob/platforms/android/AndroidManifest.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/packages/firebase-admob/platforms/android/firebase_admob.aar b/packages/firebase-admob/platforms/android/firebase_admob.aar
deleted file mode 100644
index 7593605c..00000000
Binary files a/packages/firebase-admob/platforms/android/firebase_admob.aar and /dev/null differ
diff --git a/packages/firebase-admob/platforms/android/include.gradle b/packages/firebase-admob/platforms/android/include.gradle
deleted file mode 100644
index d9cf487c..00000000
--- a/packages/firebase-admob/platforms/android/include.gradle
+++ /dev/null
@@ -1,5 +0,0 @@
-dependencies {
- implementation 'com.google.android.gms:play-services-ads:23.5.0'
- implementation 'com.google.android.ump:user-messaging-platform:2.0.0'
- implementation 'androidx.core:core-ktx:1.6.0'
-}
diff --git a/packages/firebase-admob/platforms/android/java/org/nativescript/firebase/admob/FirebaseAdmob.kt b/packages/firebase-admob/platforms/android/java/org/nativescript/firebase/admob/FirebaseAdmob.kt
deleted file mode 100644
index 2516d05a..00000000
--- a/packages/firebase-admob/platforms/android/java/org/nativescript/firebase/admob/FirebaseAdmob.kt
+++ /dev/null
@@ -1,942 +0,0 @@
-package org.nativescript.firebase.admob
-
-import android.app.Activity
-import android.content.Context
-import android.graphics.Bitmap
-import android.graphics.drawable.Drawable
-import android.os.Bundle
-import android.os.Handler
-import android.os.Looper
-import android.util.Log
-import androidx.core.graphics.drawable.toBitmap
-import com.google.ads.mediation.admob.AdMobAdapter
-import com.google.android.gms.ads.*
-import com.google.android.gms.ads.admanager.AdManagerAdRequest
-import com.google.android.gms.ads.formats.AdManagerAdViewOptions
-import com.google.android.gms.ads.initialization.AdapterStatus
-import com.google.android.gms.ads.interstitial.InterstitialAdLoadCallback
-import com.google.android.gms.ads.nativead.NativeAdOptions
-import com.google.android.gms.ads.rewarded.RewardItem
-import com.google.android.gms.ads.rewarded.RewardedAdLoadCallback
-import com.google.android.gms.ads.rewardedinterstitial.RewardedInterstitialAdLoadCallback
-import com.google.android.ump.*
-import org.json.JSONArray
-import org.json.JSONObject
-import java.util.concurrent.Executors
-
-private const val NATIVE_AD_OPTIONS_KEY = "nativeAdOptions"
-
-private const val AD_CHOICES_PLACEMENT_KEY = "adChoicesPlacement"
-private const val AD_CHOICES_PLACEMENT_TOP_LEFT_KEY = "topLeft"
-private const val AD_CHOICES_PLACEMENT_TOP_RIGHT_KEY = "topRight"
-private const val AD_CHOICES_PLACEMENT_BOTTOM_RIGHT_KEY = "bottomRight"
-private const val AD_CHOICES_PLACEMENT_BOTTOM_LEFT_KEY = "bottomLeft"
-
-private const val MEDIA_ASPECT_RATIO_KEY = "mediaAspectRatio"
-private const val MEDIA_ASPECT_RATIO_LANDSCAPE_KEY = "landscape"
-private const val MEDIA_ASPECT_RATIO_PORTRAIT_KEY = "portrait"
-private const val MEDIA_ASPECT_RATIO_SQUARE_KEY = "square"
-private const val MEDIA_ASPECT_RATIO_SQUARE_ANY = "any"
-
-private const val CUSTOM_MUTE_THIS_ADD_KEY = "customMuteThisAdd"
-
-private const val MULTIPLE_IMAGES_KEY = "multipleImages"
-private const val RETURN_URLS_FOR_IMAGE_ASSETS_KEY = "returnUrlsForImageAssets"
-
-private const val VIDEO_OPTIONS_KEY = "videoOptions"
-private const val VIDEO_OPTIONS_START_MUTED_KEY = "startMuted"
-private const val VIDEO_OPTIONS_CLICK_TO_EXPAND_REQUESTED_KEY = "clickToExpandRequested"
-private const val VIDEO_OPTIONS_CUSTOM_CONTROLS_REQUESTED_KEY = "customControlsRequested"
-
-private const val AD_SIZES_KEY = "adSizes"
-
-private const val AD_MANAGER_AD_VIEW_OPTIONS_KEY = "adManagerAdViewOptions"
-
-private const val AD_MANAGER_AD_VIEW_OPTIONS_MANUAL_IMPRESSIONS_ENABLED_KEY =
- "manualImpressionsEnabled"
-
-private const val AD_MANAGER_AD_VIEW_OPTIONS_SHOULD_DELAY_BANNER_RENDERING_KEY =
- "shouldDelayBannerRendering"
-
-private const val AD_MANAGER_AD_VIEW_LOADED_EVENT = "adManagerAdViewLoaded"
-
-private const val AD_MANAGER_AD_CLICKED_EVENT = "adClicked"
-
-private const val AD_MANAGER_AD_CLOSED_EVENT = "adClosed"
-
-private const val AD_MANAGER_AD_FAILED_TO_LOAD_EVENT = "adFailedToLoad"
-
-private const val AD_MANAGER_AD_IMPRESSION_EVENT = "adImpression"
-
-private const val AD_MANAGER_AD_LOADED_EVENT = "adLoaded"
-
-private const val AD_MANAGER_AD_OPENED_EVENT = "adOpened"
-
-private const val AD_MANAGER_AD_NATIVE_AD_LOADED_EVENT = "adNativeAdLoaded"
-
-private const val DEBUG_SETTINGS_KEY = "debugSettings"
-private const val GEOGRAPHY_KEY = "geography"
-private const val DEVICE_IDS_KEY = "deviceIds"
-private const val EMULATOR_KEY = "emulator"
-private const val FORCE_TESTING_KEY = "forceTesting"
-private const val TAG_FOR_UNDER_AGE_OF_CONSENT_KEY = "tagForUnderAgeOfConsent"
-private const val ADMOB_ID_KEY = "adMobAppId"
-
-
-private const val CONTENT_URL_KEY = "contentUrl"
-private const val KEYWORDS_KEY = "keywords"
-private const val NETWORK_EXTRAS_KEY = "networkExtras"
-private const val REQUEST_AGENT_KEY = "requestAgent"
-private const val REQUEST_NON_PERSONALIZED_ADS_ONLY_KEY = "requestNonPersonalizedAdsOnly"
-
-private const val PUBLISHER_PROVIDER_ID_KEY = "publisherProvidedId"
-private const val CUSTOM_TARGETING_KEY = "customTargeting"
-private const val CATEGORY_EXCLUSIONS_KEY = "categoryExclusions"
-private const val AD_STRING_KEY = "adString"
-
-
-private const val AD_CLICKED_EVENT = "adClicked"
-private const val AD_CLOSED_EVENT = "adClosed"
-private const val AD_FAILED_TO_LOAD_EVENT = "adFailedToLoad"
-private const val AD_LOADED_EVENT = "adLoaded"
-private const val AD_OPENED_EVENT = "adOpened"
-private const val AD_IMPRESSION_EVENT = "adImpression"
-private const val AD_FAILED_TO_SHOW_FULL_SCREEN_CONTENT = " adFailedToShowFullScreenContent"
-
-
-class FirebaseAdmob {
- interface Callback {
- fun onSuccess(result: T?)
- fun onError(error: Any?)
- }
-
- interface AdCallback {
- fun onEvent(event: String, result: Any?)
- }
-
- interface AdLoaderCallback {
- fun onEvent(event: String, result: Any?)
- }
-
- class RewardedAd {
- companion object {
- @JvmStatic
- fun load(activity: Activity, adUnitId: String, request: String, callback: AdCallback): AdRequest {
- val adRequest = buildRequest(request)
- com.google.android.gms.ads.rewarded.RewardedAd.load(
- activity,
- adUnitId,
- adRequest,
- object :
- RewardedAdLoadCallback() {
- override fun onAdFailedToLoad(error: LoadAdError) {
- callback.onEvent(AD_FAILED_TO_LOAD_EVENT, error)
- }
-
- override fun onAdLoaded(ad: com.google.android.gms.ads.rewarded.RewardedAd) {
- ad.fullScreenContentCallback = object : FullScreenContentCallback() {
- override fun onAdDismissedFullScreenContent() {
- callback.onEvent(AD_CLOSED_EVENT, null)
- }
-
- override fun onAdImpression() {
- callback.onEvent(AD_IMPRESSION_EVENT, null)
- }
-
- override fun onAdFailedToShowFullScreenContent(error: AdError) {
- callback.onEvent(AD_FAILED_TO_SHOW_FULL_SCREEN_CONTENT, error)
- }
-
- override fun onAdShowedFullScreenContent() {
- callback.onEvent(AD_OPENED_EVENT, null)
- }
- }
- callback.onEvent(AD_LOADED_EVENT, ad)
- }
- })
- return adRequest
- }
-
- @JvmStatic
- fun show(
- activity: Activity,
- ad: com.google.android.gms.ads.rewarded.RewardedAd,
- callback: Callback
- ) {
- ad.show(activity) {
- callback.onSuccess(it)
- }
- }
- }
- }
-
- class RewardedInterstitialAd {
- companion object {
- @JvmStatic
- fun load(activity: Activity, adUnitId: String, request: String, callback: AdCallback): AdRequest {
- val adRequest = buildRequest(request)
- com.google.android.gms.ads.rewardedinterstitial.RewardedInterstitialAd.load(
- activity,
- adUnitId,
- adRequest,
- object :
- RewardedInterstitialAdLoadCallback() {
- override fun onAdFailedToLoad(error: LoadAdError) {
- callback.onEvent(AD_FAILED_TO_LOAD_EVENT, error)
- }
-
- override fun onAdLoaded(ad: com.google.android.gms.ads.rewardedinterstitial.RewardedInterstitialAd) {
- ad.fullScreenContentCallback = object : FullScreenContentCallback() {
- override fun onAdDismissedFullScreenContent() {
- callback.onEvent(AD_CLOSED_EVENT, null)
- }
-
- override fun onAdImpression() {
- callback.onEvent(AD_IMPRESSION_EVENT, null)
- }
-
- override fun onAdFailedToShowFullScreenContent(error: AdError) {
- callback.onEvent(AD_FAILED_TO_SHOW_FULL_SCREEN_CONTENT, error)
- }
-
- override fun onAdShowedFullScreenContent() {
- callback.onEvent(AD_OPENED_EVENT, null)
- }
- }
- callback.onEvent(AD_LOADED_EVENT, ad)
- }
- })
- return adRequest
- }
-
- @JvmStatic
- fun show(
- activity: Activity,
- ad: com.google.android.gms.ads.rewardedinterstitial.RewardedInterstitialAd,
- callback: Callback
- ) {
- ad.show(activity) {
- callback.onSuccess(it)
- }
- }
- }
- }
-
- class InterstitialAd {
- companion object {
- @JvmStatic
- fun load(
- activity: Activity,
- adUnitId: String,
- request: String,
- callback: AdCallback
- ): AdRequest {
- val adRequest = buildRequest(request)
- com.google.android.gms.ads.interstitial.InterstitialAd.load(
- activity,
- adUnitId,
- adRequest,
- object :
- InterstitialAdLoadCallback() {
- override fun onAdFailedToLoad(error: LoadAdError) {
- callback.onEvent(AD_FAILED_TO_LOAD_EVENT, error)
- }
-
- override fun onAdLoaded(ad: com.google.android.gms.ads.interstitial.InterstitialAd) {
- ad.fullScreenContentCallback = object : FullScreenContentCallback() {
- override fun onAdDismissedFullScreenContent() {
- callback.onEvent(AD_CLOSED_EVENT, null)
- }
-
- override fun onAdImpression() {
- callback.onEvent(AD_IMPRESSION_EVENT, null)
- }
-
- override fun onAdFailedToShowFullScreenContent(error: AdError) {
- callback.onEvent(AD_FAILED_TO_SHOW_FULL_SCREEN_CONTENT, error)
- }
-
- override fun onAdShowedFullScreenContent() {
- callback.onEvent(AD_OPENED_EVENT, null)
- }
- }
- callback.onEvent(AD_LOADED_EVENT, ad)
- }
- })
- return adRequest
- }
- }
- }
-
- class NativeAd {
-
- enum class BannerAdSize(private val value: String) {
- BANNER("BANNER"),
- FLUID("FLUID"),
- FULL_BANNER("FULL_BANNER"),
- LARGE_BANNER("LARGE_BANNER"),
- LEADERBOARD("LEADERBOARD"),
- MEDIUM_RECTANGLE("MEDIUM_RECTANGLE"),
- SMART_BANNER("SMART_BANNER"),
- WIDE_SKYSCRAPER("WIDE_SKYSCRAPER"),
- INVALID("INVALID"),
- SEARCH("SEARCH");
-
- override fun toString(): String {
- return value
- }
-
- fun toAdSize(): AdSize {
- return when (this) {
- BANNER -> AdSize.BANNER
- FLUID -> AdSize.FLUID
- FULL_BANNER -> AdSize.FULL_BANNER
- LARGE_BANNER -> AdSize.LARGE_BANNER
- LEADERBOARD -> AdSize.LEADERBOARD
- MEDIUM_RECTANGLE -> AdSize.MEDIUM_RECTANGLE
- SMART_BANNER -> AdSize.SMART_BANNER
- WIDE_SKYSCRAPER -> AdSize.WIDE_SKYSCRAPER
- SEARCH -> AdSize.SEARCH
- else -> AdSize.INVALID
- }
- }
-
- companion object {
- fun fromString(value: String): BannerAdSize {
- return when (value) {
- "BANNER" -> BANNER
- "FLUID" -> FLUID
- "FULL_BANNER" -> FULL_BANNER
- "LARGE_BANNER" -> LARGE_BANNER
- "LEADERBOARD" -> LEADERBOARD
- "MEDIUM_RECTANGLE" -> MEDIUM_RECTANGLE
- "SMART_BANNER" -> SMART_BANNER
- "WIDE_SKYSCRAPER" -> WIDE_SKYSCRAPER
- "SEARCH" -> SEARCH
- else -> INVALID
- }
- }
- }
-
- }
-
- companion object {
-
- @JvmStatic
- fun createLoader(
- activity: Activity,
- adUnitId: String,
- configuration: String,
- callback: AdLoaderCallback
- ): AdLoader {
- val adLoader = AdLoader.Builder(activity, adUnitId)
- try {
- val config = JSONObject(configuration)
-
- config.optJSONObject(NATIVE_AD_OPTIONS_KEY)?.let { adOptions ->
- val nativeAdOptions = NativeAdOptions.Builder()
-
- if (adOptions.has(AD_CHOICES_PLACEMENT_KEY)) {
- when (adOptions.getString(AD_CHOICES_PLACEMENT_KEY)) {
- AD_CHOICES_PLACEMENT_TOP_LEFT_KEY -> {
- nativeAdOptions.setAdChoicesPlacement(
- NativeAdOptions.ADCHOICES_TOP_LEFT
- )
- }
- AD_CHOICES_PLACEMENT_TOP_RIGHT_KEY -> {
- nativeAdOptions.setAdChoicesPlacement(
- NativeAdOptions.ADCHOICES_TOP_RIGHT
- )
- }
- AD_CHOICES_PLACEMENT_BOTTOM_LEFT_KEY -> {
- nativeAdOptions.setAdChoicesPlacement(
- NativeAdOptions.ADCHOICES_BOTTOM_LEFT
- )
- }
- AD_CHOICES_PLACEMENT_BOTTOM_RIGHT_KEY -> {
- nativeAdOptions.setAdChoicesPlacement(
- NativeAdOptions.ADCHOICES_BOTTOM_RIGHT
- )
- }
- }
- }
-
- if (adOptions.has(MEDIA_ASPECT_RATIO_KEY)) {
- when (adOptions.getString(MEDIA_ASPECT_RATIO_KEY)) {
- MEDIA_ASPECT_RATIO_LANDSCAPE_KEY -> {
- nativeAdOptions.setMediaAspectRatio(NativeAdOptions.NATIVE_MEDIA_ASPECT_RATIO_LANDSCAPE)
- }
- MEDIA_ASPECT_RATIO_PORTRAIT_KEY -> {
- nativeAdOptions.setMediaAspectRatio(NativeAdOptions.NATIVE_MEDIA_ASPECT_RATIO_PORTRAIT)
- }
- MEDIA_ASPECT_RATIO_SQUARE_KEY -> {
- nativeAdOptions.setMediaAspectRatio(NativeAdOptions.NATIVE_MEDIA_ASPECT_RATIO_SQUARE)
- }
- MEDIA_ASPECT_RATIO_SQUARE_ANY -> {
- nativeAdOptions.setMediaAspectRatio(NativeAdOptions.NATIVE_MEDIA_ASPECT_RATIO_ANY)
- }
- }
- }
-
- if (adOptions.has(CUSTOM_MUTE_THIS_ADD_KEY)) {
- nativeAdOptions.setRequestCustomMuteThisAd(
- adOptions.getBoolean(CUSTOM_MUTE_THIS_ADD_KEY)
- )
- }
-
- if (adOptions.has(MULTIPLE_IMAGES_KEY)) {
- nativeAdOptions.setRequestMultipleImages(adOptions.getBoolean(MULTIPLE_IMAGES_KEY))
- }
-
- if (adOptions.has(RETURN_URLS_FOR_IMAGE_ASSETS_KEY)) {
- nativeAdOptions.setReturnUrlsForImageAssets(
- adOptions.getBoolean(
- RETURN_URLS_FOR_IMAGE_ASSETS_KEY
- )
- )
- }
-
- adOptions.optJSONObject(VIDEO_OPTIONS_KEY)?.let {
- val videoOptions = VideoOptions.Builder()
- if (it.has(VIDEO_OPTIONS_START_MUTED_KEY)) {
- videoOptions.setStartMuted(it.getBoolean(VIDEO_OPTIONS_START_MUTED_KEY))
- }
-
- if (it.has(VIDEO_OPTIONS_CLICK_TO_EXPAND_REQUESTED_KEY)) {
- videoOptions.setClickToExpandRequested(
- it.getBoolean(
- VIDEO_OPTIONS_CLICK_TO_EXPAND_REQUESTED_KEY
- )
- )
- }
-
- if (it.has(VIDEO_OPTIONS_CUSTOM_CONTROLS_REQUESTED_KEY)) {
- videoOptions.setCustomControlsRequested(
- it.getBoolean(
- VIDEO_OPTIONS_CUSTOM_CONTROLS_REQUESTED_KEY
- )
- )
- }
-
- nativeAdOptions.setVideoOptions(videoOptions.build())
- }
-
- adLoader.withNativeAdOptions(nativeAdOptions.build())
- }
-
- config.optJSONArray(AD_SIZES_KEY)?.let {
- val sizes = mutableListOf()
- for (i in 0 until it.length()) {
- sizes.add(BannerAdSize.fromString(it.getString(i)).toAdSize())
- }
- adLoader.forAdManagerAdView({ view ->
- callback.onEvent(AD_MANAGER_AD_VIEW_LOADED_EVENT, view)
- }, *sizes.toTypedArray())
- }
-
- config.optJSONObject(AD_MANAGER_AD_VIEW_OPTIONS_KEY)?.let {
- val options = AdManagerAdViewOptions.Builder()
- if (it.has(AD_MANAGER_AD_VIEW_OPTIONS_MANUAL_IMPRESSIONS_ENABLED_KEY)) {
- options.setManualImpressionsEnabled(
- it.getBoolean(AD_MANAGER_AD_VIEW_OPTIONS_MANUAL_IMPRESSIONS_ENABLED_KEY)
- )
- }
-
-// if (it.has(AD_MANAGER_AD_VIEW_OPTIONS_SHOULD_DELAY_BANNER_RENDERING_KEY)) {
-// options.setShouldDelayBannerRenderingListener(object :
-// ShouldDelayBannerRenderingListener {
-// override fun shouldDelayBannerRendering(p0: Runnable): Boolean {
-// return it.getBoolean(AD_MANAGER_AD_VIEW_OPTIONS_SHOULD_DELAY_BANNER_RENDERING_KEY)
-// }
-// })
-// }
- adLoader.withAdManagerAdViewOptions(options.build())
-
- }
-
- adLoader.forNativeAd {
- callback.onEvent(AD_MANAGER_AD_NATIVE_AD_LOADED_EVENT, it)
- }.withAdListener(object : AdListener() {
- override fun onAdClicked() {
- callback.onEvent(AD_MANAGER_AD_CLICKED_EVENT, null)
- }
-
- override fun onAdClosed() {
- callback.onEvent(AD_MANAGER_AD_CLOSED_EVENT, null)
- }
-
- override fun onAdFailedToLoad(error: LoadAdError) {
- callback.onEvent(AD_MANAGER_AD_FAILED_TO_LOAD_EVENT, error)
- }
-
- override fun onAdImpression() {
- callback.onEvent(AD_MANAGER_AD_IMPRESSION_EVENT, null)
- }
-
- override fun onAdLoaded() {
- callback.onEvent(AD_MANAGER_AD_LOADED_EVENT, null)
- }
-
- override fun onAdOpened() {
- callback.onEvent(AD_MANAGER_AD_OPENED_EVENT, null)
- }
- })
-
- } catch (e: Exception) {
- e.message?.let {
- Log.e("JS", it)
- }
- }
-
- return adLoader.build()
- }
-
-
- @JvmStatic
- fun load(adLoader: AdLoader, request: String, isAdManager: Boolean): AdRequest {
- val adRequest: AdRequest
- if (isAdManager) {
- adRequest = buildAdManagerRequest(request)
- adLoader.loadAd(adRequest)
- } else {
- adRequest = buildRequest(request)
- adLoader.loadAd(adRequest)
- }
- return adRequest
- }
-
-
- @JvmStatic
- fun load(adLoader: AdLoader, request: String, maxAdsCount: Int): AdRequest {
- val adRequest = buildRequest(request)
- adLoader.loadAds(adRequest, maxAdsCount)
- return adRequest
- }
- }
- }
-
- class BannerAd {
- companion object {
- @JvmStatic
- fun load(request: String, baseAdView: BaseAdView): AdRequest {
- val adRequest = buildRequest(request)
- baseAdView.loadAd(adRequest)
- return adRequest
- }
- }
- }
-
- class AdConsent {
-
- enum class AdsConsentDebugGeography(private val value: String) {
- DISABLED("DISABLED"),
- EEA("EEA"),
- NOT_EEA("NOT_EEA");
-
- override fun toString(): String {
- return value
- }
- }
-
- companion object {
-
- @JvmStatic
- fun reset(context: Context) {
- UserMessagingPlatform.getConsentInformation(context).reset()
- }
-
- @JvmStatic
- fun getStatus(context: Context): String {
- return when (UserMessagingPlatform.getConsentInformation(context).consentStatus) {
- ConsentInformation.ConsentStatus.REQUIRED -> "REQUIRED"
- ConsentInformation.ConsentStatus.OBTAINED -> "OBTAINED"
- ConsentInformation.ConsentStatus.NOT_REQUIRED -> "NOT_REQUIRED"
- else -> "UNKNOWN"
- }
- }
-
- @JvmStatic
- fun requestInfoUpdate(activity: Activity, parameters: String, callback: Callback) {
- try {
- val params = JSONObject(parameters)
- val requestParameters = ConsentRequestParameters.Builder()
-
- params.optJSONObject(DEBUG_SETTINGS_KEY)?.let { debugSettings ->
- val debug = ConsentDebugSettings.Builder(activity)
-
- when (debugSettings.optString(GEOGRAPHY_KEY)) {
- AdsConsentDebugGeography.DISABLED.toString() -> {
- debug.setDebugGeography(
- ConsentDebugSettings.DebugGeography.DEBUG_GEOGRAPHY_DISABLED
- )
- }
- AdsConsentDebugGeography.EEA.toString() -> {
- debug.setDebugGeography(
- ConsentDebugSettings.DebugGeography.DEBUG_GEOGRAPHY_EEA
- )
- }
- AdsConsentDebugGeography.NOT_EEA.toString() -> {
- debug.setDebugGeography(
- ConsentDebugSettings.DebugGeography.DEBUG_GEOGRAPHY_NOT_EEA
- )
- }
- else -> {
- }
- }
-
- debugSettings.optJSONArray(DEVICE_IDS_KEY)?.let { deviceIds ->
- for (i in 0 until deviceIds.length()) {
- val deviceId = deviceIds.getString(i)
- if (deviceId == EMULATOR_KEY) {
- debug.addTestDeviceHashedId(AdRequest.DEVICE_ID_EMULATOR)
- } else {
- debug.addTestDeviceHashedId(deviceId)
- }
-
- }
- }
-
- if (debugSettings.has(FORCE_TESTING_KEY)) {
- debug.setForceTesting(debugSettings.getBoolean(FORCE_TESTING_KEY))
- }
-
- requestParameters.setConsentDebugSettings(debug.build())
-
- if (debugSettings.has(TAG_FOR_UNDER_AGE_OF_CONSENT_KEY)) {
- requestParameters.setTagForUnderAgeOfConsent(
- debugSettings.getBoolean(
- TAG_FOR_UNDER_AGE_OF_CONSENT_KEY
- )
- )
- }
-
- if (debugSettings.has(ADMOB_ID_KEY)) {
- requestParameters.setAdMobAppId(debugSettings.getString(ADMOB_ID_KEY))
- }
- }
-
- UserMessagingPlatform.getConsentInformation(activity).requestConsentInfoUpdate(
- activity, requestParameters.build(),
- {
- callback.onSuccess(null)
- },
- {
- callback.onError(it)
- }
- )
- } catch (e: Exception) {
- callback.onError(e)
- }
- }
-
-
- @JvmStatic
- fun load(context: Context, callback: Callback) {
- UserMessagingPlatform.loadConsentForm(context, {
- callback.onSuccess(it)
- }, {
- callback.onError(it)
- })
- }
-
- @JvmStatic
- fun show(activity: Activity, form: ConsentForm, callback: Callback) {
- form.show(activity) {
- if (it != null) {
- callback.onError(it)
- } else {
- callback.onSuccess(null)
- }
- }
- }
- }
- }
-
- enum class MaxAdContentRating(private val value: String) {
- G("G"),
- PG("PG"),
- T("T"),
- MA("MA"),
- UNSPECIFIED("UNSPECIFIED");
-
- override fun toString(): String {
- return value
- }
- }
-
- enum class RequestConfiguration(private val value: String) {
- MaxAdContentRating("maxAdContentRating"),
- TagForChildDirectedTreatment("tagForChildDirectedTreatment"),
- TagForUnderAgeOfConsent("tagForUnderAgeOfConsent"),
- TestDevices("testDevices");
-
- override fun toString(): String {
- return value
- }
- }
-
- companion object {
-
- @JvmStatic
- fun getBitmap(drawable: Drawable?): Bitmap? {
- return drawable?.toBitmap()
- }
-
- @JvmStatic
- fun setRequestConfiguration(configuration: String) {
- try {
- val currentConfig = MobileAds.getRequestConfiguration().toBuilder()
- val config = JSONObject(configuration)
-
- when (config.optString(RequestConfiguration.MaxAdContentRating.toString())) {
- MaxAdContentRating.G.toString() -> {
- currentConfig.setMaxAdContentRating(
- com.google.android.gms.ads.RequestConfiguration.MAX_AD_CONTENT_RATING_G
- )
- }
- MaxAdContentRating.MA.toString() -> {
- currentConfig.setMaxAdContentRating(
- com.google.android.gms.ads.RequestConfiguration.MAX_AD_CONTENT_RATING_MA
- )
- }
- MaxAdContentRating.PG.toString() -> {
- currentConfig.setMaxAdContentRating(
- com.google.android.gms.ads.RequestConfiguration.MAX_AD_CONTENT_RATING_PG
- )
- }
- MaxAdContentRating.T.toString() -> {
- currentConfig.setMaxAdContentRating(
- com.google.android.gms.ads.RequestConfiguration.MAX_AD_CONTENT_RATING_T
- )
- }
- MaxAdContentRating.UNSPECIFIED.toString() -> {
- currentConfig.setMaxAdContentRating(
- com.google.android.gms.ads.RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED
- )
- }
- else -> {
- }
- }
-
- when (config.optString(RequestConfiguration.TagForChildDirectedTreatment.toString())) {
- "true" -> {
- currentConfig.setTagForChildDirectedTreatment(
- com.google.android.gms.ads.RequestConfiguration.TAG_FOR_CHILD_DIRECTED_TREATMENT_TRUE
- )
- }
- "false" -> {
- currentConfig.setTagForChildDirectedTreatment(
- com.google.android.gms.ads.RequestConfiguration.TAG_FOR_CHILD_DIRECTED_TREATMENT_FALSE
- )
- }
- "unspecified" -> {
- currentConfig.setTagForChildDirectedTreatment(
- com.google.android.gms.ads.RequestConfiguration.TAG_FOR_CHILD_DIRECTED_TREATMENT_UNSPECIFIED
- )
- }
-
- }
-
- when (config.optString(RequestConfiguration.TagForUnderAgeOfConsent.toString())) {
- "true" -> {
- currentConfig.setTagForUnderAgeOfConsent(
- com.google.android.gms.ads.RequestConfiguration.TAG_FOR_UNDER_AGE_OF_CONSENT_TRUE
- )
- }
- "false" -> {
- currentConfig.setTagForUnderAgeOfConsent(
- com.google.android.gms.ads.RequestConfiguration.TAG_FOR_UNDER_AGE_OF_CONSENT_FALSE
- )
- }
- "unspecified" -> {
- currentConfig.setTagForUnderAgeOfConsent(
- com.google.android.gms.ads.RequestConfiguration.TAG_FOR_UNDER_AGE_OF_CONSENT_UNSPECIFIED
- )
- }
- }
-
- config.optJSONArray(RequestConfiguration.TestDevices.toString())?.let { testDevices ->
- val list = mutableListOf()
- for (i in 0 until testDevices.length()) {
- val value = testDevices.getString(i)
- if (value == "EMULATOR") {
- list.add(AdRequest.DEVICE_ID_EMULATOR)
- } else {
- list.add(value)
- }
- }
-
- currentConfig.setTestDeviceIds(list)
- }
-
- MobileAds.setRequestConfiguration(currentConfig.build())
-
- } catch (e: Exception) {
- }
- }
-
- private fun buildRequest(request: String): AdRequest {
- val builder = AdRequest.Builder()
- buildRequest(builder, request)
- return builder.build()
- }
-
- private fun buildRequest(adRequest: AdRequest.Builder, request: String) {
- try {
- val json = JSONObject(request)
- if (json.has(CONTENT_URL_KEY)) {
- adRequest.setContentUrl(
- json.getString(CONTENT_URL_KEY)
- )
- }
-
- json.optJSONArray(KEYWORDS_KEY)?.let {
- for (i in 0 until it.length()) {
- adRequest.addKeyword(it.getString(i))
- }
- }
-
- val extras = Bundle()
-
-
- if (json.has(REQUEST_NON_PERSONALIZED_ADS_ONLY_KEY)) {
- extras.putString("npa", "1")
- }
-
- json.optJSONObject(NETWORK_EXTRAS_KEY)?.let {
- for (key in it.keys()) {
- extras.putString(
- key, it.getString(key)
- )
- }
- }
-
- adRequest.addNetworkExtrasBundle(AdMobAdapter::class.java, extras)
-
- if (json.has(REQUEST_AGENT_KEY)) {
- adRequest.setRequestAgent(json.getString(REQUEST_AGENT_KEY))
- }
-
- } catch (e: Exception) {
- }
- }
-
- private fun buildManagerRequest(adRequest: AdManagerAdRequest.Builder, request: String) {
- try {
- val json = JSONObject(request)
- if (json.has(CONTENT_URL_KEY)) {
- adRequest.setContentUrl(
- json.getString(CONTENT_URL_KEY)
- )
- }
-
- json.optJSONArray(KEYWORDS_KEY)?.let {
- for (i in 0 until it.length()) {
- adRequest.addKeyword(it.getString(i))
- }
- }
-
- val extras = Bundle()
-
-
- if (json.has(REQUEST_NON_PERSONALIZED_ADS_ONLY_KEY)) {
- extras.putString("npa", "1")
- }
-
- json.optJSONObject(NETWORK_EXTRAS_KEY)?.let {
- for (key in it.keys()) {
- extras.putString(
- key, it.getString(key)
- )
- }
- }
-
- adRequest.addNetworkExtrasBundle(AdMobAdapter::class.java, extras)
-
- if (json.has(REQUEST_AGENT_KEY)) {
- adRequest.setRequestAgent(json.getString(REQUEST_AGENT_KEY))
- }
-
- } catch (e: Exception) {
- }
- }
-
- private fun buildAdManagerRequest(request: String): AdManagerAdRequest {
- val adRequest = AdManagerAdRequest.Builder()
-
- buildManagerRequest(adRequest, request)
- try {
- val json = JSONObject(request)
-
- if (json.has(PUBLISHER_PROVIDER_ID_KEY)) {
- adRequest.setPublisherProvidedId(json.getString(PUBLISHER_PROVIDER_ID_KEY))
- }
-
- json.optJSONObject(CUSTOM_TARGETING_KEY)?.let {
- for (key in it.keys()) {
- when (val value = it[key]) {
- is JSONArray -> {
- val list = mutableListOf()
- for (i in 0 until value.length()) {
- list.add(value.getString(i))
- }
- adRequest.addCustomTargeting(key, list)
- }
- is String -> {
- adRequest.addCustomTargeting(key, value)
- }
- }
- }
- }
-
- json.optJSONArray(CATEGORY_EXCLUSIONS_KEY)?.let {
- for (i in 0 until it.length()) {
- adRequest.addCategoryExclusion(it.getString(i))
- }
- }
-
- if (json.has(AD_STRING_KEY)) {
- adRequest.setAdString(json.getString(AD_STRING_KEY))
- }
-
- } catch (e: Exception) {
- }
-
-
- return adRequest.build()
- }
-
- @JvmStatic
- fun toJSONStatusMap(status: Map): String {
- val json = JSONObject();
- for (entry in status.entries) {
- val obj = JSONObject()
- obj.put(
- "description", entry.value.description
- )
- obj.put(
- "latency", entry.value.latency
- )
- obj.put(
- "state", entry.value.initializationState
- )
- json.put(entry.key, obj)
- }
- return json.toString()
- }
-
- @JvmStatic
- var executorsCount = 3
- set(value) {
- executors = Executors.newFixedThreadPool(value)
- field = value
- }
-
- private var executors = Executors.newFixedThreadPool(executorsCount)
-
- private var handler = Handler(Looper.getMainLooper())
- private fun runOnMain(runnable: Runnable) {
- handler.post(runnable)
- }
- }
-}
diff --git a/packages/firebase-admob/platforms/ios/Info.plist b/packages/firebase-admob/platforms/ios/Info.plist
deleted file mode 100644
index 58cc1136..00000000
--- a/packages/firebase-admob/platforms/ios/Info.plist
+++ /dev/null
@@ -1,160 +0,0 @@
-
-
-
-
-SKAdNetworkItems
-
-
- SKAdNetworkIdentifier
- cstr6suwn9.skadnetwork
-
-
- SKAdNetworkIdentifier
- 4fzdc2evr5.skadnetwork
-
-
- SKAdNetworkIdentifier
- 2fnua5tdw4.skadnetwork
-
-
- SKAdNetworkIdentifier
- ydx93a7ass.skadnetwork
-
-
- SKAdNetworkIdentifier
- 5a6flpkh64.skadnetwork
-
-
- SKAdNetworkIdentifier
- p78axxw29g.skadnetwork
-
-
- SKAdNetworkIdentifier
- v72qych5uu.skadnetwork
-
-
- SKAdNetworkIdentifier
- c6k4g5qg8m.skadnetwork
-
-
- SKAdNetworkIdentifier
- s39g8k73mm.skadnetwork
-
-
- SKAdNetworkIdentifier
- 3qy4746246.skadnetwork
-
-
- SKAdNetworkIdentifier
- 3sh42y64q3.skadnetwork
-
-
- SKAdNetworkIdentifier
- f38h382jlk.skadnetwork
-
-
- SKAdNetworkIdentifier
- hs6bdukanm.skadnetwork
-
-
- SKAdNetworkIdentifier
- prcb7njmu6.skadnetwork
-
-
- SKAdNetworkIdentifier
- v4nxqhlyqp.skadnetwork
-
-
- SKAdNetworkIdentifier
- wzmmz9fp6w.skadnetwork
-
-
- SKAdNetworkIdentifier
- yclnxrl5pm.skadnetwork
-
-
- SKAdNetworkIdentifier
- t38b2kh725.skadnetwork
-
-
- SKAdNetworkIdentifier
- 7ug5zh24hu.skadnetwork
-
-
- SKAdNetworkIdentifier
- 9rd848q2bz.skadnetwork
-
-
- SKAdNetworkIdentifier
- n6fk4nfna4.skadnetwork
-
-
- SKAdNetworkIdentifier
- kbd757ywx3.skadnetwork
-
-
- SKAdNetworkIdentifier
- 9t245vhmpl.skadnetwork
-
-
- SKAdNetworkIdentifier
- 4468km3ulz.skadnetwork
-
-
- SKAdNetworkIdentifier
- 2u9pt9hc89.skadnetwork
-
-
- SKAdNetworkIdentifier
- 8s468mfl3y.skadnetwork
-
-
- SKAdNetworkIdentifier
- av6w8kgt66.skadnetwork
-
-
- SKAdNetworkIdentifier
- klf5c3l5u5.skadnetwork
-
-
- SKAdNetworkIdentifier
- ppxm28t8ap.skadnetwork
-
-
- SKAdNetworkIdentifier
- 424m5254lk.skadnetwork
-
-
- SKAdNetworkIdentifier
- uw77j35x4d.skadnetwork
-
-
- SKAdNetworkIdentifier
- 578prtvx9j.skadnetwork
-
-
- SKAdNetworkIdentifier
- 4dzt52r2t5.skadnetwork
-
-
- SKAdNetworkIdentifier
- e5fvkxwrpn.skadnetwork
-
-
- SKAdNetworkIdentifier
- 8c4e2ghe7u.skadnetwork
-
-
- SKAdNetworkIdentifier
- zq492l623r.skadnetwork
-
-
- SKAdNetworkIdentifier
- 3qcr597p9d.skadnetwork
-
-
-
- NSUserTrackingUsageDescription
-This identifier will be used to deliver personalized ads to you.
-
-
\ No newline at end of file
diff --git a/packages/firebase-admob/platforms/ios/Podfile b/packages/firebase-admob/platforms/ios/Podfile
deleted file mode 100644
index 6a7e02a6..00000000
--- a/packages/firebase-admob/platforms/ios/Podfile
+++ /dev/null
@@ -1,3 +0,0 @@
-use_frameworks!
-platform :ios, '12.0'
-pod 'Google-Mobile-Ads-SDK', '~> 11.12.0'
diff --git a/packages/firebase-admob/platforms/ios/src/TNSGA.swift b/packages/firebase-admob/platforms/ios/src/TNSGA.swift
deleted file mode 100644
index c5941049..00000000
--- a/packages/firebase-admob/platforms/ios/src/TNSGA.swift
+++ /dev/null
@@ -1,135 +0,0 @@
-import Foundation
-import GoogleMobileAds
-
-@objcMembers
-@objc(TNSGA)
-public class TNSGA:NSObject {
-
- @objc(Orientation)
- public enum Orientation:Int, RawRepresentable {
- case Portrait
- case Landscape
- case Device
- public typealias RawValue = UInt32
-
- public init?(rawValue: UInt32) {
- switch rawValue {
- case 0:
- self = .Portrait
- case 1:
- self = .Landscape
- case 2:
- self = .Device
- default:
- return nil
- }
- }
-
- public var rawValue: RawValue {
- switch self {
- case .Portrait:
- return 0
- case .Landscape:
- return 1
- case .Device:
- return 2
- }
- }
- }
-
-
- @objc(AdLoaderAdType)
- public enum AdLoaderAdType: Int, RawRepresentable {
- case CustomNative
- case GAMBanner
- case Native
- public typealias RawValue = String
-
- public init?(rawValue: String) {
- switch rawValue {
- case GADAdLoaderAdType.customNative.rawValue:
- self = .CustomNative
- case GADAdLoaderAdType.gamBanner.rawValue:
- self = .GAMBanner
- case GADAdLoaderAdType.native.rawValue:
- self = .Native
- default:
- return nil
- }
- }
-
- public var rawValue: RawValue {
- switch self {
- case .CustomNative:
- return GADAdLoaderAdType.customNative.rawValue
- case .GAMBanner:
- return GADAdLoaderAdType.gamBanner.rawValue
- case .Native:
- return GADAdLoaderAdType.native.rawValue
- }
- }
- }
-
- public static func AdLoaderAdTypeToString(_ type: AdLoaderAdType) -> String {
- return type.rawValue
- }
-
- public static func createAnchoredAdaptiveBanner(_ width: CGFloat,_ orientation: Orientation) -> GADAdSize {
- switch orientation {
- case .Landscape:
- return GADLandscapeAnchoredAdaptiveBannerAdSizeWithWidth(width)
- case .Portrait:
- return GADPortraitAnchoredAdaptiveBannerAdSizeWithWidth(width)
- default:
- return GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth(width)
- }
- }
-
- public static func createInlineAdaptiveBanner(_ width: CGFloat, _ maxHeight: CGFloat,_ orientation: Orientation) -> GADAdSize {
- if(maxHeight > 0){
- return GADInlineAdaptiveBannerAdSizeWithWidthAndMaxHeight(width, maxHeight)
- }
- switch orientation {
- case .Landscape:
- return GADLandscapeInlineAdaptiveBannerAdSizeWithWidth(width)
- case .Portrait:
- return GADPortraitInlineAdaptiveBannerAdSizeWithWidth(width)
- default:
- return GADCurrentOrientationInlineAdaptiveBannerAdSizeWithWidth(width)
- }
- }
-
- @objc(NSCGABannersSize)
- public enum NSCGABannersSize: Int8, RawRepresentable {
- public typealias RawValue = Int8
- case Banner
- case FullBanner
- case LargeBanner
- case LeaderBoard
- case MediumRectangle
- case Fluid
- case WideSkyScraper
- case Invalid
- }
-
- public static func createBanner(_ size: NSCGABannersSize) -> GADAdSize {
- switch size {
- case .Banner:
- return GADAdSizeBanner
- case .FullBanner:
- return GADAdSizeFullBanner
- case .LargeBanner:
- return GADAdSizeLargeBanner
- case .LeaderBoard:
- return GADAdSizeLeaderboard
- case .MediumRectangle:
- return GADAdSizeMediumRectangle
- case .Fluid:
- return GADAdSizeFluid
- case .WideSkyScraper:
- return GADAdSizeSkyscraper
- case .Invalid:
- return GADAdSizeInvalid
- }
- }
-}
diff --git a/packages/firebase-admob/project.json b/packages/firebase-admob/project.json
deleted file mode 100644
index c97b9a5d..00000000
--- a/packages/firebase-admob/project.json
+++ /dev/null
@@ -1,71 +0,0 @@
-{
- "name": "firebase-admob",
- "$schema": "../../node_modules/nx/schemas/project-schema.json",
- "projectType": "library",
- "sourceRoot": "packages/firebase-admob",
- "targets": {
- "build": {
- "executor": "@nx/js:tsc",
- "options": {
- "outputPath": "dist/packages/firebase-admob",
- "tsConfig": "packages/firebase-admob/tsconfig.json",
- "packageJson": "packages/firebase-admob/package.json",
- "main": "packages/firebase-admob/index.d.ts",
- "assets": [
- "packages/firebase-admob/*.md",
- "packages/firebase-admob/index.d.ts",
- "packages/firebase-admob/typings/*.d.ts",
- "LICENSE",
- {
- "glob": "**/*",
- "input": "packages/firebase-admob/platforms/",
- "output": "./platforms/"
- },
- {
- "glob": "**/*.d.ts",
- "input": "packages/firebase-admob/nativead/",
- "output": "./nativead/"
- },
- {
- "glob": "**/*.d.ts",
- "input": "packages/firebase-admob/adsconsent/",
- "output": "./adsconsent/"
- }
- ]
- },
- "dependsOn": [
- {
- "target": "build.all",
- "dependencies": true
- }
- ]
- },
- "build.all": {
- "executor": "nx:run-commands",
- "options": {
- "commands": ["node tools/scripts/build-finish.ts firebase-admob"],
- "parallel": false
- },
- "outputs": ["{workspaceRoot}/dist/packages/firebase-admob"],
- "dependsOn": [
- {
- "target": "build.all",
- "dependencies": true
- },
- {
- "target": "build"
- }
- ]
- },
- "focus": {
- "executor": "nx:run-commands",
- "options": {
- "commands": ["nx g @nativescript/plugin-tools:focus-packages firebase-admob"],
- "parallel": false
- }
- },
- "lint": {
- "executor": "@nx/eslint:lint"
- }
- }
-}
diff --git a/packages/firebase-admob/references.d.ts b/packages/firebase-admob/references.d.ts
deleted file mode 100644
index eefda9a9..00000000
--- a/packages/firebase-admob/references.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-///
-///
diff --git a/packages/firebase-admob/src-native/android/.idea/workspace.xml b/packages/firebase-admob/src-native/android/.idea/workspace.xml
deleted file mode 100644
index 1e6f1753..00000000
--- a/packages/firebase-admob/src-native/android/.idea/workspace.xml
+++ /dev/null
@@ -1,815 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1642643670511
-
-
- 1642643670511
-
-
-
-
\ No newline at end of file
diff --git a/packages/firebase-admob/tsconfig.json b/packages/firebase-admob/tsconfig.json
deleted file mode 100644
index a2ef9cc6..00000000
--- a/packages/firebase-admob/tsconfig.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "extends": "../../tsconfig.base.json",
- "compilerOptions": {
- "outDir": "../../dist/out-tsc",
- "rootDir": "."
- },
- "exclude": ["**/*.spec.ts", "angular"],
- "include": ["**/*.ts", "references.d.ts"]
-}
diff --git a/packages/firebase-admob/typings/android.d.ts b/packages/firebase-admob/typings/android.d.ts
deleted file mode 100644
index a04d7f68..00000000
--- a/packages/firebase-admob/typings/android.d.ts
+++ /dev/null
@@ -1,28680 +0,0 @@
-declare module com {
- export module google {
- export module ads {
- export class AdRequest {
- public static class: java.lang.Class;
- public static VERSION: string;
- public static LOGTAG: string;
- public static TEST_EMULATOR: string;
- }
- export module AdRequest {
- export class ErrorCode {
- public static class: java.lang.Class;
- public static INVALID_REQUEST: com.google.ads.AdRequest.ErrorCode;
- public static NO_FILL: com.google.ads.AdRequest.ErrorCode;
- public static NETWORK_ERROR: com.google.ads.AdRequest.ErrorCode;
- public static INTERNAL_ERROR: com.google.ads.AdRequest.ErrorCode;
- public toString(): string;
- public static valueOf(param0: string): com.google.ads.AdRequest.ErrorCode;
- public static values(): native.Array;
- }
- export class Gender {
- public static class: java.lang.Class;
- public static UNKNOWN: com.google.ads.AdRequest.Gender;
- public static MALE: com.google.ads.AdRequest.Gender;
- public static FEMALE: com.google.ads.AdRequest.Gender;
- public static values(): native.Array;
- public static valueOf(param0: string): com.google.ads.AdRequest.Gender;
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module ads {
- export class AdSize {
- public static class: java.lang.Class;
- public static FULL_WIDTH: number;
- public static AUTO_HEIGHT: number;
- public static LANDSCAPE_AD_HEIGHT: number;
- public static PORTRAIT_AD_HEIGHT: number;
- public static LARGE_AD_HEIGHT: number;
- public static SMART_BANNER: com.google.ads.AdSize;
- public static BANNER: com.google.ads.AdSize;
- public static IAB_MRECT: com.google.ads.AdSize;
- public static IAB_BANNER: com.google.ads.AdSize;
- public static IAB_LEADERBOARD: com.google.ads.AdSize;
- public static IAB_WIDE_SKYSCRAPER: com.google.ads.AdSize;
- public constructor(param0: number, param1: number);
- public isSizeAppropriate(param0: number, param1: number): boolean;
- public getHeight(): number;
- public getWidthInPixels(param0: globalAndroid.content.Context): number;
- public isCustomAdSize(): boolean;
- public toString(): string;
- public getHeightInPixels(param0: globalAndroid.content.Context): number;
- public findBestSize(param0: native.Array): com.google.ads.AdSize;
- public getWidth(): number;
- public isFullWidth(): boolean;
- public constructor(param0: com.google.android.gms.ads.AdSize);
- public isAutoHeight(): boolean;
- public hashCode(): number;
- public equals(param0: any): boolean;
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module ads {
- export module mediation {
- export abstract class AbstractAdViewAdapter implements com.google.android.gms.ads.mediation.MediationBannerAdapter, com.google.android.gms.ads.mediation.MediationNativeAdapter, com.google.android.gms.ads.mediation.OnImmersiveModeUpdatedListener, com.google.android.gms.internal.ads.zzcoo, com.google.android.gms.ads.mediation.zzb {
- public static class: java.lang.Class;
- public static AD_UNIT_ID_PARAMETER: string;
- public mAdView: com.google.android.gms.ads.AdView;
- public mInterstitialAd: com.google.android.gms.ads.interstitial.InterstitialAd;
- public buildExtrasBundle(param0: globalAndroid.os.Bundle, param1: globalAndroid.os.Bundle): globalAndroid.os.Bundle;
- public getBannerView(): globalAndroid.view.View;
- public requestInterstitialAd(param0: globalAndroid.content.Context, param1: com.google.android.gms.ads.mediation.MediationInterstitialListener, param2: globalAndroid.os.Bundle, param3: com.google.android.gms.ads.mediation.MediationAdRequest, param4: globalAndroid.os.Bundle): void;
- public onDestroy(): void;
- public getInterstitialAdapterInfo(): globalAndroid.os.Bundle;
- public onResume(): void;
- public getAdUnitId(param0: globalAndroid.os.Bundle): string;
- public getVideoController(): any /* com.google.android.gms.internal.ads.zzbhg*/;
- public constructor();
- public onPause(): void;
- public onImmersiveModeUpdated(param0: boolean): void;
- public showInterstitial(): void;
- public requestBannerAd(param0: globalAndroid.content.Context, param1: com.google.android.gms.ads.mediation.MediationBannerListener, param2: globalAndroid.os.Bundle, param3: com.google.android.gms.ads.AdSize, param4: com.google.android.gms.ads.mediation.MediationAdRequest, param5: globalAndroid.os.Bundle): void;
- public requestNativeAd(param0: globalAndroid.content.Context, param1: com.google.android.gms.ads.mediation.MediationNativeListener, param2: globalAndroid.os.Bundle, param3: com.google.android.gms.ads.mediation.NativeMediationAdRequest, param4: globalAndroid.os.Bundle): void;
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module ads {
- export module mediation {
- export class AdUrlAdapter extends com.google.ads.mediation.AbstractAdViewAdapter implements com.google.android.gms.ads.mediation.MediationBannerAdapter, com.google.android.gms.ads.mediation.MediationInterstitialAdapter, com.google.android.gms.ads.mediation.MediationNativeAdapter {
- public static class: java.lang.Class;
- public buildExtrasBundle(param0: globalAndroid.os.Bundle, param1: globalAndroid.os.Bundle): globalAndroid.os.Bundle;
- public getBannerView(): globalAndroid.view.View;
- public requestInterstitialAd(param0: globalAndroid.content.Context, param1: com.google.android.gms.ads.mediation.MediationInterstitialListener, param2: globalAndroid.os.Bundle, param3: com.google.android.gms.ads.mediation.MediationAdRequest, param4: globalAndroid.os.Bundle): void;
- public onDestroy(): void;
- public getInterstitialAdapterInfo(): globalAndroid.os.Bundle;
- public onResume(): void;
- public getAdUnitId(param0: globalAndroid.os.Bundle): string;
- public getVideoController(): any /* com.google.android.gms.internal.ads.zzbhg*/;
- public constructor();
- public onPause(): void;
- public onImmersiveModeUpdated(param0: boolean): void;
- public showInterstitial(): void;
- public requestBannerAd(param0: globalAndroid.content.Context, param1: com.google.android.gms.ads.mediation.MediationBannerListener, param2: globalAndroid.os.Bundle, param3: com.google.android.gms.ads.AdSize, param4: com.google.android.gms.ads.mediation.MediationAdRequest, param5: globalAndroid.os.Bundle): void;
- public requestNativeAd(param0: globalAndroid.content.Context, param1: com.google.android.gms.ads.mediation.MediationNativeListener, param2: globalAndroid.os.Bundle, param3: com.google.android.gms.ads.mediation.NativeMediationAdRequest, param4: globalAndroid.os.Bundle): void;
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module ads {
- export module mediation {
- export class EmptyNetworkExtras extends com.google.ads.mediation.NetworkExtras {
- public static class: java.lang.Class;
- public constructor();
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module ads {
- export module mediation {
- export class MediationAdRequest {
- public static class: java.lang.Class;
- public getAgeInYears(): java.lang.Integer;
- public getKeywords(): java.util.Set;
- public getGender(): com.google.ads.AdRequest.Gender;
- public getBirthday(): java.util.Date;
- public isTesting(): boolean;
- public getLocation(): globalAndroid.location.Location;
- public constructor(param0: java.util.Date, param1: com.google.ads.AdRequest.Gender, param2: java.util.Set, param3: boolean, param4: globalAndroid.location.Location);
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module ads {
- export module mediation {
- export class MediationAdapter extends java.lang.Object {
- public static class: java.lang.Class;
- /**
- * Constructs a new instance of the com.google.ads.mediation.MediationAdapter interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
- */
- public constructor(implementation: { destroy(): void; getAdditionalParametersType(): java.lang.Class; getServerParametersType(): java.lang.Class });
- public constructor();
- public getServerParametersType(): java.lang.Class;
- public destroy(): void;
- public getAdditionalParametersType(): java.lang.Class;
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module ads {
- export module mediation {
- export class MediationBannerAdapter extends com.google.ads.mediation.MediationAdapter {
- public static class: java.lang.Class;
- /**
- * Constructs a new instance of the com.google.ads.mediation.MediationBannerAdapter interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
- */
- public constructor(implementation: { requestBannerAd(param0: com.google.ads.mediation.MediationBannerListener, param1: globalAndroid.app.Activity, param2: any, param3: com.google.ads.AdSize, param4: com.google.ads.mediation.MediationAdRequest, param5: any): void; getBannerView(): globalAndroid.view.View; destroy(): void; getAdditionalParametersType(): java.lang.Class; getServerParametersType(): java.lang.Class });
- public constructor();
- public getBannerView(): globalAndroid.view.View;
- public destroy(): void;
- public getServerParametersType(): java.lang.Class;
- public requestBannerAd(param0: com.google.ads.mediation.MediationBannerListener, param1: globalAndroid.app.Activity, param2: any, param3: com.google.ads.AdSize, param4: com.google.ads.mediation.MediationAdRequest, param5: any): void;
- public getAdditionalParametersType(): java.lang.Class;
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module ads {
- export module mediation {
- export class MediationBannerListener {
- public static class: java.lang.Class;
- /**
- * Constructs a new instance of the com.google.ads.mediation.MediationBannerListener interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
- */
- public constructor(implementation: {
- onReceivedAd(param0: com.google.ads.mediation.MediationBannerAdapter): void;
- onFailedToReceiveAd(param0: com.google.ads.mediation.MediationBannerAdapter, param1: com.google.ads.AdRequest.ErrorCode): void;
- onPresentScreen(param0: com.google.ads.mediation.MediationBannerAdapter): void;
- onDismissScreen(param0: com.google.ads.mediation.MediationBannerAdapter): void;
- onLeaveApplication(param0: com.google.ads.mediation.MediationBannerAdapter): void;
- onClick(param0: com.google.ads.mediation.MediationBannerAdapter): void;
- });
- public constructor();
- public onFailedToReceiveAd(param0: com.google.ads.mediation.MediationBannerAdapter, param1: com.google.ads.AdRequest.ErrorCode): void;
- public onReceivedAd(param0: com.google.ads.mediation.MediationBannerAdapter): void;
- public onDismissScreen(param0: com.google.ads.mediation.MediationBannerAdapter): void;
- public onPresentScreen(param0: com.google.ads.mediation.MediationBannerAdapter): void;
- public onLeaveApplication(param0: com.google.ads.mediation.MediationBannerAdapter): void;
- public onClick(param0: com.google.ads.mediation.MediationBannerAdapter): void;
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module ads {
- export module mediation {
- export class MediationInterstitialAdapter extends com.google.ads.mediation.MediationAdapter {
- public static class: java.lang.Class;
- /**
- * Constructs a new instance of the com.google.ads.mediation.MediationInterstitialAdapter interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
- */
- public constructor(implementation: { requestInterstitialAd(param0: com.google.ads.mediation.MediationInterstitialListener, param1: globalAndroid.app.Activity, param2: any, param3: com.google.ads.mediation.MediationAdRequest, param4: any): void; showInterstitial(): void; destroy(): void; getAdditionalParametersType(): java.lang.Class; getServerParametersType(): java.lang.Class });
- public constructor();
- public destroy(): void;
- public getServerParametersType(): java.lang.Class;
- public requestInterstitialAd(param0: com.google.ads.mediation.MediationInterstitialListener, param1: globalAndroid.app.Activity, param2: any, param3: com.google.ads.mediation.MediationAdRequest, param4: any): void;
- public showInterstitial(): void;
- public getAdditionalParametersType(): java.lang.Class;
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module ads {
- export module mediation {
- export class MediationInterstitialListener {
- public static class: java.lang.Class;
- /**
- * Constructs a new instance of the com.google.ads.mediation.MediationInterstitialListener interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
- */
- public constructor(implementation: { onReceivedAd(param0: com.google.ads.mediation.MediationInterstitialAdapter): void; onFailedToReceiveAd(param0: com.google.ads.mediation.MediationInterstitialAdapter, param1: com.google.ads.AdRequest.ErrorCode): void; onPresentScreen(param0: com.google.ads.mediation.MediationInterstitialAdapter): void; onDismissScreen(param0: com.google.ads.mediation.MediationInterstitialAdapter): void; onLeaveApplication(param0: com.google.ads.mediation.MediationInterstitialAdapter): void });
- public constructor();
- public onLeaveApplication(param0: com.google.ads.mediation.MediationInterstitialAdapter): void;
- public onReceivedAd(param0: com.google.ads.mediation.MediationInterstitialAdapter): void;
- public onFailedToReceiveAd(param0: com.google.ads.mediation.MediationInterstitialAdapter, param1: com.google.ads.AdRequest.ErrorCode): void;
- public onPresentScreen(param0: com.google.ads.mediation.MediationInterstitialAdapter): void;
- public onDismissScreen(param0: com.google.ads.mediation.MediationInterstitialAdapter): void;
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module ads {
- export module mediation {
- export abstract class MediationServerParameters {
- public static class: java.lang.Class;
- public constructor();
- public load(param0: java.util.Map): void;
- }
- export module MediationServerParameters {
- export class MappingException {
- public static class: java.lang.Class;
- public constructor(param0: string);
- }
- export class Parameter {
- public static class: java.lang.Class;
- /**
- * Constructs a new instance of the com.google.ads.mediation.MediationServerParameters$Parameter interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
- */
- public constructor(implementation: { name(): string; required(): boolean });
- public constructor();
- public name(): string;
- public required(): boolean;
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module ads {
- export module mediation {
- export class NetworkExtras extends com.google.android.gms.ads.mediation.NetworkExtras {
- public static class: java.lang.Class;
- /**
- * Constructs a new instance of the com.google.ads.mediation.NetworkExtras interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
- */
- public constructor(implementation: {});
- public constructor();
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module ads {
- export module mediation {
- export module admob {
- export class AdMobAdapter extends com.google.ads.mediation.AbstractAdViewAdapter {
- public static class: java.lang.Class;
- public static NEW_BUNDLE: string;
- public onImmersiveModeUpdated(param0: boolean): void;
- public getVideoController(): any /* com.google.android.gms.internal.ads.zzbhg*/;
- public getBannerView(): globalAndroid.view.View;
- public constructor();
- public getInterstitialAdapterInfo(): globalAndroid.os.Bundle;
- public requestNativeAd(param0: globalAndroid.content.Context, param1: com.google.android.gms.ads.mediation.MediationNativeListener, param2: globalAndroid.os.Bundle, param3: com.google.android.gms.ads.mediation.NativeMediationAdRequest, param4: globalAndroid.os.Bundle): void;
- public requestBannerAd(param0: globalAndroid.content.Context, param1: com.google.android.gms.ads.mediation.MediationBannerListener, param2: globalAndroid.os.Bundle, param3: com.google.android.gms.ads.AdSize, param4: com.google.android.gms.ads.mediation.MediationAdRequest, param5: globalAndroid.os.Bundle): void;
- public buildExtrasBundle(param0: globalAndroid.os.Bundle, param1: globalAndroid.os.Bundle): globalAndroid.os.Bundle;
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module ads {
- export module mediation {
- export module customevent {
- export class CustomEvent {
- public static class: java.lang.Class;
- /**
- * Constructs a new instance of the com.google.ads.mediation.customevent.CustomEvent interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
- */
- public constructor(implementation: { destroy(): void });
- public constructor();
- public destroy(): void;
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module ads {
- export module mediation {
- export module customevent {
- export class CustomEventAdapter extends java.lang.Object {
- public static class: java.lang.Class;
- public getBannerView(): globalAndroid.view.View;
- public constructor();
- public getAdditionalParametersType(): java.lang.Class;
- public requestBannerAd(param0: com.google.ads.mediation.MediationBannerListener, param1: globalAndroid.app.Activity, param2: any, param3: com.google.ads.AdSize, param4: com.google.ads.mediation.MediationAdRequest, param5: any): void;
- public destroy(): void;
- public showInterstitial(): void;
- public getAdditionalParametersType(): java.lang.Class;
- public getServerParametersType(): java.lang.Class;
- public getServerParametersType(): java.lang.Class;
- public requestBannerAd(param0: com.google.ads.mediation.MediationBannerListener, param1: globalAndroid.app.Activity, param2: com.google.ads.mediation.customevent.CustomEventServerParameters, param3: com.google.ads.AdSize, param4: com.google.ads.mediation.MediationAdRequest, param5: com.google.android.gms.ads.mediation.customevent.CustomEventExtras): void;
- public requestInterstitialAd(param0: com.google.ads.mediation.MediationInterstitialListener, param1: globalAndroid.app.Activity, param2: com.google.ads.mediation.customevent.CustomEventServerParameters, param3: com.google.ads.mediation.MediationAdRequest, param4: com.google.android.gms.ads.mediation.customevent.CustomEventExtras): void;
- public requestInterstitialAd(param0: com.google.ads.mediation.MediationInterstitialListener, param1: globalAndroid.app.Activity, param2: any, param3: com.google.ads.mediation.MediationAdRequest, param4: any): void;
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module ads {
- export module mediation {
- export module customevent {
- export class CustomEventBanner extends com.google.ads.mediation.customevent.CustomEvent {
- public static class: java.lang.Class;
- /**
- * Constructs a new instance of the com.google.ads.mediation.customevent.CustomEventBanner interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
- */
- public constructor(implementation: { requestBannerAd(param0: com.google.ads.mediation.customevent.CustomEventBannerListener, param1: globalAndroid.app.Activity, param2: string, param3: string, param4: com.google.ads.AdSize, param5: com.google.ads.mediation.MediationAdRequest, param6: any): void; destroy(): void });
- public constructor();
- public requestBannerAd(param0: com.google.ads.mediation.customevent.CustomEventBannerListener, param1: globalAndroid.app.Activity, param2: string, param3: string, param4: com.google.ads.AdSize, param5: com.google.ads.mediation.MediationAdRequest, param6: any): void;
- public destroy(): void;
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module ads {
- export module mediation {
- export module customevent {
- export class CustomEventBannerListener extends com.google.ads.mediation.customevent.CustomEventListener {
- public static class: java.lang.Class;
- /**
- * Constructs a new instance of the com.google.ads.mediation.customevent.CustomEventBannerListener interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
- */
- public constructor(implementation: { onReceivedAd(param0: globalAndroid.view.View): void; onClick(): void; onFailedToReceiveAd(): void; onPresentScreen(): void; onDismissScreen(): void; onLeaveApplication(): void });
- public constructor();
- public onDismissScreen(): void;
- public onFailedToReceiveAd(): void;
- public onLeaveApplication(): void;
- public onClick(): void;
- public onPresentScreen(): void;
- public onReceivedAd(param0: globalAndroid.view.View): void;
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module ads {
- export module mediation {
- export module customevent {
- export class CustomEventInterstitial extends com.google.ads.mediation.customevent.CustomEvent {
- public static class: java.lang.Class;
- /**
- * Constructs a new instance of the com.google.ads.mediation.customevent.CustomEventInterstitial interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
- */
- public constructor(implementation: { requestInterstitialAd(param0: com.google.ads.mediation.customevent.CustomEventInterstitialListener, param1: globalAndroid.app.Activity, param2: string, param3: string, param4: com.google.ads.mediation.MediationAdRequest, param5: any): void; showInterstitial(): void; destroy(): void });
- public constructor();
- public showInterstitial(): void;
- public destroy(): void;
- public requestInterstitialAd(param0: com.google.ads.mediation.customevent.CustomEventInterstitialListener, param1: globalAndroid.app.Activity, param2: string, param3: string, param4: com.google.ads.mediation.MediationAdRequest, param5: any): void;
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module ads {
- export module mediation {
- export module customevent {
- export class CustomEventInterstitialListener extends com.google.ads.mediation.customevent.CustomEventListener {
- public static class: java.lang.Class;
- /**
- * Constructs a new instance of the com.google.ads.mediation.customevent.CustomEventInterstitialListener interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
- */
- public constructor(implementation: { onReceivedAd(): void; onFailedToReceiveAd(): void; onPresentScreen(): void; onDismissScreen(): void; onLeaveApplication(): void });
- public constructor();
- public onReceivedAd(): void;
- public onDismissScreen(): void;
- public onFailedToReceiveAd(): void;
- public onLeaveApplication(): void;
- public onPresentScreen(): void;
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module ads {
- export module mediation {
- export module customevent {
- export class CustomEventListener {
- public static class: java.lang.Class;
- /**
- * Constructs a new instance of the com.google.ads.mediation.customevent.CustomEventListener interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
- */
- public constructor(implementation: { onFailedToReceiveAd(): void; onPresentScreen(): void; onDismissScreen(): void; onLeaveApplication(): void });
- public constructor();
- public onDismissScreen(): void;
- public onFailedToReceiveAd(): void;
- public onLeaveApplication(): void;
- public onPresentScreen(): void;
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module ads {
- export module mediation {
- export module customevent {
- export class CustomEventServerParameters extends com.google.ads.mediation.MediationServerParameters {
- public static class: java.lang.Class;
- public label: string;
- public className: string;
- public parameter: string;
- public constructor();
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module ads {
- export module mediation {
- export module customevent {
- export class zza extends com.google.ads.mediation.customevent.CustomEventBannerListener {
- public static class: java.lang.Class;
- public onDismissScreen(): void;
- public onFailedToReceiveAd(): void;
- public onLeaveApplication(): void;
- public onClick(): void;
- public constructor(param0: com.google.ads.mediation.customevent.CustomEventAdapter, param1: com.google.ads.mediation.MediationBannerListener);
- public onPresentScreen(): void;
- public onReceivedAd(param0: globalAndroid.view.View): void;
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module ads {
- export module mediation {
- export module customevent {
- export class zzb extends com.google.ads.mediation.customevent.CustomEventInterstitialListener {
- public static class: java.lang.Class;
- public onReceivedAd(): void;
- public onDismissScreen(): void;
- public constructor(param0: com.google.ads.mediation.customevent.CustomEventAdapter, param1: com.google.ads.mediation.customevent.CustomEventAdapter, param2: com.google.ads.mediation.MediationInterstitialListener);
- public onFailedToReceiveAd(): void;
- public onLeaveApplication(): void;
- public onPresentScreen(): void;
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module ads {
- export module mediation {
- export class zza extends com.google.android.gms.ads.mediation.UnifiedNativeAdMapper {
- public static class: java.lang.Class;
- public constructor();
- public trackViews(param0: globalAndroid.view.View, param1: java.util.Map, param2: java.util.Map): void;
- public constructor(param0: com.google.android.gms.ads.formats.UnifiedNativeAd);
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module ads {
- export module mediation {
- export class zzb extends com.google.android.gms.ads.AdListener implements com.google.android.gms.ads.admanager.AppEventListener, com.google.android.gms.internal.ads.zzbcz {
- public static class: java.lang.Class;
- public onAdClosed(): void;
- public onAdFailedToLoad(param0: com.google.android.gms.ads.LoadAdError): void;
- public onAppEvent(param0: string, param1: string): void;
- public constructor(param0: com.google.ads.mediation.AbstractAdViewAdapter, param1: com.google.android.gms.ads.mediation.MediationBannerListener);
- public constructor();
- public onAdLoaded(): void;
- public onAdOpened(): void;
- public onAdClicked(): void;
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module ads {
- export module mediation {
- export class zzc extends com.google.android.gms.ads.interstitial.InterstitialAdLoadCallback {
- public static class: java.lang.Class;
- public onAdFailedToLoad(param0: com.google.android.gms.ads.LoadAdError): void;
- public constructor(param0: com.google.ads.mediation.AbstractAdViewAdapter, param1: com.google.android.gms.ads.mediation.MediationInterstitialListener);
- public constructor();
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module ads {
- export module mediation {
- export class zzd extends com.google.android.gms.ads.FullScreenContentCallback {
- public static class: java.lang.Class;
- public constructor(param0: com.google.ads.mediation.AbstractAdViewAdapter, param1: com.google.android.gms.ads.mediation.MediationInterstitialListener);
- public constructor();
- public onAdShowedFullScreenContent(): void;
- public onAdDismissedFullScreenContent(): void;
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module ads {
- export module mediation {
- export class zze extends com.google.android.gms.ads.AdListener implements com.google.android.gms.ads.formats.UnifiedNativeAd.OnUnifiedNativeAdLoadedListener, com.google.android.gms.ads.formats.NativeCustomTemplateAd.OnCustomTemplateAdLoadedListener, com.google.android.gms.ads.formats.NativeCustomTemplateAd.OnCustomClickListener {
- public static class: java.lang.Class;
- public onAdImpression(): void;
- public onAdClosed(): void;
- public onCustomTemplateAdLoaded(param0: com.google.android.gms.ads.formats.NativeCustomTemplateAd): void;
- public constructor(param0: com.google.ads.mediation.AbstractAdViewAdapter, param1: com.google.android.gms.ads.mediation.MediationNativeListener);
- public onAdFailedToLoad(param0: com.google.android.gms.ads.LoadAdError): void;
- public constructor();
- public onUnifiedNativeAdLoaded(param0: com.google.android.gms.ads.formats.UnifiedNativeAd): void;
- public onAdLoaded(): void;
- public onAdOpened(): void;
- public onAdClicked(): void;
- public onCustomClick(param0: com.google.android.gms.ads.formats.NativeCustomTemplateAd, param1: string): void;
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export class AdActivity {
- public static class: java.lang.Class;
- public static CLASS_NAME: string;
- public constructor();
- public onConfigurationChanged(param0: globalAndroid.content.res.Configuration): void;
- public onResume(): void;
- public onUserLeaveHint(): void;
- public onStop(): void;
- public onBackPressed(): void;
- public onPause(): void;
- public onRestart(): void;
- public onDestroy(): void;
- public setContentView(param0: globalAndroid.view.View): void;
- public onCreate(param0: globalAndroid.os.Bundle): void;
- public onSaveInstanceState(param0: globalAndroid.os.Bundle): void;
- public onActivityResult(param0: number, param1: number, param2: globalAndroid.content.Intent): void;
- public setContentView(param0: number): void;
- public onStart(): void;
- public setContentView(param0: globalAndroid.view.View, param1: globalAndroid.view.ViewGroup.LayoutParams): void;
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export class AdError {
- public static class: java.lang.Class;
- public static UNDEFINED_DOMAIN: string;
- public getMessage(): string;
- public getDomain(): string;
- public getCause(): com.google.android.gms.ads.AdError;
- public getCode(): number;
- public constructor(param0: number, param1: string, param2: string);
- public toString(): string;
- public constructor(param0: number, param1: string, param2: string, param3: com.google.android.gms.ads.AdError);
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export class AdFormat {
- public static class: java.lang.Class;
- public static BANNER: com.google.android.gms.ads.AdFormat;
- public static INTERSTITIAL: com.google.android.gms.ads.AdFormat;
- public static REWARDED: com.google.android.gms.ads.AdFormat;
- public static REWARDED_INTERSTITIAL: com.google.android.gms.ads.AdFormat;
- public static NATIVE: com.google.android.gms.ads.AdFormat;
- public static UNKNOWN: com.google.android.gms.ads.AdFormat;
- public static valueOf(param0: string): com.google.android.gms.ads.AdFormat;
- public static values(): native.Array;
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export class AdInspectorError extends com.google.android.gms.ads.AdError {
- public static class: java.lang.Class;
- public static ERROR_CODE_INTERNAL_ERROR: number;
- public static ERROR_CODE_FAILED_TO_LOAD: number;
- public static ERROR_CODE_NOT_IN_TEST_MODE: number;
- public static ERROR_CODE_ALREADY_OPEN: number;
- public getCode(): number;
- public constructor(param0: number, param1: string, param2: string);
- public constructor(param0: number, param1: string, param2: string, param3: com.google.android.gms.ads.AdError);
- }
- export module AdInspectorError {
- export class AdInspectorErrorCode {
- public static class: java.lang.Class;
- /**
- * Constructs a new instance of the com.google.android.gms.ads.AdInspectorError$AdInspectorErrorCode interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
- */
- public constructor(implementation: {});
- public constructor();
- }
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export abstract class AdListener {
- public static class: java.lang.Class;
- public constructor();
- public onAdLoaded(): void;
- public onAdClicked(): void;
- public onAdFailedToLoad(param0: com.google.android.gms.ads.LoadAdError): void;
- public onAdClosed(): void;
- public onAdImpression(): void;
- public onAdOpened(): void;
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export abstract class AdLoadCallback extends java.lang.Object {
- public static class: java.lang.Class;
- public constructor();
- public onAdLoaded(param0: AdT): void;
- public onAdFailedToLoad(param0: com.google.android.gms.ads.LoadAdError): void;
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export class AdLoader {
- public static class: java.lang.Class;
- public isLoading(): boolean;
- public loadAds(param0: com.google.android.gms.ads.AdRequest, param1: number): void;
- public loadAd(param0: com.google.android.gms.ads.AdRequest): void;
- public loadAd(param0: com.google.android.gms.ads.admanager.AdManagerAdRequest): void;
- }
- export module AdLoader {
- export class Builder {
- public static class: java.lang.Class;
- /** @deprecated */
- public withNativeAdOptions(param0: com.google.android.gms.ads.formats.NativeAdOptions): com.google.android.gms.ads.AdLoader.Builder;
- public forNativeAd(param0: com.google.android.gms.ads.nativead.NativeAd.OnNativeAdLoadedListener): com.google.android.gms.ads.AdLoader.Builder;
- public build(): com.google.android.gms.ads.AdLoader;
- public withAdManagerAdViewOptions(param0: com.google.android.gms.ads.formats.AdManagerAdViewOptions): com.google.android.gms.ads.AdLoader.Builder;
- public forCustomFormatAd(param0: string, param1: com.google.android.gms.ads.nativead.NativeCustomFormatAd.OnCustomFormatAdLoadedListener, param2: com.google.android.gms.ads.nativead.NativeCustomFormatAd.OnCustomClickListener): com.google.android.gms.ads.AdLoader.Builder;
- public withAdListener(param0: com.google.android.gms.ads.AdListener): com.google.android.gms.ads.AdLoader.Builder;
- public withNativeAdOptions(param0: com.google.android.gms.ads.nativead.NativeAdOptions): com.google.android.gms.ads.AdLoader.Builder;
- /** @deprecated */
- public forUnifiedNativeAd(param0: com.google.android.gms.ads.formats.UnifiedNativeAd.OnUnifiedNativeAdLoadedListener): com.google.android.gms.ads.AdLoader.Builder;
- /** @deprecated */
- public forCustomTemplateAd(param0: string, param1: com.google.android.gms.ads.formats.NativeCustomTemplateAd.OnCustomTemplateAdLoadedListener, param2: com.google.android.gms.ads.formats.NativeCustomTemplateAd.OnCustomClickListener): com.google.android.gms.ads.AdLoader.Builder;
- public forAdManagerAdView(param0: com.google.android.gms.ads.formats.OnAdManagerAdViewLoadedListener, param1: native.Array): com.google.android.gms.ads.AdLoader.Builder;
- public constructor(param0: globalAndroid.content.Context, param1: string);
- }
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export class AdRequest {
- public static class: java.lang.Class;
- public static ERROR_CODE_INTERNAL_ERROR: number;
- public static ERROR_CODE_INVALID_REQUEST: number;
- public static ERROR_CODE_NETWORK_ERROR: number;
- public static ERROR_CODE_NO_FILL: number;
- public static ERROR_CODE_APP_ID_MISSING: number;
- public static ERROR_CODE_REQUEST_ID_MISMATCH: number;
- public static ERROR_CODE_INVALID_AD_STRING: number;
- public static ERROR_CODE_MEDIATION_NO_FILL: number;
- public static GENDER_UNKNOWN: number;
- public static GENDER_MALE: number;
- public static GENDER_FEMALE: number;
- public static MAX_CONTENT_URL_LENGTH: number;
- public static DEVICE_ID_EMULATOR: string;
- public getNeighboringContentUrls(): java.util.List;
- public constructor(param0: com.google.android.gms.ads.AdRequest.Builder);
- public getLocation(): globalAndroid.location.Location;
- public getNetworkExtrasBundle(param0: java.lang.Class): globalAndroid.os.Bundle;
- public getKeywords(): java.util.Set;
- public getContentUrl(): string;
- public getCustomEventExtrasBundle(param0: java.lang.Class): globalAndroid.os.Bundle;
- public isTestDevice(param0: globalAndroid.content.Context): boolean;
- public getCustomTargeting(): globalAndroid.os.Bundle;
- }
- export module AdRequest {
- export class Builder {
- public static class: java.lang.Class;
- public constructor();
- public setNeighboringContentUrls(param0: java.util.List): com.google.android.gms.ads.AdRequest.Builder;
- /** @deprecated */
- public addNetworkExtras(param0: com.google.android.gms.ads.mediation.NetworkExtras): com.google.android.gms.ads.AdRequest.Builder;
- public setAdString(param0: string): com.google.android.gms.ads.AdRequest.Builder;
- public setContentUrl(param0: string): com.google.android.gms.ads.AdRequest.Builder;
- public addKeyword(param0: string): com.google.android.gms.ads.AdRequest.Builder;
- public addNetworkExtrasBundle(param0: java.lang.Class, param1: globalAndroid.os.Bundle): com.google.android.gms.ads.AdRequest.Builder;
- public addCustomEventExtrasBundle(param0: java.lang.Class, param1: globalAndroid.os.Bundle): com.google.android.gms.ads.AdRequest.Builder;
- public build(): com.google.android.gms.ads.AdRequest;
- public setHttpTimeoutMillis(param0: number): com.google.android.gms.ads.AdRequest.Builder;
- /** @deprecated */
- public setAdInfo(param0: com.google.android.gms.ads.query.AdInfo): com.google.android.gms.ads.AdRequest.Builder;
- public setRequestAgent(param0: string): com.google.android.gms.ads.AdRequest.Builder;
- }
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export class AdService {
- public static class: java.lang.Class;
- public constructor();
- public onHandleIntent(param0: globalAndroid.content.Intent): void;
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export class AdSize {
- public static class: java.lang.Class;
- public static FULL_WIDTH: number;
- public static AUTO_HEIGHT: number;
- public static BANNER: com.google.android.gms.ads.AdSize;
- public static FULL_BANNER: com.google.android.gms.ads.AdSize;
- public static LARGE_BANNER: com.google.android.gms.ads.AdSize;
- public static LEADERBOARD: com.google.android.gms.ads.AdSize;
- public static MEDIUM_RECTANGLE: com.google.android.gms.ads.AdSize;
- public static WIDE_SKYSCRAPER: com.google.android.gms.ads.AdSize;
- public static SMART_BANNER: com.google.android.gms.ads.AdSize;
- public static FLUID: com.google.android.gms.ads.AdSize;
- public static INVALID: com.google.android.gms.ads.AdSize;
- public static SEARCH: com.google.android.gms.ads.AdSize;
- public static getLandscapeInlineAdaptiveBannerAdSize(param0: globalAndroid.content.Context, param1: number): com.google.android.gms.ads.AdSize;
- public static getCurrentOrientationInterscrollerAdSize(param0: globalAndroid.content.Context, param1: number): com.google.android.gms.ads.AdSize;
- public static getInlineAdaptiveBannerAdSize(param0: number, param1: number): com.google.android.gms.ads.AdSize;
- public static getPortraitInlineAdaptiveBannerAdSize(param0: globalAndroid.content.Context, param1: number): com.google.android.gms.ads.AdSize;
- public equals(param0: any): boolean;
- public hashCode(): number;
- public getHeight(): number;
- public isFullWidth(): boolean;
- public static getCurrentOrientationAnchoredAdaptiveBannerAdSize(param0: globalAndroid.content.Context, param1: number): com.google.android.gms.ads.AdSize;
- public toString(): string;
- public isAutoHeight(): boolean;
- public getWidth(): number;
- public static getCurrentOrientationInlineAdaptiveBannerAdSize(param0: globalAndroid.content.Context, param1: number): com.google.android.gms.ads.AdSize;
- public static getPortraitInterscrollerAdSize(param0: globalAndroid.content.Context, param1: number): com.google.android.gms.ads.AdSize;
- public getWidthInPixels(param0: globalAndroid.content.Context): number;
- public isFluid(): boolean;
- public constructor(param0: number, param1: number);
- public static getPortraitAnchoredAdaptiveBannerAdSize(param0: globalAndroid.content.Context, param1: number): com.google.android.gms.ads.AdSize;
- public static getLandscapeAnchoredAdaptiveBannerAdSize(param0: globalAndroid.content.Context, param1: number): com.google.android.gms.ads.AdSize;
- public static getLandscapeInterscrollerAdSize(param0: globalAndroid.content.Context, param1: number): com.google.android.gms.ads.AdSize;
- public getHeightInPixels(param0: globalAndroid.content.Context): number;
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export class AdValue {
- public static class: java.lang.Class;
- public getPrecisionType(): number;
- public getCurrencyCode(): string;
- public getValueMicros(): number;
- }
- export module AdValue {
- export class PrecisionType {
- public static class: java.lang.Class;
- /**
- * Constructs a new instance of the com.google.android.gms.ads.AdValue$PrecisionType interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
- */
- public constructor(implementation: {});
- public constructor();
- public static UNKNOWN: number;
- public static ESTIMATED: number;
- public static PRECISE: number;
- public static PUBLISHER_PROVIDED: number;
- }
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export class AdView extends com.google.android.gms.ads.BaseAdView {
- public static class: java.lang.Class;
- public constructor(param0: globalAndroid.content.Context, param1: globalAndroid.util.AttributeSet, param2: number, param3: number, param4: boolean);
- public constructor(param0: globalAndroid.content.Context, param1: globalAndroid.util.AttributeSet, param2: number, param3: number);
- public constructor(param0: globalAndroid.content.Context);
- public constructor(param0: globalAndroid.content.Context, param1: globalAndroid.util.AttributeSet, param2: number);
- public constructor(param0: globalAndroid.content.Context, param1: globalAndroid.util.AttributeSet, param2: boolean);
- public constructor(param0: globalAndroid.content.Context, param1: number);
- public constructor(param0: globalAndroid.content.Context, param1: globalAndroid.util.AttributeSet);
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export class AdapterResponseInfo {
- public static class: java.lang.Class;
- public getLatencyMillis(): number;
- public getAdError(): com.google.android.gms.ads.AdError;
- public getCredentials(): globalAndroid.os.Bundle;
- public getAdapterClassName(): string;
- public toString(): string;
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export abstract class BaseAdView {
- public static class: java.lang.Class;
- public constructor(param0: globalAndroid.content.Context, param1: globalAndroid.util.AttributeSet, param2: number, param3: number, param4: boolean);
- public isLoading(): boolean;
- public setOnPaidEventListener(param0: com.google.android.gms.ads.OnPaidEventListener): void;
- public constructor(param0: globalAndroid.content.Context, param1: globalAndroid.util.AttributeSet, param2: number, param3: number);
- public getAdUnitId(): string;
- public getAdListener(): com.google.android.gms.ads.AdListener;
- public setAdSize(param0: com.google.android.gms.ads.AdSize): void;
- public pause(): void;
- public destroy(): void;
- public getAdSize(): com.google.android.gms.ads.AdSize;
- public setAdListener(param0: com.google.android.gms.ads.AdListener): void;
- public onLayout(param0: boolean, param1: number, param2: number, param3: number, param4: number): void;
- public resume(): void;
- public setAdUnitId(param0: string): void;
- public getOnPaidEventListener(): com.google.android.gms.ads.OnPaidEventListener;
- public constructor(param0: globalAndroid.content.Context, param1: globalAndroid.util.AttributeSet, param2: number);
- public constructor(param0: globalAndroid.content.Context, param1: globalAndroid.util.AttributeSet, param2: boolean);
- public constructor(param0: globalAndroid.content.Context, param1: number);
- public loadAd(param0: com.google.android.gms.ads.AdRequest): void;
- public onMeasure(param0: number, param1: number): void;
- public getResponseInfo(): com.google.android.gms.ads.ResponseInfo;
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export abstract class FullScreenContentCallback {
- public static class: java.lang.Class;
- public static ERROR_CODE_INTERNAL_ERROR: number;
- public static ERROR_CODE_AD_REUSED: number;
- public static ERROR_CODE_NOT_READY: number;
- public static ERROR_CODE_APP_NOT_FOREGROUND: number;
- public static ERROR_CODE_MEDIATION_SHOW_ERROR: number;
- public constructor();
- public onAdFailedToShowFullScreenContent(param0: com.google.android.gms.ads.AdError): void;
- public onAdShowedFullScreenContent(): void;
- public onAdDismissedFullScreenContent(): void;
- public onAdImpression(): void;
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export class LoadAdError extends com.google.android.gms.ads.AdError {
- public static class: java.lang.Class;
- public constructor(param0: number, param1: string, param2: string, param3: com.google.android.gms.ads.AdError, param4: com.google.android.gms.ads.ResponseInfo);
- public constructor(param0: number, param1: string, param2: string);
- public toString(): string;
- public constructor(param0: number, param1: string, param2: string, param3: com.google.android.gms.ads.AdError);
- public getResponseInfo(): com.google.android.gms.ads.ResponseInfo;
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export class MediaAspectRatio {
- public static class: java.lang.Class;
- /**
- * Constructs a new instance of the com.google.android.gms.ads.MediaAspectRatio interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
- */
- public constructor(implementation: {});
- public constructor();
- public static UNKNOWN: number;
- public static ANY: number;
- public static SQUARE: number;
- public static LANDSCAPE: number;
- public static PORTRAIT: number;
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export class MediaContent {
- public static class: java.lang.Class;
- /**
- * Constructs a new instance of the com.google.android.gms.ads.MediaContent interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
- */
- public constructor(implementation: { getAspectRatio(): number; getDuration(): number; getCurrentTime(): number; getVideoController(): com.google.android.gms.ads.VideoController; hasVideoContent(): boolean; setMainImage(param0: globalAndroid.graphics.drawable.Drawable): void; getMainImage(): globalAndroid.graphics.drawable.Drawable });
- public constructor();
- public hasVideoContent(): boolean;
- public getMainImage(): globalAndroid.graphics.drawable.Drawable;
- public getDuration(): number;
- public setMainImage(param0: globalAndroid.graphics.drawable.Drawable): void;
- public getCurrentTime(): number;
- public getVideoController(): com.google.android.gms.ads.VideoController;
- public getAspectRatio(): number;
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export class MediationUtils {
- public static class: java.lang.Class;
- public static MIN_WIDTH_RATIO: number;
- public static MIN_HEIGHT_RATIO: number;
- public constructor();
- public static findClosestSize(param0: globalAndroid.content.Context, param1: com.google.android.gms.ads.AdSize, param2: java.util.List): com.google.android.gms.ads.AdSize;
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export class MobileAds {
- public static class: java.lang.Class;
- public static ERROR_DOMAIN: string;
- public static setAppVolume(param0: number): void;
- public static getVersionString(): string;
- public static setRequestConfiguration(param0: com.google.android.gms.ads.RequestConfiguration): void;
- public static disableMediationAdapterInitialization(param0: globalAndroid.content.Context): void;
- public static openAdInspector(param0: globalAndroid.content.Context, param1: com.google.android.gms.ads.OnAdInspectorClosedListener): void;
- public static initialize(param0: globalAndroid.content.Context): void;
- public static setAppMuted(param0: boolean): void;
- public static initialize(param0: globalAndroid.content.Context, param1: com.google.android.gms.ads.initialization.OnInitializationCompleteListener): void;
- public static registerWebView(param0: globalAndroid.webkit.WebView): void;
- public static registerRtbAdapter(param0: java.lang.Class): void;
- public static getInitializationStatus(): com.google.android.gms.ads.initialization.InitializationStatus;
- public static getRequestConfiguration(): com.google.android.gms.ads.RequestConfiguration;
- public static openDebugMenu(param0: globalAndroid.content.Context, param1: string): void;
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export class MobileAdsInitProvider {
- public static class: java.lang.Class;
- public constructor();
- public delete(param0: globalAndroid.net.Uri, param1: string, param2: native.Array): number;
- public attachInfo(param0: globalAndroid.content.Context, param1: globalAndroid.content.pm.ProviderInfo): void;
- public query(param0: globalAndroid.net.Uri, param1: native.Array, param2: string, param3: native.Array, param4: string): globalAndroid.database.Cursor;
- public onCreate(): boolean;
- public getType(param0: globalAndroid.net.Uri): string;
- public update(param0: globalAndroid.net.Uri, param1: globalAndroid.content.ContentValues, param2: string, param3: native.Array): number;
- public insert(param0: globalAndroid.net.Uri, param1: globalAndroid.content.ContentValues): globalAndroid.net.Uri;
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export class MuteThisAdListener {
- public static class: java.lang.Class;
- /**
- * Constructs a new instance of the com.google.android.gms.ads.MuteThisAdListener interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
- */
- public constructor(implementation: { onAdMuted(): void });
- public constructor();
- public onAdMuted(): void;
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export class MuteThisAdReason {
- public static class: java.lang.Class;
- /**
- * Constructs a new instance of the com.google.android.gms.ads.MuteThisAdReason interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
- */
- public constructor(implementation: { getDescription(): string });
- public constructor();
- public getDescription(): string;
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export class OnAdInspectorClosedListener {
- public static class: java.lang.Class;
- /**
- * Constructs a new instance of the com.google.android.gms.ads.OnAdInspectorClosedListener interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
- */
- public constructor(implementation: { onAdInspectorClosed(param0: com.google.android.gms.ads.AdInspectorError): void });
- public constructor();
- public onAdInspectorClosed(param0: com.google.android.gms.ads.AdInspectorError): void;
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export class OnPaidEventListener {
- public static class: java.lang.Class;
- /**
- * Constructs a new instance of the com.google.android.gms.ads.OnPaidEventListener interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
- */
- public constructor(implementation: { onPaidEvent(param0: com.google.android.gms.ads.AdValue): void });
- public constructor();
- public onPaidEvent(param0: com.google.android.gms.ads.AdValue): void;
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export class OnUserEarnedRewardListener {
- public static class: java.lang.Class;
- /**
- * Constructs a new instance of the com.google.android.gms.ads.OnUserEarnedRewardListener interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
- */
- public constructor(implementation: { onUserEarnedReward(param0: com.google.android.gms.ads.rewarded.RewardItem): void });
- public constructor();
- public onUserEarnedReward(param0: com.google.android.gms.ads.rewarded.RewardItem): void;
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export class RequestConfiguration {
- public static class: java.lang.Class;
- public static TAG_FOR_CHILD_DIRECTED_TREATMENT_UNSPECIFIED: number;
- public static TAG_FOR_CHILD_DIRECTED_TREATMENT_FALSE: number;
- public static TAG_FOR_CHILD_DIRECTED_TREATMENT_TRUE: number;
- public static TAG_FOR_UNDER_AGE_OF_CONSENT_TRUE: number;
- public static TAG_FOR_UNDER_AGE_OF_CONSENT_FALSE: number;
- public static TAG_FOR_UNDER_AGE_OF_CONSENT_UNSPECIFIED: number;
- public static MAX_AD_CONTENT_RATING_UNSPECIFIED: string;
- public static MAX_AD_CONTENT_RATING_G: string;
- public static MAX_AD_CONTENT_RATING_PG: string;
- public static MAX_AD_CONTENT_RATING_T: string;
- public static MAX_AD_CONTENT_RATING_MA: string;
- public getMaxAdContentRating(): string;
- public getTagForUnderAgeOfConsent(): number;
- public toBuilder(): com.google.android.gms.ads.RequestConfiguration.Builder;
- public getTestDeviceIds(): java.util.List;
- public getTagForChildDirectedTreatment(): number;
- }
- export module RequestConfiguration {
- export class Builder {
- public static class: java.lang.Class;
- public constructor();
- public setTestDeviceIds(param0: java.util.List): com.google.android.gms.ads.RequestConfiguration.Builder;
- public setTagForUnderAgeOfConsent(param0: number): com.google.android.gms.ads.RequestConfiguration.Builder;
- public setTagForChildDirectedTreatment(param0: number): com.google.android.gms.ads.RequestConfiguration.Builder;
- public build(): com.google.android.gms.ads.RequestConfiguration;
- public setMaxAdContentRating(param0: string): com.google.android.gms.ads.RequestConfiguration.Builder;
- }
- export class MaxAdContentRating {
- public static class: java.lang.Class;
- /**
- * Constructs a new instance of the com.google.android.gms.ads.RequestConfiguration$MaxAdContentRating interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
- */
- public constructor(implementation: {});
- public constructor();
- }
- export class TagForChildDirectedTreatment {
- public static class: java.lang.Class;
- /**
- * Constructs a new instance of the com.google.android.gms.ads.RequestConfiguration$TagForChildDirectedTreatment interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
- */
- public constructor(implementation: {});
- public constructor();
- }
- export class TagForUnderAgeOfConsent {
- public static class: java.lang.Class;
- /**
- * Constructs a new instance of the com.google.android.gms.ads.RequestConfiguration$TagForUnderAgeOfConsent interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
- */
- public constructor(implementation: {});
- public constructor();
- }
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export class ResponseInfo {
- public static class: java.lang.Class;
- public getAdapterResponses(): java.util.List;
- public getMediationAdapterClassName(): string;
- public getResponseId(): string;
- public toString(): string;
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export class VideoController {
- public static class: java.lang.Class;
- public static PLAYBACK_STATE_UNKNOWN: number;
- public static PLAYBACK_STATE_PLAYING: number;
- public static PLAYBACK_STATE_PAUSED: number;
- public static PLAYBACK_STATE_ENDED: number;
- public static PLAYBACK_STATE_READY: number;
- public setVideoLifecycleCallbacks(param0: com.google.android.gms.ads.VideoController.VideoLifecycleCallbacks): void;
- public hasVideoContent(): boolean;
- public constructor();
- public mute(param0: boolean): void;
- public pause(): void;
- public getVideoLifecycleCallbacks(): com.google.android.gms.ads.VideoController.VideoLifecycleCallbacks;
- public isCustomControlsEnabled(): boolean;
- public stop(): void;
- public play(): void;
- public isClickToExpandEnabled(): boolean;
- public isMuted(): boolean;
- public getPlaybackState(): number;
- }
- export module VideoController {
- export abstract class VideoLifecycleCallbacks {
- public static class: java.lang.Class;
- public constructor();
- public onVideoPlay(): void;
- public onVideoStart(): void;
- public onVideoPause(): void;
- public onVideoMute(param0: boolean): void;
- public onVideoEnd(): void;
- }
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export class VideoOptions {
- public static class: java.lang.Class;
- public constructor(param0: any /* com.google.android.gms.internal.ads.zzbiv*/);
- public getStartMuted(): boolean;
- public getCustomControlsRequested(): boolean;
- public getClickToExpandRequested(): boolean;
- }
- export module VideoOptions {
- export class Builder {
- public static class: java.lang.Class;
- public constructor();
- public setCustomControlsRequested(param0: boolean): com.google.android.gms.ads.VideoOptions.Builder;
- public setStartMuted(param0: boolean): com.google.android.gms.ads.VideoOptions.Builder;
- public setClickToExpandRequested(param0: boolean): com.google.android.gms.ads.VideoOptions.Builder;
- public build(): com.google.android.gms.ads.VideoOptions;
- }
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export module admanager {
- export class AdManagerAdRequest extends com.google.android.gms.ads.AdRequest {
- public static class: java.lang.Class;
- public getPublisherProvidedId(): string;
- public getCustomTargeting(): globalAndroid.os.Bundle;
- }
- export module AdManagerAdRequest {
- export class Builder extends com.google.android.gms.ads.AdRequest.Builder {
- public static class: java.lang.Class;
- public addCustomTargeting(param0: string, param1: java.util.List): com.google.android.gms.ads.admanager.AdManagerAdRequest.Builder;
- public build(): com.google.android.gms.ads.admanager.AdManagerAdRequest;
- public addCustomTargeting(param0: string, param1: string): com.google.android.gms.ads.admanager.AdManagerAdRequest.Builder;
- public addCategoryExclusion(param0: string): com.google.android.gms.ads.admanager.AdManagerAdRequest.Builder;
- public setAdString(param0: string): com.google.android.gms.ads.admanager.AdManagerAdRequest.Builder;
- /** @deprecated */
- public setAdInfo(param0: com.google.android.gms.ads.query.AdInfo): com.google.android.gms.ads.admanager.AdManagerAdRequest.Builder;
- public constructor();
- public setPublisherProvidedId(param0: string): com.google.android.gms.ads.admanager.AdManagerAdRequest.Builder;
- public build(): com.google.android.gms.ads.AdRequest;
- /** @deprecated */
- public setAdInfo(param0: com.google.android.gms.ads.query.AdInfo): com.google.android.gms.ads.AdRequest.Builder;
- public setAdString(param0: string): com.google.android.gms.ads.AdRequest.Builder;
- }
- }
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export module admanager {
- export class AdManagerAdView extends com.google.android.gms.ads.BaseAdView {
- public static class: java.lang.Class;
- public setAppEventListener(param0: com.google.android.gms.ads.admanager.AppEventListener): void;
- public setManualImpressionsEnabled(param0: boolean): void;
- public loadAd(param0: com.google.android.gms.ads.AdRequest): void;
- public constructor(param0: globalAndroid.content.Context, param1: globalAndroid.util.AttributeSet, param2: number, param3: number);
- public constructor(param0: globalAndroid.content.Context, param1: globalAndroid.util.AttributeSet, param2: boolean);
- public constructor(param0: globalAndroid.content.Context, param1: globalAndroid.util.AttributeSet);
- public constructor(param0: globalAndroid.content.Context, param1: globalAndroid.util.AttributeSet, param2: number, param3: number, param4: boolean);
- public getVideoOptions(): com.google.android.gms.ads.VideoOptions;
- public constructor(param0: globalAndroid.content.Context, param1: number);
- public getVideoController(): com.google.android.gms.ads.VideoController;
- public setVideoOptions(param0: com.google.android.gms.ads.VideoOptions): void;
- public getAppEventListener(): com.google.android.gms.ads.admanager.AppEventListener;
- public setAdSizes(param0: native.Array): void;
- public constructor(param0: globalAndroid.content.Context, param1: globalAndroid.util.AttributeSet, param2: number);
- public getAdSizes(): native.Array;
- public loadAd(param0: com.google.android.gms.ads.admanager.AdManagerAdRequest): void;
- public recordManualImpression(): void;
- public constructor(param0: globalAndroid.content.Context);
- }
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export module admanager {
- export abstract class AdManagerInterstitialAd extends com.google.android.gms.ads.interstitial.InterstitialAd {
- public static class: java.lang.Class;
- public constructor();
- public setAppEventListener(param0: com.google.android.gms.ads.admanager.AppEventListener): void;
- public static load(param0: globalAndroid.content.Context, param1: string, param2: com.google.android.gms.ads.AdRequest, param3: com.google.android.gms.ads.interstitial.InterstitialAdLoadCallback): void;
- public getAppEventListener(): com.google.android.gms.ads.admanager.AppEventListener;
- public static load(param0: globalAndroid.content.Context, param1: string, param2: com.google.android.gms.ads.admanager.AdManagerAdRequest, param3: com.google.android.gms.ads.admanager.AdManagerInterstitialAdLoadCallback): void;
- }
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export module admanager {
- export abstract class AdManagerInterstitialAdLoadCallback extends com.google.android.gms.ads.AdLoadCallback {
- public static class: java.lang.Class;
- public constructor();
- }
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export module admanager {
- export class AppEventListener {
- public static class: java.lang.Class;
- /**
- * Constructs a new instance of the com.google.android.gms.ads.admanager.AppEventListener interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
- */
- public constructor(implementation: { onAppEvent(param0: string, param1: string): void });
- public constructor();
- public onAppEvent(param0: string, param1: string): void;
- }
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export module admanager {
- export class zza {
- public static class: java.lang.Class;
- }
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export module appopen {
- export abstract class AppOpenAd {
- public static class: java.lang.Class;
- public static APP_OPEN_AD_ORIENTATION_PORTRAIT: number;
- public static APP_OPEN_AD_ORIENTATION_LANDSCAPE: number;
- public constructor();
- public getAdUnitId(): string;
- public getResponseInfo(): com.google.android.gms.ads.ResponseInfo;
- public setImmersiveMode(param0: boolean): void;
- public setFullScreenContentCallback(param0: com.google.android.gms.ads.FullScreenContentCallback): void;
- public getFullScreenContentCallback(): com.google.android.gms.ads.FullScreenContentCallback;
- public static load(param0: globalAndroid.content.Context, param1: string, param2: com.google.android.gms.ads.AdRequest, param3: number, param4: com.google.android.gms.ads.appopen.AppOpenAd.AppOpenAdLoadCallback): void;
- public static load(param0: globalAndroid.content.Context, param1: string, param2: com.google.android.gms.ads.admanager.AdManagerAdRequest, param3: number, param4: com.google.android.gms.ads.appopen.AppOpenAd.AppOpenAdLoadCallback): void;
- public show(param0: globalAndroid.app.Activity): void;
- public getOnPaidEventListener(): com.google.android.gms.ads.OnPaidEventListener;
- public setOnPaidEventListener(param0: com.google.android.gms.ads.OnPaidEventListener): void;
- }
- export module AppOpenAd {
- export abstract class AppOpenAdLoadCallback extends com.google.android.gms.ads.AdLoadCallback {
- public static class: java.lang.Class;
- public constructor();
- }
- export class AppOpenAdOrientation {
- public static class: java.lang.Class;
- /**
- * Constructs a new instance of the com.google.android.gms.ads.appopen.AppOpenAd$AppOpenAdOrientation interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
- */
- public constructor(implementation: {});
- public constructor();
- }
- }
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export module formats {
- export class AdManagerAdViewOptions {
- public static class: java.lang.Class;
- public static CREATOR: globalAndroid.os.Parcelable.Creator;
- public getManualImpressionsEnabled(): boolean;
- public writeToParcel(param0: globalAndroid.os.Parcel, param1: number): void;
- }
- export module AdManagerAdViewOptions {
- export class Builder {
- public static class: java.lang.Class;
- public setShouldDelayBannerRenderingListener(param0: com.google.android.gms.ads.formats.ShouldDelayBannerRenderingListener): com.google.android.gms.ads.formats.AdManagerAdViewOptions.Builder;
- public constructor();
- public setManualImpressionsEnabled(param0: boolean): com.google.android.gms.ads.formats.AdManagerAdViewOptions.Builder;
- public build(): com.google.android.gms.ads.formats.AdManagerAdViewOptions;
- }
- }
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export module formats {
- export class MediaView {
- public static class: java.lang.Class;
- public setMediaContent(param0: com.google.android.gms.ads.MediaContent): void;
- public constructor(param0: globalAndroid.content.Context, param1: globalAndroid.util.AttributeSet, param2: number, param3: number);
- public constructor(param0: globalAndroid.content.Context, param1: globalAndroid.util.AttributeSet);
- public constructor(param0: globalAndroid.content.Context, param1: globalAndroid.util.AttributeSet, param2: number);
- public setImageScaleType(param0: globalAndroid.widget.ImageView.ScaleType): void;
- public constructor(param0: globalAndroid.content.Context);
- }
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export module formats {
- export abstract class NativeAd {
- public static class: java.lang.Class;
- public static ASSET_ADCHOICES_CONTAINER_VIEW: string;
- public constructor();
- /** @deprecated */
- public recordImpression(param0: globalAndroid.os.Bundle): boolean;
- /** @deprecated */
- public performClick(param0: globalAndroid.os.Bundle): void;
- /** @deprecated */
- public reportTouchEvent(param0: globalAndroid.os.Bundle): void;
- }
- export module NativeAd {
- export abstract class AdChoicesInfo {
- public static class: java.lang.Class;
- public getImages(): java.util.List;
- public getText(): string;
- public constructor();
- }
- export abstract class Image {
- public static class: java.lang.Class;
- public getDrawable(): globalAndroid.graphics.drawable.Drawable;
- public getScale(): number;
- public constructor();
- public getUri(): globalAndroid.net.Uri;
- }
- }
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export module formats {
- export class NativeAdOptions {
- public static class: java.lang.Class;
- public static ORIENTATION_ANY: number;
- public static ORIENTATION_PORTRAIT: number;
- public static ORIENTATION_LANDSCAPE: number;
- public static NATIVE_MEDIA_ASPECT_RATIO_UNKNOWN: number;
- public static NATIVE_MEDIA_ASPECT_RATIO_ANY: number;
- public static NATIVE_MEDIA_ASPECT_RATIO_LANDSCAPE: number;
- public static NATIVE_MEDIA_ASPECT_RATIO_PORTRAIT: number;
- public static NATIVE_MEDIA_ASPECT_RATIO_SQUARE: number;
- public static ADCHOICES_TOP_LEFT: number;
- public static ADCHOICES_TOP_RIGHT: number;
- public static ADCHOICES_BOTTOM_RIGHT: number;
- public static ADCHOICES_BOTTOM_LEFT: number;
- public getAdChoicesPlacement(): number;
- public shouldReturnUrlsForImageAssets(): boolean;
- public shouldRequestMultipleImages(): boolean;
- public getMediaAspectRatio(): number;
- /** @deprecated */
- public getImageOrientation(): number;
- public getVideoOptions(): com.google.android.gms.ads.VideoOptions;
- }
- export module NativeAdOptions {
- export class AdChoicesPlacement {
- public static class: java.lang.Class;
- /**
- * Constructs a new instance of the com.google.android.gms.ads.formats.NativeAdOptions$AdChoicesPlacement interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
- */
- public constructor(implementation: {});
- public constructor();
- }
- export class Builder {
- public static class: java.lang.Class;
- public setMediaAspectRatio(param0: number): com.google.android.gms.ads.formats.NativeAdOptions.Builder;
- public setAdChoicesPlacement(param0: number): com.google.android.gms.ads.formats.NativeAdOptions.Builder;
- /** @deprecated */
- public setImageOrientation(param0: number): com.google.android.gms.ads.formats.NativeAdOptions.Builder;
- public setReturnUrlsForImageAssets(param0: boolean): com.google.android.gms.ads.formats.NativeAdOptions.Builder;
- public build(): com.google.android.gms.ads.formats.NativeAdOptions;
- public setRequestMultipleImages(param0: boolean): com.google.android.gms.ads.formats.NativeAdOptions.Builder;
- public setRequestCustomMuteThisAd(param0: boolean): com.google.android.gms.ads.formats.NativeAdOptions.Builder;
- public setVideoOptions(param0: com.google.android.gms.ads.VideoOptions): com.google.android.gms.ads.formats.NativeAdOptions.Builder;
- public constructor();
- }
- export class NativeMediaAspectRatio {
- public static class: java.lang.Class;
- /**
- * Constructs a new instance of the com.google.android.gms.ads.formats.NativeAdOptions$NativeMediaAspectRatio interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
- */
- public constructor(implementation: {});
- public constructor();
- }
- }
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export module formats {
- export class NativeCustomTemplateAd {
- public static class: java.lang.Class;
- /**
- * Constructs a new instance of the com.google.android.gms.ads.formats.NativeCustomTemplateAd interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
- */
- public constructor(implementation: { getText(param0: string): string; getImage(param0: string): com.google.android.gms.ads.formats.NativeAd.Image; getVideoController(): com.google.android.gms.ads.VideoController; getVideoMediaView(): com.google.android.gms.ads.formats.MediaView; getAvailableAssetNames(): java.util.List; getCustomTemplateId(): string; performClick(param0: string): void; recordImpression(): void; getDisplayOpenMeasurement(): com.google.android.gms.ads.formats.NativeCustomTemplateAd.DisplayOpenMeasurement; destroy(): void });
- public constructor();
- public static ASSET_NAME_VIDEO: string;
- public getCustomTemplateId(): string;
- public getVideoController(): com.google.android.gms.ads.VideoController;
- public getVideoMediaView(): com.google.android.gms.ads.formats.MediaView;
- public destroy(): void;
- public getAvailableAssetNames(): java.util.List;
- public getDisplayOpenMeasurement(): com.google.android.gms.ads.formats.NativeCustomTemplateAd.DisplayOpenMeasurement;
- public getImage(param0: string): com.google.android.gms.ads.formats.NativeAd.Image;
- public performClick(param0: string): void;
- public recordImpression(): void;
- public getText(param0: string): string;
- }
- export module NativeCustomTemplateAd {
- export class DisplayOpenMeasurement {
- public static class: java.lang.Class;
- /**
- * Constructs a new instance of the com.google.android.gms.ads.formats.NativeCustomTemplateAd$DisplayOpenMeasurement interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
- */
- public constructor(implementation: { start(): boolean; setView(param0: globalAndroid.view.View): void });
- public constructor();
- public start(): boolean;
- public setView(param0: globalAndroid.view.View): void;
- }
- export class OnCustomClickListener {
- public static class: java.lang.Class;
- /**
- * Constructs a new instance of the com.google.android.gms.ads.formats.NativeCustomTemplateAd$OnCustomClickListener interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
- */
- public constructor(implementation: { onCustomClick(param0: com.google.android.gms.ads.formats.NativeCustomTemplateAd, param1: string): void });
- public constructor();
- public onCustomClick(param0: com.google.android.gms.ads.formats.NativeCustomTemplateAd, param1: string): void;
- }
- export class OnCustomTemplateAdLoadedListener {
- public static class: java.lang.Class;
- /**
- * Constructs a new instance of the com.google.android.gms.ads.formats.NativeCustomTemplateAd$OnCustomTemplateAdLoadedListener interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
- */
- public constructor(implementation: { onCustomTemplateAdLoaded(param0: com.google.android.gms.ads.formats.NativeCustomTemplateAd): void });
- public constructor();
- public onCustomTemplateAdLoaded(param0: com.google.android.gms.ads.formats.NativeCustomTemplateAd): void;
- }
- }
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export module formats {
- export class OnAdManagerAdViewLoadedListener {
- public static class: java.lang.Class;
- /**
- * Constructs a new instance of the com.google.android.gms.ads.formats.OnAdManagerAdViewLoadedListener interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
- */
- public constructor(implementation: { onAdManagerAdViewLoaded(param0: com.google.android.gms.ads.admanager.AdManagerAdView): void });
- public constructor();
- public onAdManagerAdViewLoaded(param0: com.google.android.gms.ads.admanager.AdManagerAdView): void;
- }
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export module formats {
- export class PublisherAdViewOptions {
- public static class: java.lang.Class;
- public static CREATOR: globalAndroid.os.Parcelable.Creator;
- public writeToParcel(param0: globalAndroid.os.Parcel, param1: number): void;
- }
- export module PublisherAdViewOptions {
- export class Builder {
- public static class: java.lang.Class;
- public setShouldDelayBannerRenderingListener(param0: com.google.android.gms.ads.formats.ShouldDelayBannerRenderingListener): com.google.android.gms.ads.formats.PublisherAdViewOptions.Builder;
- public constructor();
- }
- }
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export module formats {
- export class ShouldDelayBannerRenderingListener {
- public static class: java.lang.Class;
- /**
- * Constructs a new instance of the com.google.android.gms.ads.formats.ShouldDelayBannerRenderingListener interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
- */
- public constructor(implementation: { shouldDelayBannerRendering(param0: java.lang.Runnable): boolean });
- public constructor();
- public shouldDelayBannerRendering(param0: java.lang.Runnable): boolean;
- }
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export module formats {
- export abstract class UnifiedNativeAd {
- public static class: java.lang.Class;
- public getHeadline(): string;
- public performClick(param0: globalAndroid.os.Bundle): void;
- public reportTouchEvent(param0: globalAndroid.os.Bundle): void;
- public getPrice(): string;
- public isCustomClickGestureEnabled(): boolean;
- public getExtras(): globalAndroid.os.Bundle;
- public getAdChoicesInfo(): com.google.android.gms.ads.formats.NativeAd.AdChoicesInfo;
- public destroy(): void;
- public recordCustomClickGesture(): void;
- public getResponseInfo(): com.google.android.gms.ads.ResponseInfo;
- /** @deprecated */
- public getVideoController(): com.google.android.gms.ads.VideoController;
- public getImages(): java.util.List;
- public getBody(): string;
- public getIcon(): com.google.android.gms.ads.formats.NativeAd.Image;
- public constructor();
- /** @deprecated */
- public getMediationAdapterClassName(): string;
- public enableCustomClickGesture(): void;
- public setMuteThisAdListener(param0: com.google.android.gms.ads.MuteThisAdListener): void;
- public getAdvertiser(): string;
- public recordImpression(param0: globalAndroid.os.Bundle): boolean;
- public cancelUnconfirmedClick(): void;
- public setOnPaidEventListener(param0: com.google.android.gms.ads.OnPaidEventListener): void;
- public getMediaContent(): com.google.android.gms.ads.MediaContent;
- public setUnconfirmedClickListener(param0: com.google.android.gms.ads.formats.UnifiedNativeAd.UnconfirmedClickListener): void;
- public getCallToAction(): string;
- public isCustomMuteThisAdEnabled(): boolean;
- public muteThisAd(param0: com.google.android.gms.ads.MuteThisAdReason): void;
- public getStarRating(): java.lang.Double;
- public getStore(): string;
- public getMuteThisAdReasons(): java.util.List;
- }
- export module UnifiedNativeAd {
- export class OnUnifiedNativeAdLoadedListener {
- public static class: java.lang.Class;
- /**
- * Constructs a new instance of the com.google.android.gms.ads.formats.UnifiedNativeAd$OnUnifiedNativeAdLoadedListener interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
- */
- public constructor(implementation: { onUnifiedNativeAdLoaded(param0: com.google.android.gms.ads.formats.UnifiedNativeAd): void });
- public constructor();
- public onUnifiedNativeAdLoaded(param0: com.google.android.gms.ads.formats.UnifiedNativeAd): void;
- }
- export class UnconfirmedClickListener {
- public static class: java.lang.Class;
- /**
- * Constructs a new instance of the com.google.android.gms.ads.formats.UnifiedNativeAd$UnconfirmedClickListener interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
- */
- public constructor(implementation: { onUnconfirmedClickReceived(param0: string): void; onUnconfirmedClickCancelled(): void });
- public constructor();
- public onUnconfirmedClickReceived(param0: string): void;
- public onUnconfirmedClickCancelled(): void;
- }
- }
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export module formats {
- export class UnifiedNativeAdAssetNames {
- public static class: java.lang.Class;
- public static ASSET_HEADLINE: string;
- public static ASSET_CALL_TO_ACTION: string;
- public static ASSET_ICON: string;
- public static ASSET_BODY: string;
- public static ASSET_ADVERTISER: string;
- public static ASSET_STORE: string;
- public static ASSET_PRICE: string;
- public static ASSET_IMAGE: string;
- public static ASSET_STAR_RATING: string;
- public static ASSET_MEDIA_VIDEO: string;
- public static ASSET_ADCHOICES_CONTAINER_VIEW: string;
- public constructor();
- }
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export module formats {
- export class zza {
- public static class: java.lang.Class;
- public constructor(param0: globalAndroid.content.Context);
- }
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export module formats {
- export class zzb {
- public static class: java.lang.Class;
- }
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export module formats {
- export class zzc extends globalAndroid.os.Parcelable.Creator {
- public static class: java.lang.Class;
- public constructor();
- }
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export module formats {
- export class zzd {
- public static class: java.lang.Class;
- }
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export module formats {
- export class zze {
- public static class: java.lang.Class;
- }
- }
- }
- }
- }
- }
-}
-
-declare module com {
- export module google {
- export module android {
- export module gms {
- export module ads {
- export module formats {
- export class zzf extends globalAndroid.os.Parcelable.Creator