Giter Site home page Giter Site logo

eddyverbruggen / nativescript-admob Goto Github PK

View Code? Open in Web Editor NEW
68.0 9.0 26.0 2.46 MB

NativeScript plugin to earn some precious :moneybag::moneybag: with ads by Google AdMob

License: MIT License

JavaScript 99.86% Ruby 0.14%
nativescript nativescript-plugin admob advertisement banner

nativescript-admob's Introduction

NativeScript AdMob plugin

NPM version Downloads Twitter Follow

Installation

From the command prompt go to your app's root folder and execute:

tns plugin add nativescript-admob

iOS

⚠️ ⚠️ ⚠️ Important! Since version 4.0.0 it's required you to do this - or your app will crash on start-up! ⚠️

Open your App_Resources/iOS/Info.plist file and add this (replace the value by the actual App ID of your app!):

  <key>GADApplicationIdentifier</key>
  <string>ca-app-pub-9517346003011652~2508636525</string>

Also, run pod repo update from a Terminal, otherwise the required Pod version may not be available on your system.

Android

⚠️ ⚠️ ⚠️ Important! Plugin version 3.0.0+ requires you to do this - or your app will crash on start-up! ⚠️

Open your App_Resources/Android/AndroidManifest.xml file and add this meta-data line at the right spot (and replace the value by the actual App ID of your app!):

<application>
  <!-- this line needs to be added (replace the value!) -->
  <meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="ca-app-pub-3940256099942544~3347511713" />

  <activity></activity>
</application>

BANNER

If you want a quickstart, clone our demo app.

Here are the supported functions:

createBanner

TypeScript

import { AD_SIZE, createBanner, hideBanner } from "nativescript-admob";
import { isIOS } from "tns-core-modules/platform";

const testing = true;
createBanner({
  // if this 'view' property is not set, the banner is overlayed on the current top most view
  // view: ..,
  size: AD_SIZE.SMART_BANNER,
  iosBannerId: "ca-app-pub-9517346003011652/3985369721",
  androidBannerId: testing
      ? "ca-app-pub-3940256099942544/6300978111"  // global test banner id
      : "ca-app-pub-9517346003011652/7749101329", // our registered banner id
  // Android automatically adds the connected device as test device with testing:true, iOS does not
  // iosTestDeviceIds: ["yourTestDeviceUDIDs", "canBeAddedHere"],
  margins: {
    // if both are set, top wins
    // top: 10
    bottom: isIOS ? 50 : 0
  },
  keywords: ["foo", "bar"]
}).then(
    () => this.message = "Banner created",
    error => this.message = "Error creating banner: " + error
)

JavaScript

var admob = require("nativescript-admob");

admob.createBanner({
    // if this 'view' property is not set, the banner is overlayed on the current top most view
    // view: ..,
    testing: true, // set to false to get real banners
    size: size, // anything in admob.AD_SIZE, like admob.AD_SIZE.SMART_BANNER
    iosBannerId: "ca-app-pub-XXXXXX/YYYYYY", // add your own
    androidBannerId: "ca-app-pub-AAAAAAAA/BBBBBBB", // add your own
    // Android automatically adds the connected device as test device with testing:true, iOS does not
    iosTestDeviceIds: ["yourTestDeviceUDIDs", "canBeAddedHere"],
    margins: {
      // if both are set, top wins
      //top: 10
      bottom: 50
    },
    keywords: ["keyword1", "keyword2"] // add keywords for ad targeting
  }).then(
      function() {
        console.log("admob createBanner done");
      },
      function(error) {
        console.log("admob createBanner error: " + error);
      }
)

Note that you can trigger the function above at any moment, and since version 1.1.4 of this plugin you can even call it from the Page.loaded event.

hideBanner

NOTE: If you want to show a different banner than the one showing you don't need to call hideBanner since createBanner will do that for you to prevent your app from crashing.

// the .then(.. bit is optional btw
admob.hideBanner().then(
      function() {
        console.log("admob hideBanner done");
      },
      function(error) {
        console.log("admob hideBanner error: " + error);
      }
)

INTERSTITIAL

To show a fullscreen ad, you can use this function. Note that Interstitial banners need to be loaded before they can be shown, and there are two ways to do that:

  • Use createInterstitial and have the plugin automatically preload the ad and show it when loaded. This is not recommended because there's a delay the user may notice.
  • (Since plugin version 2.0.0) Use preloadInterstitial, and (at any time after its Promise resolves) showInterstitial. This will hide the preloading delay for your users. Note that the parameters of createInterstitial and preloadInterstitial are exactly the same so migration should be easy.

If you want to get notified when an interstitial is closed, provide an onAdClosed callback as shown below.

createInterstitial

Again, not recommended.

admob.createInterstitial({
    testing: true,
    iosInterstitialId: "ca-app-pub-XXXXXX/YYYYY2", // add your own
    androidInterstitialId: "ca-app-pub-AAAAAAAA/BBBBBB2", // add your own
    // Android automatically adds the connected device as test device with testing:true, iOS does not
    iosTestDeviceIds: ["ce97330130c9047ce0d4430d37d713b2"],
    keywords: ["keyword1", "keyword2"], // add keywords for ad targeting
    onAdClosed: function () { console.log("interstitial closed") }
  }).then(
      function() {
        console.log("admob createInterstitial done");
      },
      function(error) {
        console.log("admob createInterstitial error: " + error);
      }
)

preloadInterstitial

Use this for instance while loading your view, so it's ready for the moment you want to actually show it (by calling showInterstitial).

Note that the parameters are identical to createInterstitial.

admob.preloadInterstitial({
    testing: true,
    iosInterstitialId: "ca-app-pub-XXXXXX/YYYYY2", // add your own
    androidInterstitialId: "ca-app-pub-AAAAAAAA/BBBBBB2", // add your own
    // Android automatically adds the connected device as test device with testing:true, iOS does not
    iosTestDeviceIds: ["ce97330130c9047ce0d4430d37d713b2"],
    keywords: ["keyword1", "keyword2"], // add keywords for ad targeting
    onAdClosed: function () { console.log("interstitial closed") }
  }).then(
      function() {
        console.log("interstitial preloaded - you can now call 'showInterstitial' whenever you're ready to do so");
      },
      function(error) {
        console.log("admob preloadInterstitial error: " + error);
      }
)

showInterstitial

At any moment after preloadInterstitial successfully resolves, you can call showInterstitial.

Note that when you want to use showInterstitial again, you also have to use preloadInterstitial again because those ads can't be reused.

admob.showInterstitial().then(
      function() {
        // this will resolve almost immediately, and the interstitial is shown without a delay because it was already loaded
        console.log("interstitial showing");
      },
      function(error) {
        console.log("admob showInterstitial error: " + error);
      }
)

preloadRewardedVideoAd

Use this for instance while loading your view, so it's ready for the moment you want to actually show it (by calling showRewardedVideoAd).

admob.preloadRewardedVideoAd({
    testing: true,
    iosAdPlacementId: "ca-app-pub-XXXXXX/YYYYY2", // add your own
    androidAdPlacementId: "ca-app-pub-AAAAAAAA/BBBBBB2", // add your own
    keywords: ["keyword1", "keyword2"], // add keywords for ad targeting
  }).then(
      function() {
        console.log("RewardedVideoAd preloaded - you can now call 'showRewardedVideoAd' whenever you're ready to do so");
      },
      function(error) {
        console.log("admob preloadRewardedVideoAd error: " + error);
      }
)

showRewardedVideoAd

At any moment after preloadRewardedVideoAd successfully resolves, you can call showRewardedVideoAd.

Note that when you want to use showRewardedVideoAd again, you also have to use preloadRewardedVideoAd again because those ads can't be reused.

onRewarded is probably the only callback you need to worry about.

admob.showRewardedVideoAd({
  onRewarded: (reward) => {
    console.log("onRewarded");
    this.message = "watched rewarded video";
  },
  onRewardedVideoAdLeftApplication: () => console.log("onRewardedVideoAdLeftApplication"),
  onRewardedVideoAdClosed: () => console.log("onRewardedVideoAdClosed"),
  onRewardedVideoAdOpened: () => console.log("onRewardedVideoAdOpened"),
  onRewardedVideoStarted: () => console.log("onRewardedVideoStarted"),
  onRewardedVideoCompleted: () => console.log("onRewardedVideoCompleted"),
}).then(
      function() {
        console.log("RewardedVideoAd showing");
      },
      function(error) {
        console.log("admob showRewardedVideoAd error: " + error);
      }
)

Tutorials

Need a little more help getting started? Check out these tutorials for using Admob in a NativeScript Android and iOS application.

nativescript-admob's People

Contributors

andreacimino avatar eddyverbruggen avatar fatme avatar mdconaway avatar nicholassmilovic avatar nraboy avatar pauly815 avatar rmn81 avatar royinamir avatar sis0k0 avatar skopekreep avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nativescript-admob's Issues

Urgent: Build Failed (Nativescript + Angular)

I added this plugin to my project and it immediately stopped building for iOS. I was following Nic Raboy's tutorial for adding nativescript-admob to a Nativescript + Angular project:

The following build commands failed:
Ld /Users/Me/Library/Developer/Xcode/DerivedData/MyProject-fsdfsdfsdfsdf/Build/Intermediates/MyProject.build/Debug-iphonesimulator/MyProject.build/Objects-normal/x86_64/MyProject normal x86_64
(1 failure)
Unable to sync files. Error is: Command xcodebuild failed with exit code 65

I tried removing it with tns plugin remove nativescript-admob and it says:
"Successfully removed plugin nativescript-admob for ios."

...but it still won't build and I get the same error even after removing the plugin.

I created a fresh tns create ProjectName --ng (which worked fine initially) and I added admob to it again with "tns plugin add nativescript-admob" and the error returned and would not go away after removing the plugin just like before.

UPDATE:
The plugin still prevents the project from building, but deleting the ios platform and removing the plugin before building again with "tns run ios" allows the project to build again as normal (without admob). I added the plugin again and the build failed like before.

Conflict while using this plugin with google analytics plugin

Hi,

I've been trying to use this plugin however, my app doesn't build for android.
This is the stacktrace:
:buildMetadata
Exception in thread "main" java.lang.IllegalArgumentException: Class com.google.android.gms.internal.zzk$zza conflict: /Users/path/to/platforms/android/build/intermediates/exploded-aar/com.google.android.gms/play-services-basement/9.0.2/jars/classes.jar and /Users/path/to/platforms/android/build/intermediates/exploded-aar/com.google.android.gms/play-services-ads/7.5.0/jars/classes.jar
at com.telerik.metadata.ClassRepo.cacheJarFile(ClassRepo.java:21)
at com.telerik.metadata.Builder.build(Builder.java:39)
at com.telerik.metadata.Generator.main(Generator.java:44)
:buildMetadata FAILED

FAILURE: Build failed with an exception.

This is the other plugin: https://www.npmjs.com/package/nativescript-google-analytics

Any idea is welcome! Thanks.

View property of the CreateBanner method

Using Angular 2 along with Nativescript. But I am not sure as to what is to be passed in the view property of the admob.createBanner() method

 admob.createBanner({
          testing: true,
          view:  //What goes here??
          iosTestDeviceIds: ["yourTestDeviceUDIDs", "canBeAddedHere"],
          size: admob.AD_SIZE.SMART_BANNER,
          iosBannerId: "ca-app-pub-XXXXXX/YYYYYY", // add your own
          androidBannerId: "ca-app-pub-AAAAAAAA/BBBBBBB", // add your own
 
       margins: {
        // if both are set, top wins
        top: 100,
        //bottom:0
      }
    })

Also is it possible to show banner ads in stakLayout for example in a stacklayout have tabView I want to show banner ads between tabs and list items?

Interstitial ad not showing

@EddyVerbruggen sir i have added admob plugin.
create banner is working fine. but interstitial ad not showing. i have checked ad units properly. no mistake in ad units. please guide where i did a mistake.

my package:

{
  "nativescript": {
    "id": "org.nativescript.adstest",
    "tns-ios": {
      "version": "5.2.0"
    },
    "tns-android": {
      "version": "5.2.1"
    }
  },
  "description": "NativeScript Application",
  "license": "SEE LICENSE IN ",
  "repository": "",
  "dependencies": {
    "@angular/animations": "~7.2.0",
    "@angular/common": "~7.2.0",
    "@angular/compiler": "~7.2.0",
    "@angular/core": "~7.2.0",
    "@angular/forms": "~7.2.0",
    "@angular/http": "~7.2.0",
    "@angular/platform-browser": "~7.2.0",
    "@angular/platform-browser-dynamic": "~7.2.0",
    "@angular/router": "~7.2.0",
    "nativescript-admob": "^3.3.2",
    "nativescript-angular": "~7.2.1",
    "nativescript-theme-core": "~1.0.4",
    "reflect-metadata": "~0.1.12",
    "rxjs": "~6.3.0",
    "tns-core-modules": "~5.2.0",
    "zone.js": "~0.8.26"
  },
  "devDependencies": {
    "@angular/compiler-cli": "~7.2.0",
    "@nativescript/schematics": "~0.5.0",
    "@ngtools/webpack": "~7.2.0",
    "nativescript-dev-typescript": "~0.8.0",
    "nativescript-dev-webpack": "~0.20.0"
  },
  "gitHead": "f548ec926e75201ab1b7c4a3a7ceefe7a4db15af",
  "readme": "NativeScript Application"
}

**test.component.ts **

import { createBanner,showInterstitial, preloadInterstitial  } from "nativescript-admob";
----other stuff----
-----
private androidBannerId: string = "ca-app-pub-xxx";
private androidInterstitialId: string = "ca-app-pub-xxxx";
private androidVideoRewardId: string = "ca-app-pub-xxxxx";

createbanner_method(){
        createBanner({
                              // if this 'view' property is not set, the banner is overlayed on the current top most view
                              // view: ..,
                              testing: false, // set to false to get real banners
                              size: admob.AD_SIZE.SMART_BANNER, // anything in admob.AD_SIZE, like admob.AD_SIZE.SMART_BANNER
                              iosBannerId: "ca-app-pub-XXXXXX/YYYYYY", // add your own
                              androidBannerId: this.androidBannerId, // add your own
                              // Android automatically adds the connected device as test device with testing:true, iOS does not
                              iosTestDeviceIds: ["yourTestDeviceUDIDs", "canBeAddedHere"],
                              margins: {
                                // if both are set, top wins
                                //top: 10
                                bottom: 0
                              },
                              keywords: []  // add keywords for ad targeting
                            }).then(
                                function() {
                                  console.log("admob createBanner done");                              
                                },
                                function(error) {
                                  console.log("admob createBanner error: " + error);
                             }
                       )
      }  
      preloadInter_method(){
              preloadInterstitial({
                testing: false,
                iosInterstitialId: "ca-app-pub-XXXXXX/YYYYY2", // add your own
                androidInterstitialId: this.androidInterstitialId, // add your own
                // Android automatically adds the connected device as test device with testing:true, iOS does not
                iosTestDeviceIds: ["ce97330130c9047ce0d4430d37d713b2"],
                keywords: [], // add keywords for ad targeting
                onAdClosed: function () { console.log("interstitial closed") }
              }).then(
                  function() {
                    console.log("interstitial preloaded - you can now call 'showInterstitial' whenever you're ready to do so");
                  },
                  function(error) {
                    console.log("admob preloadInterstitial error: " + error);
                  }
            )
      }
      showInter_method(){
        showInterstitial().then( 
          function() {
            // this will resolve almost immediately, and the interstitial is shown without a delay because it was already loaded
            console.log("interstitial showing");          
            
          },
          function(error) {
            console.log("admob showInterstitial error: " + error);        
          }
    )
      }

test.component.html:

 <StackLayout >
             <Button text="create banner" (tap)="createbanner_method()"></Button>    
             <Button text="load inter" (tap)="preloadInter_method()"></Button>
             <Button text="show inter" (tap)="showInter_method()"></Button>   
   </StackLayout>

Output i am getting:

admob createBanner done  // banner ad showing

onAdFailedToLoad: 3
admob preloadInterstitial error: 3

Please help i really stuck. thanks in advance

app stop and crash on navigation

Using NativeScript 1.5.2, if I navigate to another view, it stops and crash, closing the app.
Where I call the Admob:

exports.pageLoaded = function(args) {
    page = args.object;
    setTimeout(function() {
        config.loadBanner();
    }, 1000);
}

On config file:

var admob = require("nativescript-admob");

exports.loadInterstitialAd = function() {
    admob.createInterstitial({
        testing: false,
        androidInterstitialId: "xxxxxx"
    });
}
exports.loadBanner = function() { 
    admob.createBanner({
        testing: false,
        size: admob.AD_SIZE.BANNER,
        androidBannerId: "xxxxx",
        margins: {
            bottom: 0
        }
    });
}

The log:

Successfully deployed on device with identifier '192.168.57.101:5555'.
chromium: [INFO:library_loader_hooks.cc(116)] Chromium logging enabled: level = 0, default verbosity = 0
I/BrowserStartupController( 2412): Initializing chromium process, renderers=0
chromium: [WARNING:mailbox_synchronizer.cc(36)] MailboxSync not supported due to missing EGL image/fence support
chromium: [WARNING:proxy_service.cc(890)] PAC support disabled because there is no system implementation
chromium: [WARNING:simple_index_file.cc(338)] Could not map Simple Index file.
chromium: [INFO:simple_index_file.cc(437)] Simple Cache Index is being restored from disk.
chromium: [INFO:CONSOLE(0)] "Creating Application Cache with manifest https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.appcache", source: https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.html (0)
chromium: [INFO:CONSOLE(0)] "Application Cache Checking event", source: https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.html (0)
chromium: [WARNING:simple_index_file.cc(338)] Could not map Simple Index file.
chromium: [INFO:simple_index_file.cc(437)] Simple Cache Index is being restored from disk.
chromium: [INFO:CONSOLE(0)] "Application Cache Downloading event", source: https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.html (0)
chromium: [INFO:CONSOLE(0)] "Application Cache Progress event (0 of 2) https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.js", source: https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.html (0)
chromium: [INFO:CONSOLE(0)] "Application Cache Progress event (1 of 2) https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/native_ads.js", source: https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.html (0)
chromium: [INFO:CONSOLE(0)] "Application Cache Progress event (2 of 2) ", source: https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.html (0)
chromium: [INFO:CONSOLE(0)] "Application Cache Cached event", source: https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.html (0)
chromium: [INFO:async_pixel_transfer_manager_android.cc(60)] Async pixel transfers not supported
chromium: [ERROR:gles2_cmd_decoder_autogen.h(1082)] [GroupMarkerNotSet(crbug.com/242999)!:C079E4B9]GL ERROR :GL_INVALID_OPERATION : GetIntegerv: <- error from previous GL command
chromium: [INFO:async_pixel_transfer_manager_android.cc(60)] Async pixel transfers not supported
chromium: [ERROR:gles2_cmd_decoder_autogen.h(1082)] [GroupMarkerNotSet(crbug.com/242999)!:C0D9DCB9]GL ERROR :GL_INVALID_OPERATION : GetIntegerv: <- error from previous GL command
chromium: [INFO:CONSOLE(0)] "Document was loaded from Application Cache with manifest https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.appcache", source: https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.html (0)
chromium: [INFO:CONSOLE(0)] "Application Cache Checking event", source: https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.html (0)
chromium: [INFO:CONSOLE(0)] "Application Cache NoUpdate event", source: https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.html (0)
chromium: [INFO:CONSOLE(0)] "Document was loaded from Application Cache with manifest https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.appcache", source: https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.html (0)
chromium: [INFO:CONSOLE(0)] "Application Cache Checking event", source: https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.html (0)
chromium: [INFO:CONSOLE(0)] "Application Cache Checking event", source: https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.html (0)
chromium: [INFO:CONSOLE(0)] "Application Cache NoUpdate event", source: https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.html (0)
chromium: [INFO:CONSOLE(0)] "Application Cache NoUpdate event", source: https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.html (0)
chromium: [INFO:async_pixel_transfer_manager_android.cc(60)] Async pixel transfers not supported
chromium: [ERROR:gles2_cmd_decoder_autogen.h(1082)] [GroupMarkerNotSet(crbug.com/242999)!:D0B10CBA]GL ERROR :GL_INVALID_OPERATION : GetIntegerv: <- error from previous GL command
chromium: [INFO:CONSOLE(0)] "Document was loaded from Application Cache with manifest https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.appcache", source: https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.html (0)
chromium: [INFO:CONSOLE(0)] "Application Cache Checking event", source: https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.html (0)
chromium: [INFO:CONSOLE(0)] "Application Cache Checking event", source: https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.html (0)
chromium: [INFO:CONSOLE(0)] "Application Cache NoUpdate event", source: https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.html (0)
chromium: [INFO:CONSOLE(0)] "Application Cache NoUpdate event", source: https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.html (0)
chromium: [INFO:async_pixel_transfer_manager_android.cc(60)] Async pixel transfers not supported
chromium: [ERROR:gles2_cmd_decoder_autogen.h(1082)] [GroupMarkerNotSet(crbug.com/242999)!:A8BD10BA]GL ERROR :GL_INVALID_OPERATION : GetIntegerv: <- error from previous GL command
I/DEBUG   (  135):     #02  pc 00233fd8  /data/app-lib/com.kmilla.passatempo-1/libNativeScript.so (tns::NativePlatform::CallJSMethodNative(_JNIEnv*, _jobject*, int, _jstring*, int, unsigned char, _jobjectArray*)+536)
I/DEBUG   (  135):          bfd60168  94915fd9  /data/app-lib/com.kmilla.passatempo-1/libNativeScript.so (tns::NativePlatform::CallJSMethodNative(_JNIEnv*, _jobject*, int, _jstring*, int, unsigned char, _jobjectArray*)+537)

onAdClosed callback occasionally not called

Thanks for this great plugin. Here is an issue I've encountered:

Platform

[x] iOS

[?: Not tested] Android

Expected behavior

onAdClosed should fire each time an interstitial ad is closed.

Actual behavior

I am experiencing a situation where onAdClosed is not firing when closing an interstitial ad. The miss-fire occurs seemingly randomly, and the exact occurrence within a repeated series of preloading then showing interstitial ads is not able to be reproduced, but if repeated long enough it will eventually occur reliably.

The ad is preloaded as instructed in the README, and shown after it has correctly loaded, also as documented.

The bug has been reproduced:

  • both an iOS simulator (iPhone 6) and a physical device (iPhone 6S+), both running iOS 11
  • both in the demo app and another app that I'm building

Additional notes

The delightful output shown a couple sections below is from the demo app, undergoing the sequence described here, following app launch.

First Cycle:

  • "preload interstitial" button clicked. Wait for the "Interstitial Preloaded" message to show.
  • "show interstitial" button clicked.
  • Watch the ad, then click the "x" symbol to close it.
  • Observe the "onAdClosed called" message (I changed the text of that message to be easier to search in the logs)

Second Cycle:

  • "preload interstitial" button clicked. Wait for the "Interstitial Preloaded" message to show.
  • "show interstitial" button clicked.
  • Watch the ad, then click the "x" symbol to close it.
  • "onAdClosed called" message never displays, instead the (usually hidden) "Interstitial Showing" message remains showing.

Note that the next interstitial can still then be preloaded as expected, and the interstitial can again be shown. onAdClosed then may, or may not fire - I have observed both.

Screenshots showing the failed state for both emulator and physical device

Note the "Interstitial Showing" message that is partially hidden. That always happens when this bug happens - perhaps it's a clue. All other app messages are not obscured.

Simulator_ScreenShot_iPhone6

iPhone6SPlus_Screenshot

Logs from physical device

Successfully synced application org.nativescript.admobdemo on device XXXXXXXX-XXXX-XXX-XXXXX-XXXXXXXXXXXX.
0x10285a618 - UIProcess is taking a foreground assertion because the view is visible
0x1078e7000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x1072d0f00, main = 1)
Memory usage info dump at MainFrameLoadCompleted:
document_count: 1
virtual_size: 1745027072
internal: 34439168
javascript_gc_heap_capacity: 65536
resident_size: 75513856
phys_footprint: 34620016
pagecache_page_count: 0
compressed: 0
javascript_gc_heap_extra_memory_size: 0
Memory usage info dump at MainFrameLoadStarted:
document_count: 1
virtual_size: 1748942848
internal: 35094528
javascript_gc_heap_capacity: 65536
resident_size: 78888960
phys_footprint: 35308184
pagecache_page_count: 0
compressed: 0
javascript_gc_heap_extra_memory_size: 0
0x15de0f6a0 - FrameLoader::prepareForLoadStart: Starting frame load (frame = 0x105804300, main = 1)
0x105c88000 - DocumentLoader::startLoadingMainResource: Starting load (frame = 0x105804300, main = 1)
Faulting in NSHTTPCookieStorage singleton
Faulting in CFHTTPCookieStorage singleton
Creating default cookie storage with default identifier
TIC Enabling TLS [1:0x1c017cf80]
TIC TCP Conn Start [1:0x1c017cf80]
Task .<0> setting up Connection 1
[1 ] start
TIC TLS Event [1:0x1c017cf80]: 1, Pending(0)
TIC TLS Event [1:0x1c017cf80]: 2, Pending(0)
TIC TLS Event [1:0x1c017cf80]: 11, Pending(0)
TIC TLS Event [1:0x1c017cf80]: 12, Pending(0)
TIC TLS Event [1:0x1c017cf80]: 14, Pending(0)
TIC TLS Trust Result [1:0x1c017cf80]: 0
TIC TLS Event [1:0x1c017cf80]: 20, Pending(0)
TIC TCP Conn Connected [1:0x1c017cf80]: Err(16)
TIC TCP Conn Event [1:0x1c017cf80]: 1
TIC TCP Conn Event [1:0x1c017cf80]: 8
TIC TLS Handshake Complete [1:0x1c017cf80]
Task .<0> now using Connection 1
Task .<0> sent request, body N
Task .<0> received response, status 200 content C
Task .<0> response ended
Task <5BEB8852-CD58-4FC0-88D1-4D1F8D1C8D70>.<0> now using Connection 1
Task <5BEB8852-CD58-4FC0-88D1-4D1F8D1C8D70>.<0> sent request, body N
Task <5BEB8852-CD58-4FC0-88D1-4D1F8D1C8D70>.<0> received response, status 200 content K
Task <5BEB8852-CD58-4FC0-88D1-4D1F8D1C8D70>.<0> response ended
Task .<0> now using Connection 1
Task .<0> sent request, body N
TIC Enabling TLS [2:0x1c417de80]
TIC TCP Conn Start [2:0x1c417de80]
Task .<0> setting up Connection 2
[2 ] start
Task .<0> received response, status 200 content K
TIC TLS Event [2:0x1c417de80]: 1, Pending(0)
Task .<0> response ended
TIC TLS Event [2:0x1c417de80]: 2, Pending(0)
TIC TLS Event [2:0x1c417de80]: 20, Pending(0)
TIC TCP Conn Connected [2:0x1c417de80]: Err(16)
TIC TCP Conn Event [2:0x1c417de80]: 1
TIC TCP Conn Event [2:0x1c417de80]: 8
TIC TLS Handshake Complete [2:0x1c417de80]
Task .<0> now using Connection 2
Task .<0> sent request, body N
Task .<0> received response, status 200 content K
Task .<0> response ended
Memory usage info dump at MainFrameLoadCompleted:
document_count: 2
virtual_size: 1792196608
internal: 46563328
javascript_gc_heap_capacity: 3371088
resident_size: 92454912
phys_footprint: 46531264
pagecache_page_count: 0
compressed: 0
javascript_gc_heap_extra_memory_size: 0
0x15de0f6a0 - FrameLoader::checkLoadCompleteForThisFrame: Finished frame load (frame = 0x105804300, main = 1)
0x10789b000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x105cddb00, main = 0)
0x107193000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x1058a7840, main = 0)
Task .<0> now using Connection 1
Task .<0> sent request, body N
0x107191000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10879a400, main = 0)
Task .<0> received response, status 200 content C
Task .<0> response ended
0x107190000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x108798000, main = 0)
0x108984000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10879b3c0, main = 0)
0x108986000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10874c6c0, main = 0)
TIC Enabling TLS [3:0x1c417e540]
TIC TCP Conn Start [3:0x1c417e540]
Task .<1> setting up Connection 3
[3 ] start
0x108985000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10874d200, main = 0)
TIC TLS Event [3:0x1c417e540]: 1, Pending(0)
0x108987000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10874db00, main = 0)
TIC TLS Event [3:0x1c417e540]: 2, Pending(0)
TIC TLS Event [3:0x1c417e540]: 11, Pending(0)
TIC TLS Event [3:0x1c417e540]: 12, Pending(0)
TIC TLS Event [3:0x1c417e540]: 14, Pending(0)
TIC TLS Trust Result [3:0x1c417e540]: 0
TIC TLS Event [3:0x1c417e540]: 20, Pending(0)
TIC TCP Conn Connected [3:0x1c417e540]: Err(16)
TIC TCP Conn Event [3:0x1c417e540]: 1
TIC TCP Conn Event [3:0x1c417e540]: 8
TIC TLS Handshake Complete [3:0x1c417e540]
Task .<1> now using Connection 3
Task .<1> sent request, body N
Task .<1> received response, status 200 content K
Task .<1> response ended
0x108968000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x108bd6880, main = 0)
0x10785f000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x105807000, main = 1)
Memory usage info dump at MainFrameLoadCompleted:
document_count: 12
virtual_size: 1813495808
internal: 54738944
javascript_gc_heap_capacity: 5271836
resident_size: 101171200
phys_footprint: 54706920
pagecache_page_count: 0
compressed: 0
javascript_gc_heap_extra_memory_size: 1068
Memory usage info dump at MainFrameLoadStarted:
document_count: 12
virtual_size: 1813626880
internal: 55066624
javascript_gc_heap_capacity: 5271836
resident_size: 101892096
phys_footprint: 55034600
pagecache_page_count: 0
compressed: 0
javascript_gc_heap_extra_memory_size: 1068
0x15dda1f80 - FrameLoader::prepareForLoadStart: Starting frame load (frame = 0x105807000, main = 1)
0x108bb1000 - DocumentLoader::startLoadingMainResource: Returning cached main resource (frame = 0x105807000, main = 1)
Task <4B7F2CB4-BA10-47E8-8A5E-E409E6130367>.<0> now using Connection 1
Task <4B7F2CB4-BA10-47E8-8A5E-E409E6130367>.<0> sent request, body N
TIC Enabling TLS [4:0x1c0367800]
TIC TCP Conn Start [4:0x1c0367800]
Task <819F2372-0F4C-433D-A825-B7E2C0BFEA01>.<0> setting up Connection 4
[4 ] start
Task <4B7F2CB4-BA10-47E8-8A5E-E409E6130367>.<0> received response, status 200 content K
Task <4B7F2CB4-BA10-47E8-8A5E-E409E6130367>.<0> response ended
0x10aacd000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10aaeb300, main = 1)
TIC TLS Event [4:0x1c0367800]: 1, Pending(0)
0x10b8e8000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10b8cfcc0, main = 0)
0x10b8ea000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10aae9800, main = 1)
0x10b8e9000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10b8ce1c0, main = 0)
0x10b87d000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10b8cd200, main = 0)
0x10b87f000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10b8cdf80, main = 0)
0x10b87e000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10b8cfa80, main = 0)
0x10b87c000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10b86c6c0, main = 0)
0x10b861000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10b86cfc0, main = 0)
0x10b863000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10b86d8c0, main = 0)
TIC TLS Event [4:0x1c0367800]: 2, Pending(0)
0x10b862000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10b86e1c0, main = 0)
0x10b860000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10b86eac0, main = 0)
0x10b84d000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10b86f3c0, main = 0)
0x10b84f000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10b86fcc0, main = 0)
TIC TLS Event [4:0x1c0367800]: 11, Pending(0)
TIC TLS Event [4:0x1c0367800]: 12, Pending(0)
TIC TLS Event [4:0x1c0367800]: 14, Pending(0)
TIC TLS Trust Result [4:0x1c0367800]: 0
0x10b84e000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10b86dd40, main = 0)
0x10b84c000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10b86ef40, main = 0)
0x10b815000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10b8206c0, main = 0)
TIC TLS Event [4:0x1c0367800]: 20, Pending(0)
TIC TCP Conn Connected [4:0x1c0367800]: Err(16)
TIC TCP Conn Event [4:0x1c0367800]: 1
TIC TCP Conn Event [4:0x1c0367800]: 8
TIC TLS Handshake Complete [4:0x1c0367800]
Task <819F2372-0F4C-433D-A825-B7E2C0BFEA01>.<0> now using Connection 4
Task <819F2372-0F4C-433D-A825-B7E2C0BFEA01>.<0> sent request, body N
0x10b817000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10b820fc0, main = 0)
0x10b816000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10b8218c0, main = 0)
0x10b814000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10b8221c0, main = 0)
Task <819F2372-0F4C-433D-A825-B7E2C0BFEA01>.<0> received response, status 200 content K
Task <819F2372-0F4C-433D-A825-B7E2C0BFEA01>.<0> response ended
0x10bcf1000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10b822d00, main = 0)
Memory usage info dump at MainFrameLoadCompleted:
document_count: 35
virtual_size: 1865187328
internal: 74596352
javascript_gc_heap_capacity: 11608096
resident_size: 123191296
phys_footprint: 74498832
pagecache_page_count: 0
compressed: 0
javascript_gc_heap_extra_memory_size: 33952
0x15dda1f80 - FrameLoader::checkLoadCompleteForThisFrame: Finished frame load (frame = 0x105807000, main = 1)
0x10bcf3000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10b821440, main = 0)
0x10bcf2000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10b823a80, main = 0)
0x10bcf0000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10b86cb40, main = 0)
0x10bc91000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10bc94240, main = 0)
0x10bc93000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10bc94fc0, main = 0)
0x10bc92000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10bc97cc0, main = 0)
0x10bc90000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10bc961c0, main = 0)
0x10bc39000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10bc96ac0, main = 0)
0x10bc31000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10bc95f80, main = 0)
TIC Enabling TLS [5:0x1c417fec0]
TIC TCP Conn Start [5:0x1c417fec0]
Task <4FDBC7DC-9F83-47F7-A576-926E1BF9F2D2>.<1> setting up Connection 5
[5 ] start
0x10bc33000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10bc97a80, main = 0)
0x10bc3d000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10bc20240, main = 0)
0x10bc3e000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10bc20b40, main = 0)
0x10bc3f000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10bc21440, main = 0)
TIC TLS Event [5:0x1c417fec0]: 1, Pending(0)
TIC TLS Event [5:0x1c417fec0]: 2, Pending(0)
TIC TLS Event [5:0x1c417fec0]: 11, Pending(0)
TIC TLS Event [5:0x1c417fec0]: 12, Pending(0)
TIC TLS Event [5:0x1c417fec0]: 14, Pending(0)
TIC TLS Trust Result [5:0x1c417fec0]: 0
TIC TLS Event [5:0x1c417fec0]: 20, Pending(0)
TIC TCP Conn Connected [5:0x1c417fec0]: Err(16)
TIC TCP Conn Event [5:0x1c417fec0]: 1
TIC TCP Conn Event [5:0x1c417fec0]: 8
TIC TLS Handshake Complete [5:0x1c417fec0]
Task <4FDBC7DC-9F83-47F7-A576-926E1BF9F2D2>.<1> now using Connection 5
Task <4FDBC7DC-9F83-47F7-A576-926E1BF9F2D2>.<1> sent request, body N
Task <4FDBC7DC-9F83-47F7-A576-926E1BF9F2D2>.<1> received response, status 303 content K
Task <4FDBC7DC-9F83-47F7-A576-926E1BF9F2D2>.<1> response ended
TIC Enabling TLS [6:0x1c0369540]
TIC TCP Conn Start [6:0x1c0369540]
Task <4FDBC7DC-9F83-47F7-A576-926E1BF9F2D2>.<1> setting up Connection 6
[6 ] start
TIC TLS Event [6:0x1c0369540]: 1, Pending(0)
TIC TLS Event [6:0x1c0369540]: 2, Pending(0)
TIC TLS Event [6:0x1c0369540]: 11, Pending(0)
TIC TLS Event [6:0x1c0369540]: 12, Pending(0)
TIC TLS Event [6:0x1c0369540]: 14, Pending(0)
TIC TLS Trust Result [6:0x1c0369540]: 0
TIC TLS Event [6:0x1c0369540]: 20, Pending(0)
TIC TCP Conn Connected [6:0x1c0369540]: Err(16)
TIC TCP Conn Event [6:0x1c0369540]: 1
TIC TCP Conn Event [6:0x1c0369540]: 8
TIC TLS Handshake Complete [6:0x1c0369540]
Task <4FDBC7DC-9F83-47F7-A576-926E1BF9F2D2>.<1> now using Connection 6
Task <4FDBC7DC-9F83-47F7-A576-926E1BF9F2D2>.<1> sent request, body N
Task <4FDBC7DC-9F83-47F7-A576-926E1BF9F2D2>.<1> received response, status 206 content K
0x10c1f0000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x105cdef40, main = 0)
0x10c1f1000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10bc21f80, main = 0)
0x10c1d5000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10bc22880, main = 0)
0x10c1d7000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10bc23180, main = 0)
TIC Enabling TLS [7:0x1c4364080]
TIC TCP Conn Start [7:0x1c4364080]
Task <776FB2C0-F06D-4E84-B929-D7CED9CC58DE>.<0> setting up Connection 7
[7 ] start
TIC TCP Conn Cancel [6:0x1c0369540]
Task <4FDBC7DC-9F83-47F7-A576-926E1BF9F2D2>.<1> response ended
[6 stream, pid: 2677, url: https://r3---sn-qxo7rn7e.googlevideo.com/videoplayback?id=9a85d42a0861d0f5&itag=22&source=youtube&requiressl=yes&mm=31&mn=sn-qxo7r, tls] cancelled
[6.1 17A82409-6D92-459D-A023-2A198692E58D .54653<->]
Connected Path: satisfied (Path is satisfied), interface: en0, ipv4, dns
Duration: 0.289s, DNS @0.000s took 0.013s, TCP @0.015s took 0.015s, TLS took 0.049s
bytes in/out: 1314946/1098, packets in/out: 950/3, rtt: 0.028s, retransmitted packets: 0, out-of-order packets: 0
TIC TCP Conn Destroyed [6:0x1c0369540]
TIC TCP Conn Cancel [5:0x1c417fec0]
[5 stream, pid: 2677, url: https://www.youtube.com/get_video?video_id=moXUKghh0PU&ts=1552243197&t=DdhP5LZEnQC3ygFxIczO3fnxStk&gad=1&br=1&itag=22,18, tls] cancelled
[5.1 5CDFB159-97E5-4C9E-8B28-2F90252722F8 .54652<->]
Connected Path: satisfied (Path is satisfied), interface: en0, ipv4, dns
Duration: 0.486s, DNS @0.000s took 0.010s, TCP @0.012s took 0.015s, TLS took 0.050s
bytes in/out: 4764/873, packets in/out: 9/10, rtt: 0.018s, retransmitted packets: 1, out-of-order packets: 0
0x10c1f2000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x105cdfcc0, main = 0)
TIC TCP Conn Destroyed [5:0x1c417fec0]
TIC Read Status [5:0x0]: 1:57
TIC Read Status [5:0x0]: 1:57
0x10c1d4000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10bc21d40, main = 0)
0x10c1f3000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10bc22400, main = 0)
TIC TLS Event [7:0x1c4364080]: 1, Pending(0)
TIC TLS Event [7:0x1c4364080]: 2, Pending(0)
TIC TLS Event [7:0x1c4364080]: 11, Pending(0)
TIC TLS Event [7:0x1c4364080]: 12, Pending(0)
TIC TLS Event [7:0x1c4364080]: 14, Pending(0)
TIC TLS Trust Result [7:0x1c4364080]: 0
TIC TLS Event [7:0x1c4364080]: 20, Pending(0)
TIC TCP Conn Connected [7:0x1c4364080]: Err(16)
TIC TCP Conn Event [7:0x1c4364080]: 1
TIC TCP Conn Event [7:0x1c4364080]: 8
TIC TLS Handshake Complete [7:0x1c4364080]
Task <776FB2C0-F06D-4E84-B929-D7CED9CC58DE>.<0> now using Connection 7
Task <776FB2C0-F06D-4E84-B929-D7CED9CC58DE>.<0> sent request, body N
Task <776FB2C0-F06D-4E84-B929-D7CED9CC58DE>.<0> received response, status 204 content K
Task <776FB2C0-F06D-4E84-B929-D7CED9CC58DE>.<0> response ended
XPC connection invalidated (daemon unloaded or disabled)
client.trigger:#N CCFG for cid 0x35 has # of profiles: 2
client.trigger:#N Random sample for 0x350002 is skip
client.trigger:#N Random sample for 0x350002 is skip
client.trigger:#N Random sample for 0x350002 is skip
client.trigger:#N Random sample for 0x350002 is skip
client.trigger:#N Random sample for 0x350002 is skip
client.trigger:#N Random sample for 0x350002 is skip
client.trigger:#N Random sample for 0x350002 is skip
client.trigger:#N Random sample for 0x350002 is skip
Task <86D02672-633E-48FE-A26A-22AAD7400414>.<0> now using Connection 7
Task <86D02672-633E-48FE-A26A-22AAD7400414>.<0> sent request, body N
Task <86D02672-633E-48FE-A26A-22AAD7400414>.<0> received response, status 204 content K
Task <86D02672-633E-48FE-A26A-22AAD7400414>.<0> response ended
TIC Enabling TLS [8:0x1c036a080]
TIC TCP Conn Start [8:0x1c036a080]
Task <640DC1A5-F732-4783-88F7-41FBCD5300B0>.<1> setting up Connection 8
[8 ] start
TIC TLS Event [8:0x1c036a080]: 1, Pending(0)
TIC TLS Event [8:0x1c036a080]: 2, Pending(0)
TIC TLS Event [8:0x1c036a080]: 11, Pending(0)
TIC TLS Event [8:0x1c036a080]: 12, Pending(0)
TIC TLS Event [8:0x1c036a080]: 14, Pending(0)
TIC TLS Trust Result [8:0x1c036a080]: 0
0x10bcb4000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x105805b00, main = 1)
Memory usage info dump at MainFrameLoadCompleted:
document_count: 56
virtual_size: 1918713856
internal: 81920000
javascript_gc_heap_capacity: 11894816
resident_size: 134414336
phys_footprint: 80200544
pagecache_page_count: 0
compressed: 0
javascript_gc_heap_extra_memory_size: 33952
TIC TLS Event [8:0x1c036a080]: 20, Pending(0)
TIC TCP Conn Connected [8:0x1c036a080]: Err(16)
TIC TCP Conn Event [8:0x1c036a080]: 1
TIC TCP Conn Event [8:0x1c036a080]: 8
TIC TLS Handshake Complete [8:0x1c036a080]
Task <640DC1A5-F732-4783-88F7-41FBCD5300B0>.<1> now using Connection 8
Task <640DC1A5-F732-4783-88F7-41FBCD5300B0>.<1> sent request, body N
Memory usage info dump at MainFrameLoadStarted:
document_count: 56
virtual_size: 1917190144
internal: 82034688
javascript_gc_heap_capacity: 11894816
resident_size: 134529024
phys_footprint: 80315232
pagecache_page_count: 0
compressed: 0
javascript_gc_heap_extra_memory_size: 33952
0x15de475c0 - FrameLoader::prepareForLoadStart: Starting frame load (frame = 0x105805b00, main = 1)
0x10c1b3000 - DocumentLoader::startLoadingMainResource: Starting load (frame = 0x105805b00, main = 1)
Task <640DC1A5-F732-4783-88F7-41FBCD5300B0>.<1> received response, status 200 content K
Task <640DC1A5-F732-4783-88F7-41FBCD5300B0>.<1> response ended
Memory usage info dump at MainFrameLoadCompleted:
document_count: 57
virtual_size: 1919926272
internal: 85131264
javascript_gc_heap_capacity: 19096466
resident_size: 137789440
phys_footprint: 83411808
pagecache_page_count: 0
compressed: 0
javascript_gc_heap_extra_memory_size: 5863362
0x15de475c0 - FrameLoader::checkLoadCompleteForThisFrame: Finished frame load (frame = 0x105805b00, main = 1)
0x1092bf000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10e4ff840, main = 0)
0x10bc3b000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x108bd5200, main = 0)
0x10bc3c000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10964ed00, main = 0)
0x1089b3000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10874f180, main = 0)
0x10bc32000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10e4ffcc0, main = 0)
Task <0CBA26F2-DC29-46BA-A3A6-E5BFD52547B9>.<0> now using Connection 1
Task <0CBA26F2-DC29-46BA-A3A6-E5BFD52547B9>.<0> sent request, body N
Task <0CBA26F2-DC29-46BA-A3A6-E5BFD52547B9>.<0> received response, status 200 content K
Task <0CBA26F2-DC29-46BA-A3A6-E5BFD52547B9>.<0> response ended
0x10a9de000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10a9c4d80, main = 0)
0x10a9dc000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10a9c5680, main = 0)
0x10a9be000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10a9c61c0, main = 0)
Task <53BFDEC1-2204-4EE6-811E-383F0B19885E>.<0> now using Connection 7
Task <53BFDEC1-2204-4EE6-811E-383F0B19885E>.<0> sent request, body N
0x10a9bc000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10a9c6ac0, main = 0)
Task <53BFDEC1-2204-4EE6-811E-383F0B19885E>.<0> received response, status 204 content K
Task <53BFDEC1-2204-4EE6-811E-383F0B19885E>.<0> response ended
0x10a98e000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10a9c7a80, main = 0)
TIC Enabling TLS [9:0x1c4364bc0]
TIC TCP Conn Start [9:0x1c4364bc0]
Task <68C96273-05D3-4F2D-A056-081027236ACD>.<0> setting up Connection 9
[9 ] start
0x10a98f000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10a9c73c0, main = 0)
0x1089f5000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x1089cc240, main = 0)
TIC TLS Event [9:0x1c4364bc0]: 1, Pending(0)
TIC TLS Event [9:0x1c4364bc0]: 2, Pending(0)
TIC TLS Event [9:0x1c4364bc0]: 11, Pending(0)
TIC TLS Event [9:0x1c4364bc0]: 12, Pending(0)
TIC TLS Event [9:0x1c4364bc0]: 14, Pending(0)
TIC TLS Trust Result [9:0x1c4364bc0]: 0
TIC TLS Event [9:0x1c4364bc0]: 20, Pending(0)
TIC TCP Conn Connected [9:0x1c4364bc0]: Err(16)
TIC TCP Conn Event [9:0x1c4364bc0]: 1
TIC TCP Conn Event [9:0x1c4364bc0]: 8
TIC TLS Handshake Complete [9:0x1c4364bc0]
Task <68C96273-05D3-4F2D-A056-081027236ACD>.<0> now using Connection 9
Task <68C96273-05D3-4F2D-A056-081027236ACD>.<0> sent request, body N
Task <68C96273-05D3-4F2D-A056-081027236ACD>.<0> received response, status 200 content K
Task <68C96273-05D3-4F2D-A056-081027236ACD>.<0> response ended
0x1089f4000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x1089cdd40, main = 0)
client.trigger:#N Random sample for 0x350002 is skip
client.trigger:#N Random sample for 0x350002 is skip
Task .<0> now using Connection 7
Task .<0> sent request, body N
Task .<0> received response, status 204 content K
Task .<0> response ended
Task <82D65FE3-4559-47FB-A0AE-900E60B6C88E>.<0> now using Connection 7
Task <82D65FE3-4559-47FB-A0AE-900E60B6C88E>.<0> sent request, body N
Task <82D65FE3-4559-47FB-A0AE-900E60B6C88E>.<0> received response, status 204 content K
Task <82D65FE3-4559-47FB-A0AE-900E60B6C88E>.<0> response ended
Task <91E267DF-B652-4F42-A6C4-861CBAE2BBD1>.<0> now using Connection 1
Task <91E267DF-B652-4F42-A6C4-861CBAE2BBD1>.<0> sent request, body N
Task <91E267DF-B652-4F42-A6C4-861CBAE2BBD1>.<0> received response, status 200 content K
Task <91E267DF-B652-4F42-A6C4-861CBAE2BBD1>.<0> response ended
client.trigger:#N Random sample for 0x350002 is skip
TIC Enabling TLS [10:0x1c036c480]
TIC TCP Conn Start [10:0x1c036c480]
Task .<2> setting up Connection 10
[10 ] start
TIC TLS Event [10:0x1c036c480]: 1, Pending(0)
TIC TLS Event [10:0x1c036c480]: 2, Pending(0)
TIC TLS Event [10:0x1c036c480]: 11, Pending(0)
TIC TLS Event [10:0x1c036c480]: 12, Pending(0)
TIC TLS Event [10:0x1c036c480]: 14, Pending(0)
TIC TLS Trust Result [10:0x1c036c480]: 0
TIC TLS Event [10:0x1c036c480]: 20, Pending(0)
TIC TCP Conn Connected [10:0x1c036c480]: Err(16)
TIC TCP Conn Event [10:0x1c036c480]: 1
TIC TCP Conn Event [10:0x1c036c480]: 8
TIC TLS Handshake Complete [10:0x1c036c480]
Task .<2> now using Connection 10
Task .<2> sent request, body N
Task .<2> received response, status 204 content U
Task .<2> response ended
Task <97531478-7F26-43A7-A40E-49529D03B4FF>.<0> now using Connection 7
Task <97531478-7F26-43A7-A40E-49529D03B4FF>.<0> sent request, body N
Task <97531478-7F26-43A7-A40E-49529D03B4FF>.<0> received response, status 204 content K
Task <97531478-7F26-43A7-A40E-49529D03B4FF>.<0> response ended
Task .<0> now using Connection 1
Task .<0> sent request, body N
Task .<0> received response, status 200 content K
Task .<0> response ended
client.trigger:#N Random sample for 0x350002 is skip
Task .<0> now using Connection 1
Task .<0> sent request, body N
Task .<0> received response, status 200 content K
Task .<0> response ended
client.trigger:#N Random sample for 0x350002 is skip
Task <1E2C6140-F11F-4069-A1A6-48F8F7550330>.<0> now using Connection 7
Task <1E2C6140-F11F-4069-A1A6-48F8F7550330>.<0> sent request, body N
CONSOLE LOG file:///app/main-view-model.js:36:28: onAdClosed called
Task <1E2C6140-F11F-4069-A1A6-48F8F7550330>.<0> received response, status 204 content K
Task <1E2C6140-F11F-4069-A1A6-48F8F7550330>.<0> response ended
0x1089f6000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x1089cd440, main = 0)
Task <66AF0C7C-F172-4FF5-B20D-1B99F68115C1>.<2> now using Connection 3
Task <66AF0C7C-F172-4FF5-B20D-1B99F68115C1>.<2> sent request, body N
Task <66AF0C7C-F172-4FF5-B20D-1B99F68115C1>.<2> received response, status 200 content K
Task <66AF0C7C-F172-4FF5-B20D-1B99F68115C1>.<2> response ended
0x10f4c9000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x1089cf3c0, main = 0)
0x10bcb6000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x105806400, main = 1)
Memory usage info dump at MainFrameLoadCompleted:
document_count: 72
virtual_size: 1939177472
internal: 87212032
javascript_gc_heap_capacity: 18380993
resident_size: 142983168
phys_footprint: 84165472
pagecache_page_count: 0
compressed: 0
javascript_gc_heap_extra_memory_size: 5901553
Memory usage info dump at MainFrameLoadStarted:
document_count: 72
virtual_size: 1939308544
internal: 87392256
javascript_gc_heap_capacity: 18380993
resident_size: 143163392
phys_footprint: 84345696
pagecache_page_count: 0
compressed: 0
javascript_gc_heap_extra_memory_size: 5901553
0x15ddf8bf0 - FrameLoader::prepareForLoadStart: Starting frame load (frame = 0x105806400, main = 1)
0x10f4cb000 - DocumentLoader::startLoadingMainResource: Returning cached main resource (frame = 0x105806400, main = 1)
0x110938000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x11093c000, main = 0)
Task <5C35569C-193B-4737-8F6F-0780A74668E9>.<0> now using Connection 4
Task <5C35569C-193B-4737-8F6F-0780A74668E9>.<0> sent request, body N
0x110cc5000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x11093e400, main = 0)
0x110cc7000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x11093ed00, main = 0)
0x110cc6000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x11093f600, main = 0)
0x110c89000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x11093c480, main = 0)
0x110c8b000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x11093e880, main = 0)
0x110c8a000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x110c80480, main = 0)
Task <5C35569C-193B-4737-8F6F-0780A74668E9>.<0> received response, status 200 content K
Task <5C35569C-193B-4737-8F6F-0780A74668E9>.<0> response ended
Memory usage info dump at MainFrameLoadCompleted:
document_count: 81
virtual_size: 1954283520
internal: 96616448
javascript_gc_heap_capacity: 22318701
resident_size: 152420352
phys_footprint: 93586312
pagecache_page_count: 0
compressed: 0
javascript_gc_heap_extra_memory_size: 5911565
0x15ddf8bf0 - FrameLoader::checkLoadCompleteForThisFrame: Finished frame load (frame = 0x105806400, main = 1)
0x110c88000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x110c81440, main = 0)
0x110c51000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x110c81d40, main = 0)
0x110c53000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x110c82640, main = 0)
0x110c52000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x110c82f40, main = 0)
0x110c50000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x110c83840, main = 0)
0x110939000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x110c821c0, main = 0)
0x110c39000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x110c83cc0, main = 0)
0x110c3b000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x110c2c240, main = 0)
0x110c3a000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x110c2cb40, main = 0)
0x110c38000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x110c2d440, main = 0)
0x110c1d000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x110c2dd40, main = 0)
0x110c1f000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x110c2e880, main = 0)
0x110c1e000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x110c2f180, main = 0)
0x110c1c000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x110c2fa80, main = 0)
Task <2E198B0B-C5C7-40EA-9E48-50D3E3B064DA>.<0> now using Connection 7
Task <2E198B0B-C5C7-40EA-9E48-50D3E3B064DA>.<0> sent request, body N
0x110ff9000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x110c80900, main = 0)
0x110ffb000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x110c2e1c0, main = 0)
0x10bc91000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10bc95200, main = 0)
TIC Enabling TLS [11:0x1c4366000]
TIC TCP Conn Start [11:0x1c4366000]
Task .<1> setting up Connection 11
[11 ] start
0x108bb1000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10b823cc0, main = 0)
TIC TLS Event [11:0x1c4366000]: 1, Pending(0)
TIC TLS Event [11:0x1c4366000]: 2, Pending(0)
TIC TLS Event [11:0x1c4366000]: 11, Pending(0)
TIC TLS Event [11:0x1c4366000]: 12, Pending(0)
TIC TLS Event [11:0x1c4366000]: 14, Pending(0)
TIC TLS Trust Result [11:0x1c4366000]: 0
TIC TLS Event [11:0x1c4366000]: 20, Pending(0)
TIC TCP Conn Connected [11:0x1c4366000]: Err(16)
TIC TCP Conn Event [11:0x1c4366000]: 1
TIC TCP Conn Event [11:0x1c4366000]: 8
TIC TLS Handshake Complete [11:0x1c4366000]
Task .<1> now using Connection 11
Task .<1> sent request, body N
Task <2E198B0B-C5C7-40EA-9E48-50D3E3B064DA>.<0> received response, status 204 content K
Task <2E198B0B-C5C7-40EA-9E48-50D3E3B064DA>.<0> response ended
Task .<1> received response, status 303 content K
Task .<1> response ended
TIC Enabling TLS [12:0x1c0369240]
TIC TCP Conn Start [12:0x1c0369240]
Task .<1> setting up Connection 12
[12 ] start
TIC TLS Event [12:0x1c0369240]: 1, Pending(0)
TIC TLS Event [12:0x1c0369240]: 2, Pending(0)
TIC TLS Event [12:0x1c0369240]: 11, Pending(0)
TIC TLS Event [12:0x1c0369240]: 12, Pending(0)
TIC TLS Event [12:0x1c0369240]: 14, Pending(0)
TIC TLS Trust Result [12:0x1c0369240]: 0
TIC TLS Event [12:0x1c0369240]: 20, Pending(0)
TIC TCP Conn Connected [12:0x1c0369240]: Err(16)
TIC TCP Conn Event [12:0x1c0369240]: 1
TIC TCP Conn Event [12:0x1c0369240]: 8
TIC TLS Handshake Complete [12:0x1c0369240]
Task .<1> now using Connection 12
Task .<1> sent request, body N
Task .<1> received response, status 206 content K
Task <9E898430-0EE2-4EED-BC5C-7F7F20A73C39>.<0> now using Connection 7
Task <9E898430-0EE2-4EED-BC5C-7F7F20A73C39>.<0> sent request, body N
TIC TCP Conn Cancel [12:0x1c0369240]
Task .<1> response ended
[12 stream, pid: 2677, url: https://r1---sn-qxo7rn7e.googlevideo.com/videoplayback?id=d0ff911266dccf16&itag=22&source=youtube&requiressl=yes&mm=31&mn=sn-qxo7r, tls] cancelled
[12.1 CA24B142-39BD-40C5-891A-188B40B1EF39 .54659<->]
Connected Path: satisfied (Path is satisfied), interface: en0, ipv4, dns
Duration: 0.310s, DNS @0.003s took 0.009s, TCP @0.014s took 0.015s, TLS took 0.069s
bytes in/out: 1355374/1098, packets in/out: 983/3, rtt: 0.029s, retransmitted packets: 0, out-of-order packets: 0
TIC TCP Conn Destroyed [12:0x1c0369240]
TIC TCP Conn Cancel [11:0x1c4366000]
[11 stream, pid: 2677, url: https://www.youtube.com/get_video?video_id=0P-REmbczxY&ts=1552243221&t=g-2qskbqImy37uHL2cgRs5LakEk&gad=1&br=1&itag=22,18, tls] cancelled
[11.1 020FE922-C543-44AF-9BA6-351C7FBC75AE .54658<->]
Connected Path: satisfied (Path is satisfied), interface: en0, ipv4, dns
Duration: 0.489s, DNS @0.000s took 0.003s, TCP @0.004s took 0.015s, TLS took 0.048s
bytes in/out: 4629/885, packets in/out: 9/10, rtt: 0.021s, retransmitted packets: 1, out-of-order packets: 0
TIC TCP Conn Destroyed [11:0x1c4366000]
TIC Read Status [11:0x0]: 1:57
TIC Read Status [11:0x0]: 1:57
Task <9E898430-0EE2-4EED-BC5C-7F7F20A73C39>.<0> received response, status 204 content K
Task <9E898430-0EE2-4EED-BC5C-7F7F20A73C39>.<0> response ended
client.trigger:#N Random sample for 0x350002 is skip
client.trigger:#N Random sample for 0x350002 is skip
Task <4A2C7B00-77A2-4C45-A222-7CEC7CDF949E>.<0> now using Connection 7
Task <4A2C7B00-77A2-4C45-A222-7CEC7CDF949E>.<0> sent request, body N
Task <4A2C7B00-77A2-4C45-A222-7CEC7CDF949E>.<0> received response, status 204 content K
Task <4A2C7B00-77A2-4C45-A222-7CEC7CDF949E>.<0> response ended
Task .<3> now using Connection 8
Task .<3> sent request, body N
Task .<3> received response, status 200 content K
Task .<3> response ended
0x10bc90000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10b8206c0, main = 0)
0x10b8e8000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10b820fc0, main = 0)
0x110ff8000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10b8218c0, main = 0)
0x10b8e9000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10b8221c0, main = 0)
0x1089b0000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10b8cd200, main = 0)
0x110f89000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10b8cdb00, main = 0)
Task .<0> now using Connection 1
Task .<0> sent request, body N
Task .<0> received response, status 200 content K
Task .<0> response ended
0x110f8b000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10b8ce1c0, main = 0)
0x110f88000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10bc94240, main = 0)
0x110f4e000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10b820b40, main = 0)
Task .<0> now using Connection 9
Task .<0> sent request, body N
0x110f4c000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10b8cfa80, main = 0)
Task <0FEADFC9-9430-4E3D-997D-6F1FB3F71CDA>.<0> now using Connection 7
Task <0FEADFC9-9430-4E3D-997D-6F1FB3F71CDA>.<0> sent request, body N
0x110f4f000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10b821440, main = 0)
Task .<0> received response, status 200 content K
Task <0FEADFC9-9430-4E3D-997D-6F1FB3F71CDA>.<0> received response, status 204 content K
Task <0FEADFC9-9430-4E3D-997D-6F1FB3F71CDA>.<0> response ended
Task .<0> response ended
0x110f32000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x10b823a80, main = 0)
TIC TCP Conn Cancel [2:0x1c417de80]
[2 stream, pid: 2677, url: https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40-loader.appcache, tls] cancelled
[2.1 11755975-D324-4423-9B0C-2416A9DEE845 .54649<->]
Connected Path: satisfied (Path is satisfied), interface: en0, ipv4, dns
Duration: 30.962s, DNS @0.001s took 0.004s, TCP @0.011s took 0.016s, TLS took 0.030s
bytes in/out: 1042/820, packets in/out: 2/3, rtt: 0.030s, retransmitted packets: 0, out-of-order packets: 0
Task <817141F9-64BD-4C3E-AE01-8A124AA9A78B>.<0> now using Connection 7
Task <817141F9-64BD-4C3E-AE01-8A124AA9A78B>.<0> sent request, body N
client.trigger:#N Random sample for 0x350002 is skip
client.trigger:#N Random sample for 0x350002 is skip
Task <817141F9-64BD-4C3E-AE01-8A124AA9A78B>.<0> received response, status 204 content K
Task <817141F9-64BD-4C3E-AE01-8A124AA9A78B>.<0> response ended
Task .<0> now using Connection 7
Task .<0> sent request, body N
Task .<0> received response, status 204 content K
Task .<0> response ended
Task .<0> now using Connection 1
Task .<0> sent request, body N
Task .<0> received response, status 200 content K
Task .<0> response ended
client.trigger:#N Random sample for 0x350002 is skip
Task <60B46E8F-672B-4B73-ABF2-F2E02C91BEB1>.<4> now using Connection 10
Task <60B46E8F-672B-4B73-ABF2-F2E02C91BEB1>.<4> sent request, body N
Task <60B46E8F-672B-4B73-ABF2-F2E02C91BEB1>.<4> received response, status 204 content U
Task <60B46E8F-672B-4B73-ABF2-F2E02C91BEB1>.<4> response ended
Task .<0> now using Connection 7
Task .<0> sent request, body N
Task .<0> received response, status 204 content K
Task .<0> response ended
Task <2295D9CC-3DAD-4C3A-BF5E-473A869B10B0>.<0> now using Connection 1
Task <2295D9CC-3DAD-4C3A-BF5E-473A869B10B0>.<0> sent request, body N
Task <2295D9CC-3DAD-4C3A-BF5E-473A869B10B0>.<0> received response, status 200 content K
Task <2295D9CC-3DAD-4C3A-BF5E-473A869B10B0>.<0> response ended
Task <8A065411-C833-4BC5-AB84-63F496DED3B5>.<0> now using Connection 7
Task <8A065411-C833-4BC5-AB84-63F496DED3B5>.<0> sent request, body N
Task <8A065411-C833-4BC5-AB84-63F496DED3B5>.<0> received response, status 204 content K
Task <8A065411-C833-4BC5-AB84-63F496DED3B5>.<0> response ended
client.trigger:#N Random sample for 0x350002 is skip
TIC TCP Conn Cancel [4:0x1c0367800]
[4 stream, pid: 2677, url: https://lh3.googleusercontent.com/1vSwOAGw8Btx-k16b48dN15KRZnhBV7gmw-YRO7k46V7l7g6tQnaIkm6G9uBj7FldthqH-i2Pg=s124-l80#fifeurl, tls] cancelled
[4.1 E9E13119-1EFE-4F40-BC06-012604DF2379 .54651<->]
Connected Path: satisfied (Path is satisfied), interface: en0, ipv4, dns
Duration: 53.588s, DNS @0.000s took 0.005s, TCP @0.007s took 0.017s, TLS took 0.074s
bytes in/out: 17739/2099, packets in/out: 15/4, rtt: 0.018s, retransmitted packets: 0, out-of-order packets: 0
TIC TCP Conn Cancel [9:0x1c4364bc0]
[9 stream, pid: 2677, url: https://pagead2.googlesyndication.com/pcs/activeview?xai=AKAOjssIR0RAToMDmMPBBo-l5PhQ-1lBjvFIN45NzPYxuhzsK2-nFG1MDalRNDpjZvcGJqly0, tls] cancelled
[9.1 84CC810D-767A-4006-A944-B50E5407017D .54656<->]
Connected Path: satisfied (Path is satisfied), interface: en0, ipv4, dns
Duration: 56.152s, DNS @0.001s took 0.008s, TCP @0.013s took 0.015s, TLS took 0.102s
bytes in/out: 4152/3085, packets in/out: 5/6, rtt: 0.016s, retransmitted packets: 0, out-of-order packets: 0
TIC TCP Conn Cancel [1:0x1c017cf80]
[1 stream, pid: 2677, url: https://googleads.g.doubleclick.net/mads/static/sdk/native/sdk-core-v40.html?sdk=afma-sdk-i-v7.37.0, tls] cancelled
[1.1 D84F346D-2407-4F45-96A0-CC970CD85E38 .54648<->]
Connected Path: satisfied (Path is satisfied), interface: en0, ipv4, dns
Duration: 71.967s, DNS @0.000s took 0.017s, TCP @0.034s took 0.016s, TLS took 0.085s
bytes in/out: 123275/14998, packets in/out: 96/21, rtt: 0.018s, retransmitted packets: 0, out-of-order packets: 0
TIC TCP Conn Cancel [7:0x1c4364080]
[7 stream, pid: 2677, url: https://csi.gstatic.com/csi?v=3&s=gmob&action=js_webview_partial&e=318477469,318483349,318484345,318483174,318483670,318484156,318, tls] cancelled
[7.1 37A0A972-963A-4573-A3E7-58398F930CAF .54654<->]
Connected Path: satisfied (Path is satisfied), interface: en0, ipv4, dns
Duration: 70.706s, DNS @0.001s took 0.020s, TCP @0.022s took 0.144s, TLS took 0.320s
bytes in/out: 9620/27323, packets in/out: 19/31, rtt: 0.253s, retransmitted packets: 0, out-of-order packets: 0

Final notes

I will submit a PR if I find a solution, in the meantime, any extra eyes are appreciated.

Banner Ads Not Vissible For Multiple Pages

The Plugin works fine for a single page. But if you have Multiple Page when the second page loads it covers the entire screen and the ad is not visible.

i use the following to navigate to the second page
frameModule.topmost().navigate("secondPage")

TypeError: Cannot read property 'getRewardedVideoAdInstance' of undefined

Calling preloadRewardedVideoAd fails with errors:

JS: Error in admob.preloadRewardedVideoAd: TypeError: Cannot read property 'getRewardedVideoAdInstance' of undefined

JS: TypeError: Cannot read property 'getRewardedVideoAdInstance' of undefined

I have no Idea how to fix this. Can anyone help?

Banner appears with testing = true but not in production

Hi all,

In debug mode, the banner appears fine on the screen. When i set the "testing" boolean to false, the banner don't appear anymore. Sometimes if i tap the banner area frantically, it may appear...

I tried the demo code and it works just fine.

I really can't figure why it doesn't work while not in testing mode.

My component code:
Home.component.ts:

import { Component, OnInit, NgZone, AfterViewInit } from "@angular/core";
import * as dialogs from "tns-core-modules/ui/dialogs";
import { Trip } from "../shared/trip";
import { Folder, File, path } from "tns-core-modules/file-system";
import * as Toast from "nativescript-toast";
import * as Admob from "nativescript-admob";
import { isIOS } from "tns-core-modules/platform";

declare var android: any;

var Sqlite = require("nativescript-sqlite");

@Component({
    selector: "Home",
    moduleId: module.id,
    templateUrl: "./home.component.html",
    styleUrls: ["home.component.scss"]
})
export class HomeComponent implements OnInit, AfterViewInit {

    private testing: boolean = false;
    private androidBannerId: string = "ca-app-pub-4388645964603052/7349200111";
    private iosBannerId: string = "ca-app-pub-4388645964603052/5489054038";
    private BannerIdTest: string = "ca-app-pub-3940256099942544/6300978111";

    private database: any;

    public trips: Array<Trip>;

    public isOnTrip: boolean = false;
    private startDate: Date;
    private stopDate: Date;

    constructor(private _ngZone: NgZone) {

    }

    ngOnInit(): void {
        this.databaseFetch();
    }

    ngAfterViewInit(): void {
        // console.log("ngAfterViewInit");

        setTimeout(() => {
            this.createBanner();
        }, 1500);

    }

...

    public createBanner() {
        Admob.createBanner(
            {
                testing: this.testing,
                size: Admob.AD_SIZE.SMART_BANNER,
                androidBannerId: this.testing
                    ? this.BannerIdTest  // global test banner id
                    : this.androidBannerId, // our registered banner id
                // Android automatically adds the connected device as test device with testing:true, iOS does not
                iosBannerId: this.iosBannerId,
                // iosTestDeviceIds: ["yourTestDeviceUDIDs", "canBeAddedHere"],
                margins: {
                    bottom: isIOS ? 50 : 0
                },
                keywords: ["travel", "time"]
            }).then(function () {
                // console.log("admob createBanner done");
            }, function (error) {
                // console.log("admob createBanner error: " + error);
            });
    }
}

home.component.html:

<ActionBar title="My app">
    <ActionItem text="Export" ios.position="right" (tap)="onExportTap()"></ActionItem>
</ActionBar>

<StackLayout orientation="vertical" class="page">
    <GridLayout columns="*, *" class="btn-container">
        <Button text="Start" col="0" (tap)="onStartTap()" class="btn" isEnabled="{{ !isOnTrip }}"></Button>
        <Button text="Stop" col="1" (tap)="onStopTap()" class="btn" isEnabled="{{ isOnTrip }}"></Button>
    </GridLayout>
    <GridLayout columns="2*, 2*, *" class="header">
        <Label text="Start date" col="0" textWrap="true"></Label>
        <Label text="Stop date" col="1" textWrap="true"></Label>
        <Label text="Duration" col="2" textWrap="true"></Label>
    </GridLayout>
    <StackLayout>
        <ListView [items]="trips" class="list list-group">
            <ng-template let-trip="item" let-i="index">
                <GridLayout columns="2*, 2*, *" class="list-group-item" (longPress)="onLongPress(i)">
                    <Label text="{{ trip.startDate | date: 'yy/MM/dd HH:mm:ss' }}" col="0" textWrap="true"></Label>
                    <Label text="{{ trip.stopDate | date: 'yy/MM/dd HH:mm:ss' }}" col="1" textWrap="true"></Label>
                    <Label text="{{ trip.tripTime }}" col="2" textWrap="true"></Label>
                        </GridLayout>
                </ng-template>
            </ListView>
        </StackLayout>
</StackLayout>

home.component.scss:

$btn-radius: 20;
$btn-margin: 10px;
$red: #ff0000;

.page {
    height: 100%;
}



.btn-container {
    margin: 1%;
    height: 10%;
}

.header {
    height: 5%;
    color: black;
    text-align: center;
}

.list {
    height: 100%;
    text-align: center;
}


.btn {

    background-color: #56a7c7;
    border-radius: $btn-radius $btn-radius $btn-radius $btn-radius;
    color: black;
    margin: $btn-margin $btn-margin $btn-margin $btn-margin;

    &:active {
        background-color: #36697e;
    }

    &:disabled {
        background-color: gray;
    }

}

Any idea?

Regards,

Tristan

TypeError: com.google.android.gms.ads.AdView is not a function

Hi,

Sorry, me again. I'm still trying to make this work. I can successfully build and run the demo admob app and I can see the ad but in my app I guess I'm missing something. I keep getting this error:
JS: Error in admob.createBanner: TypeError: com.google.android.gms.ads.AdView is not a function JS: admob createBanner error: TypeError: com.google.android.gms.ads.AdView is not a function

Any idea is welcome.

Unable to get provider com.google.android.gms.ads.MobileAdsInitProvider

For some reason I get this error, the only thing i recall doing is test the ios version of the app for the first time so i installed the cocoa pods and run it in ios and it worked, then i try to run it in android again and the app does not even start, this is the complete error log.
tns platform remove/add does not seem to work either.

`FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to get provider com.google.android.gms.ads.MobileAdsInitProvider: java.lang.IllegalStateException

                                                                          * The Google Mobile Ads SDK was initialized incorrectly. AdMob publishers    *
                                                                          * should follow the instructions here: https://goo.gl/fQ2neu to add a valid  *
                                                                          * App ID inside the AndroidManifest. Google Ad Manager publishers should     *
                                                                          * follow instructions here: https://goo.gl/h17b6x.                           *

                                                                              at android.app.ActivityThread.installProvider(ActivityThread.java:5177)
                                                                              at android.app.ActivityThread.installContentProviders(ActivityThread.java:4769)
                                                                              at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4709)
                                                                              at android.app.ActivityThread.-wrap1(ActivityThread.java)
                                                                              at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1415)
                                                                              at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                              at android.os.Looper.loop(Looper.java:148)
                                                                              at android.app.ActivityThread.main(ActivityThread.java:5443)
                                                                              at java.lang.reflect.Method.invoke(Native Method)
                                                                              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
                                                                              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
                                                                           Caused by: java.lang.IllegalStateException: `

NativeScript +angular Cannot find module "nativescript-admob"

tns plugin add nativescript-admob
tns build android
build OK

import in app.component.ts:
import * as Admob from "nativescript-admob";

tns run android --emulator

app/app.component.ts(13,24): error TS2307: Cannot find module 'nativescript-admob'.
TypeScript compiler failed with exit code 1

Banner overlay over content

The banner comes over my listview and when I have a list of just to cover the screen, the bottom list item becomes invisible, because the banner appears above. And listview does not scrolling.

Are there any css tricks I can do here?

How to check when ad is closed?

In previous version of this plugin, when using admob.createInterstititial we were able use onAdClosed event which was very useful. After I updated this plugin I am unable to do the same. Is there any way I can call a function when the ad is closed?

Build error "Could not find common.jar (android.arch.core:common:1.0.0)"

I tried adding this plugin to a {N} 4.1 project today and sometimes when I build I am getting the error I'll paste below. It appears that the following file is simply missing: https://jcenter.bintray.com/android/arch/core/common/1.0.0/common-1.0.0.jar

There is a valid file at https://jcenter.bintray.com/android/arch/core/common/1.1.0/common-1.1.0.jar, but I couldn't find where/how to simply swap the dependency out (I assume that this library is dependent on a library that is dependent on this file?)

Here's the full error:

[18-06-07 16:25:33.498] (CLI) * What went wrong:
[18-06-07 16:25:33.498] (CLI) Could not resolve all files for configuration ':releaseCompileClasspath'.
[18-06-07 16:25:33.498] (CLI) > Could not find common.jar (android.arch.core:common:1.0.0).
[18-06-07 16:25:33.498] (CLI)   Searched in the following locations:
[18-06-07 16:25:33.498] (CLI)       https://jcenter.bintray.com/android/arch/core/common/1.0.0/common-1.0.0.jar```

Any help on this?

Socket connection timeout issue

I have been experiencing Error is: Socket connection timeout issues for about a week now. The issue is well explained here by another member. The only recourse that I have found is to completely uninstall nativescript-admob. Even if it is not actually called anywhere in the code, its mere presence triggers these Socket connection timeout issues. Any help is greatly appreciated.

Banner ads do not work once archived for iOS

While developing for iOS, the createBanner will work properly both on simulator and devices but as soon as you make an archive and deploy that on a device, the banner ads do not work. This issue has to do with static libraries in GoogleMobileAds i believe. The createBanner just rejects the createBanner promises stating the metadata is found but the kGADAdSizeSmartBannerPortrait symbol is not found (or what ever other banner size you are using). Is there a work around?

Angular 2 Router Overlaps Ads

Hey there eddy,
I am using TNS with ng2. I have the plugin working and showing ads on load. I have set up a repo here of my code.

Observation

Here is what I have encountered. In my app I have a <page-router-outlet> that uses the router configuration to show relevant pages.
The banner ad shows up when the app loads as I am calling the admob.createBanner in the constructor of the home page.

But as soon as I navigate to another page the ad is overlapped by the new page which was navigated to. Not only that going back to the page where ad was visible, the ad no longer shows up.

I see flashes of the banner ad when navigating between routes.

Seems like when the router is used It loads everything on top of the ad.

I have checked the above on Android 5.1 device and Android 4.4 emulator.

Let me know what is to be done here.

-Thanks

Failed resolution of: Landroid/webkit/SafeBrowsingResponse;

Tested on Galaxy s8+ with Android 8.0.0 , with a new --ng project

I've created an Admob Account and added 2 units. (banner and another one)
However -
I'm getting this error when using the plugin :

JS: Treating this deviceId as testdevice: 95D2AA7E57DF5A8FBFB6225CDEC2EF81
chromium: [INFO:library_loader_hooks.cc(36)] Chromium logging enabled: level = 0, default verbosity = 0
05-12 11:35:55.672 27055 27055 I cr_BrowserStartup: Initializing chromium process, singleProcess=false
05-12 11:35:55.778 27055 27055 I zygote  : Rejecting re-init on previously-failed class java.lang.Class<com.android.webview.chromium.hb>: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/webkit/SafeBrowsingResponse;
05-12 11:35:55.779 27055 27055 I zygote  :   at void com.android.webview.chromium.WebViewChromium.init(java.util.Map, boolean) (WebViewChromium.java:48)
05-12 11:35:55.779 27055 27055 I zygote  :   at java.lang.Object com.tns.Runtime.callJSMethodNative(int, int, java.lang.String, int, boolean, java.lang.Object[]) (Runtime.java:-2)
05-12 11:35:55.779 27055 27055 I zygote  :   at java.lang.Object com.tns.Runtime.dispatchCallJSMethodNative(int, java.lang.String, boolean, long, java.lang.Class, java.lang.Object[]) (Runtime.java:1088)
05-12 11:35:55.779 27055 27055 I zygote  :   at java.lang.Object com.tns.Runtime.callJSMethodImpl(java.lang.Object, java.lang.String, java.lang.Class, boolean, long, java.lang.Object[]) (Runtime.java:970)
05-12 11:35:55.779 27055 27055 I zygote  :   at java.lang.Object com.tns.Runtime.callJSMethod(java.lang.Object, java.lang.String, java.lang.Class, boolean, long, java.lang.Object[]) (Runtime.java:957)
05-12 11:35:55.779 27055 27055 I zygote  :   at java.lang.Object com.tns.Runtime.callJSMethod(java.lang.Object, java.lang.String, java.lang.Class, boolean, java.lang.Object[]) (Runtime.java:941)
05-12 11:35:55.779 27055 27055 I zygote  :   at java.lang.Object com.tns.Runtime.callJSMethod(java.lang.Object, java.lang.String, java.lang.Class, java.lang.Object[]) (Runtime.java:933)
05-12 11:35:55.780 27055 27055 I zygote  :   at void com.android.webview.chromium.WebViewChromium.init(java.util.Map, boolean) (WebViewChromium.java:48)
05-12 11:35:55.781 27055 27055 I zygote  :   at java.lang.Object com.tns.Runtime.callJSMethodNative(int, int, java.lang.String, int, boolean, java.lang.Object[]) (Runtime.java:-2)
05-12 11:35:55.781 27055 27055 I zygote  :   at java.lang.Object com.tns.Runtime.dispatchCallJSMethodNative(int, java.lang.String, boolean, long, java.lang.Class, java.lang.Object[]) (Runtime.java:1088)
05-12 11:35:55.781 27055 27055 I zygote  :   at java.lang.Object com.tns.Runtime.callJSMethodImpl(java.lang.Object, java.lang.String, java.lang.Class, boolean, long, java.lang.Object[]) (Runtime.java:970)
05-12 11:35:55.781 27055 27055 I zygote  :   at java.lang.Object com.tns.Runtime.callJSMethod(java.lang.Object, java.lang.String, java.lang.Class, boolean, long, java.lang.Object[]) (Runtime.java:957)
05-12 11:35:55.781 27055 27055 I zygote  :   at java.lang.Object com.tns.Runtime.callJSMethod(java.lang.Object, java.lang.String, java.lang.Class, boolean, java.lang.Object[]) (Runtime.java:941)
05-12 11:35:55.781 27055 27055 I zygote  :   at java.lang.Object com.tns.Runtime.callJSMethod(java.lang.Object, java.lang.String, java.lang.Class, java.lang.Object[]) (Runtime.java:933)
05-12 11:35:55.783 27055 27055 I zygote  : Rejecting re-init on previously-failed class java.lang.Class<com.android.webview.chromium.hb>: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/webkit/SafeBrowsingResponse;
05-12 11:35:55.783 27055 27055 I zygote  :   at void com.android.webview.chromium.WebViewChromium.init(java.util.Map, boolean) (WebViewChromium.java:48)
05-12 11:35:55.783 27055 27055 I zygote  :   at java.lang.Object com.tns.Runtime.callJSMethodNative(int, int, java.lang.String, int, boolean, java.lang.Object[]) (Runtime.java:-2)
05-12 11:35:55.783 27055 27055 I zygote  :   at java.lang.Object com.tns.Runtime.dispatchCallJSMethodNative(int, java.lang.String, boolean, long, java.lang.Class, java.lang.Object[]) (Runtime.java:1088)
05-12 11:35:55.783 27055 27055 I zygote  :   at java.lang.Object com.tns.Runtime.callJSMethodImpl(java.lang.Object, java.lang.String, java.lang.Class, boolean, long, java.lang.Object[]) (Runtime.java:970)
05-12 11:35:55.783 27055 27055 I zygote  :   at java.lang.Object com.tns.Runtime.callJSMethod(java.lang.Object, java.lang.String, java.lang.Class, boolean, long, java.lang.Object[]) (Runtime.java:957)
05-12 11:35:55.784 27055 27055 I zygote  :   at java.lang.Object com.tns.Runtime.callJSMethod(java.lang.Object, java.lang.String, java.lang.Class, boolean, java.lang.Object[]) (Runtime.java:941)
05-12 11:35:55.784 27055 27055 I zygote  :   at java.lang.Object com.tns.Runtime.callJSMethod(java.lang.Object, java.lang.String, java.lang.Class, java.lang.Object[]) (Runtime.java:933)
05-12 11:35:55.784 27055 27055 I zygote  :   at void com.android.webview.chromium.WebViewChromium.init(java.util.Map, boolean) (WebViewChromium.java:48)
05-12 11:35:55.785 27055 27055 I zygote  :   at java.lang.Object com.tns.Runtime.callJSMethodNative(int, int, java.lang.String, int, boolean, java.lang.Object[]) (Runtime.java:-2)
05-12 11:35:55.785 27055 27055 I zygote  :   at java.lang.Object com.tns.Runtime.dispatchCallJSMethodNative(int, java.lang.String, boolean, long, java.lang.Class, java.lang.Object[]) (Runtime.java:1088)
05-12 11:35:55.785 27055 27055 I zygote  :   at java.lang.Object com.tns.Runtime.callJSMethodImpl(java.lang.Object, java.lang.String, java.lang.Class, boolean, long, java.lang.Object[]) (Runtime.java:970)
05-12 11:35:55.785 27055 27055 I zygote  :   at java.lang.Object com.tns.Runtime.callJSMethod(java.lang.Object, java.lang.String, java.lang.Class, boolean, long, java.lang.Object[]) (Runtime.java:957)
05-12 11:35:55.785 27055 27055 I zygote  :   at java.lang.Object com.tns.Runtime.callJSMethod(java.lang.Object, java.lang.String, java.lang.Class, boolean, java.lang.Object[]) (Runtime.java:941)
05-12 11:35:55.785 27055 27055 I zygote  :   at java.lang.Object com.tns.Runtime.callJSMethod(java.lang.Object, java.lang.String, java.lang.Class, java.lang.Object[]) (Runtime.java:933)
05-12 11:35:55.786 27055 27055 I zygote  : Rejecting re-init on previously-failed class java.lang.Class<com.android.webview.chromium.hb>: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/webkit/SafeBrowsingResponse;
05-12 11:35:55.786 27055 27055 I zygote  :   at void com.android.webview.chromium.WebViewChromium.init(java.util.Map, boolean) (WebViewChromium.java:48)
05-12 11:35:55.787 27055 27055 I zygote  :   at java.lang.Object com.tns.Runtime.callJSMethodNative(int, int, java.lang.String, int, boolean, java.lang.Object[]) (Runtime.java:-2)
05-12 11:35:55.787 27055 27055 I zygote  :   at java.lang.Object com.tns.Runtime.dispatchCallJSMethodNative(int, java.lang.String, boolean, long, java.lang.Class, java.lang.Object[]) (Runtime.java:1088)
05-12 11:35:55.787 27055 27055 I zygote  :   at java.lang.Object com.tns.Runtime.callJSMethodImpl(java.lang.Object, java.lang.String, java.lang.Class, boolean, long, java.lang.Object[]) (Runtime.java:970)
05-12 11:35:55.787 27055 27055 I zygote  :   at java.lang.Object com.tns.Runtime.callJSMethod(java.lang.Object, java.lang.String, java.lang.Class, boolean, long, java.lang.Object[]) (Runtime.java:957)
05-12 11:35:55.787 27055 27055 I zygote  :   at java.lang.Object com.tns.Runtime.callJSMethod(java.lang.Object, java.lang.String, java.lang.Class, boolean, java.lang.Object[]) (Runtime.java:941)
05-12 11:35:55.787 27055 27055 I zygote  :   at java.lang.Object com.tns.Runtime.callJSMethod(java.lang.Object, java.lang.String, java.lang.Class, java.lang.Object[]) (Runtime.java:933)
05-12 11:35:55.788 27055 27055 I zygote  :   at void com.android.webview.chromium.WebViewChromium.init(java.util.Map, boolean) (WebViewChromium.java:48)
05-12 11:35:55.788 27055 27055 I zygote  :   at java.lang.Object com.tns.Runtime.callJSMethodNative(int, int, java.lang.String, int, boolean, java.lang.Object[]) (Runtime.java:-2)
05-12 11:35:55.788 27055 27055 I zygote  :   at java.lang.Object com.tns.Runtime.dispatchCallJSMethodNative(int, java.lang.String, boolean, long, java.lang.Class, java.lang.Object[]) (Runtime.java:1088)
05-12 11:35:55.788 27055 27055 I zygote  :   at java.lang.Object com.tns.Runtime.callJSMethodImpl(java.lang.Object, java.lang.String, java.lang.Class, boolean, long, java.lang.Object[]) (Runtime.java:970)
05-12 11:35:55.788 27055 27055 I zygote  :   at java.lang.Object com.tns.Runtime.callJSMethod(java.lang.Object, java.lang.String, java.lang.Class, boolean, long, java.lang.Object[]) (Runtime.java:957)
05-12 11:35:55.788 27055 27055 I zygote  :   at java.lang.Object com.tns.Runtime.callJSMethod(java.lang.Object, java.lang.String, java.lang.Class, boolean, java.lang.Object[]) (Runtime.java:941)
05-12 11:35:55.788 27055 27055 I zygote  :   at java.lang.Object com.tns.Runtime.callJSMethod(java.lang.Object, java.lang.String, java.lang.Class, java.lang.Object[]) (Runtime.java:933)
JS: admob createBanner done
11:36:06 - Compilation complete. Watching for file changes.

image

App is working but I don't see anything any add .

TNS INFO :

C:\ns\temp\g\pa>tns info
√ Getting NativeScript components versions information...
√ Component nativescript has 4.0.1 version and is up to date.
√ Component tns-core-modules has 4.0.0 version and is up to date.
√ Component tns-android has 4.0.1 version and is up to date.
× Component tns-ios is not installed.

This is the file I've used :

import {Component, OnInit} from "@angular/core";
import * as Admob          from "nativescript-admob";
import {Item}              from "./item";
import {ItemService}       from "./item.service";

@Component({
               selector   : "ns-items",
               moduleId   : module.id,
               templateUrl: "./items.component.html"
           })
export class ItemsComponent implements OnInit
    {
        items: Item[];
        private androidBannerId: string = "ca-app-pub-442409393153579x/xxxxx"; //removed actual id
        private androidInterstitialId: string = "ca-app-pub-442409393153579x/xxxxxxxx"; //removed actual id
        
        // Angular knows about this service because it is included in your app’s main NgModule, defined in app.module.ts.
        constructor(private itemService: ItemService)
        {
        }
        
        public createInterstitial()
        {
            Admob.createInterstitial({
                                         testing              : true, // iosInterstitialId: this.iosInterstitialId,
                                         androidInterstitialId: this.androidInterstitialId //   iosTestDeviceIds: ["yourTestDeviceUDIDs"]
                                     })
                 .then(function ()
                       {
                           console.log("admob createInterstitial done");
                       }, function (error)
                       {
                           console.log("admob createInterstitial error: " + error);
                       });
        }
        
        public hideBanner()
        {
            Admob.hideBanner()
                 .then(function ()
                       {
                           console.log("admob hideBanner done");
                       }, function (error)
                       {
                           console.log("admob hideBanner error: " + error);
                       });
        }
        
        // This pattern makes use of Angular’s dependency injection implementation to inject an instance of the ItemService service into this class. 

        public createBanner()
        {
            Admob.createBanner({
                                   testing        : true,
                                   size           : Admob.AD_SIZE.BANNER, //     iosBannerId: this.iosBannerId,
                                   androidBannerId: this.androidBannerId, //  iosTestDeviceIds: ["yourTestDeviceUDIDs"],
                                   margins        : {
                                       // bottom: 30
                                   }
                               })
                 .then(function ()
                       {
                           console.log("admob createBanner done");
                       }, function (error)
                       {
                           console.log("admob createBanner error: " + error);
                       });
        }
        
        ngOnInit(): void
        {
            this.items = this.itemService.getItems();
            setTimeout(() =>
                       {
                           this.createBanner();
                       }, 3000);
        }
    }

UPDATE1 : I've added a log to gradle file to see which version does app compile to :

image

(again - it's a new tns create aaa --ng app)

UPDATE2

Taking your non-angular demo , it did work since it used ns 3.4.1

But After upgrading to

{
  "nativescript": {
    "id": "org.nativescript.admobdemo",
    "tns-ios": {
      "version": "3.4.1"
    },
    "tns-android": {
      "version": "4.0.1"
    }
  },
  "dependencies": {
    "nativescript-admob": "^1.0.0",
    "tns-core-modules": "^4.0.0"
  },
  "devDependencies": {
    "babel-traverse": "6.8.0",
    "babel-types": "6.8.1",
    "babylon": "6.8.0",
    "filewalker": "0.1.3",
    "lazy": "1.0.11",
    "nativescript-dev-typescript": "~0.6.0",
    "typescript": "~2.6.0"
  }
}

It started showing the same errors as i've written at the beginning. ( no ads now shown)

TypeError: Cannot read property 'android' of null

Hello, I am encountering this Exception. The thing is that it doesn't happen every time.

Error:

JS:  *** NativeScriptError *** : Error: The application crashed because of an uncaught exception. You can look at "stackTrace" or "nativeException" for more detailed information about the exception.
JS:  *** StackTrace *** : An uncaught Exception occurred on "main" thread.
JS: com.tns.NativeScriptException:
JS: Calling js method run failed
JS:
JS: TypeError: Cannot read property 'android' of null
JS: File: "file:///data/data/com.antibooker.onthego/files/app/tns_modules/nativescript-admob/admob.js, line: 141, column: 35
JS:
JS: StackTrace:
JS:     Frame: function:'', file:'file:///data/data/com.antibooker.onthego/files/app/tns_modules/nativescript-admob/admob.js', line: 141, column: 36
JS:     Frame: function:'invoke', file:'file:///data/data/com.antibooker.onthego/files/app/tns_modules/tns-core-modules/timer/timer.js', line: 19, column: 48
JS:     Frame: function:'run', file:'file:///data/data/com.antibooker.onthego/files/app/tns_modules/tns-core-modules/timer/timer.js', line: 23, column: 13
JS:
JS:
JS:     at com.tns.Runtime.callJSMethodNative(Native Method)
JS:     at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1088)
JS:     at com.tns.Runtime.callJSMethodImpl(Runtime.java:970)
JS:     at com.tns.Runtime.callJSMethod(Runtime.java:957)
JS:     at com.tns.Runtime.callJSMethod(Runtime.java:941)
JS:     at com.tns.Runtime.callJSMethod(Runtime.java:933)
JS:     at com.tns.gen.java.lang.Runnable.run(Runnable.java:10)
JS:     at android.os.Handler.handleCallback(Handler.java:739)
JS:     at android.os.Handler.dispatchMessage(Handler.java:95)
JS:     at android.os.Looper.loop(Looper.java:148)
JS:     at android.app.ActivityThread.main(ActivityThread.java:5417)
JS:     at java.lang.reflect.Method.invoke(Native Method)
JS:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
JS:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
JS:  *** nativeException *** : com.tns.NativeScriptException:

I started developing the app using the tabs example.

The createBanner is called through the tabs-page.js

function onLoaded () {
    setTimeout( function() {
        admob.createBanner({
          testing: true,
          size: admob.AD_SIZE.SMART_BANNER,
          androidBannerId: "ca-app-pub-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
          margins: {
            bottom: 0
          },
          keywords: ["foo", "bar"]
        }).then(
            function() {
              console.log("admob createBanner done");
            },
            function(error) {
              console.log("admob createBanner error: " + error);
            }
        );
    }, 1500);
}

exports.onLoaded = onLoaded;

Any suggestions?

Thanks

iOS banner not displayed

I followed your directions in the nativescript-vue project and added code.
Everything is normal and i see console admob createBanner done.

But the device does not display a banner and the console says:

[1 stream, pid: 11701, url: https://googleads.g.doubleclick.net/getconfig/pubsetting?app_name=--myapp--name--&client=--my-banner--code&admob_app, tls] cancelled

After goBack navigation, admob broke the app

After topmost goBack, when calling the admob create banner again, I get this error

TypeError: Cannot read property 'addView' of null File: "/data/data/com.example.test/files/app/tns_modules/nativescript-admob/admob.js, line: 127, column: 55"

nativescript-admob: 1.1.4
nativescript: 2.0
emulator: android 6.0

onAdClosed problem

Hi, when you close app before full screen ad loaded. And when i reopen app and fullscreen ad apperas. If i close ad its returning this error.

com.tns.NativeScriptException: Calling js method onAdClosed failed
TypeError: Cannot read property 'setAdListener' of null
File: "file:///data/data/com.ttt.mmm/files/app/tns_modules/nativescript-admob/admob.js, line: 162, column: 32
StackTrace:
Frame: function:'onAdClosed', file:'file:///data/data/com.ttt.mmm/files/app/tns_modules/nativescript-admob/admob.js', line: 162, column: 33
  at com.tns.Runtime.callJSMethodNative(Native Method:0)
  at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1021)
  at com.tns.Runtime.callJSMethodImpl(Runtime.java:903)
  at com.tns.Runtime.callJSMethod(Runtime.java:890)
  at com.tns.Runtime.callJSMethod(Runtime.java:874)
  at com.tns.Runtime.callJSMethod(Runtime.java:866)
  at com.tns.gen.com.google.android.gms.ads.AdListener_fes_app_tns_modules_nativescript-admob_admob_l153_c74__.onAdClosed(com.google.android.gms.ads.AdListener.java:0)

'Error in admob.createBanner: TypeError: Cannot read property \'android\' of undefined'

Hi All,

I'm facing issue on my nativescript-vue apps.

please check my code below

<script>
    // import Vue from 'nativescript-vue';
    import { mapState } from 'vuex';
    import Vuex from 'vuex'
    import Login from '@/components/Auth/Login'
    import Header from '@/components/Header'
    import Home from '@/components/Home'
    import Footer from '@/components/Footer'
    import Searching from '@/components/Searching'
    import Account from '@/components/Account'

    const platform = require("tns-core-modules/platform");
    const application = require("tns-core-modules/application");
    const admob = require("nativescript-admob");

    export default {
        data() {
            return {
                platform: "",
                isSearching: false,
                width: 0,
                height: 0
            };
        },
        computed: {
            token(){
                return this.$store.state.token
            },
            pageIndex(){
                return this.$store.state.pageIndex
            }
        },
        methods: {
            checkAuth(){
                if(!this.$store.getters.isLoggedIn){
                    this.$navigateTo(Login)
                }
            },
            signout() {
                this.$store.dispatch('clearData')
                this.$navigateTo(Login)
            },
            toggleSearch() {
                this.isSearching = !this.isSearching;
            }
        },
        mounted() {
            this.width = platform.screen.mainScreen.widthDIPs;
            this.height = platform.screen.mainScreen.heightDIPs;
            if (application.ios) {
                this.platform = "ios";
            } else if (application.android) {
                this.platform = "android";
            }
            setTimeout( function() {
                admob.createBanner({
                    testing: true,
                    size: admob.AD_SIZE.SMART_BANNER, // anything in admob.AD_SIZE, like admob.AD_SIZE.SMART_BANNER
                    androidBannerId: "ca-app-pub-4518453906571567/7738847196", // add your own
                    margins: {
                        // if both are set, top wins
                        //top: 10
                        bottom: 50
                    },
                }).then(
                    function() {
                        console.log("admob createBanner done");
                    },
                    function(error) {
                        console.log("admob createBanner error: " + error);
                    }
                )
            }, 4000);
        },
        components: {
            Header,
            Footer,
            Home,
            Searching,
            Account
        }
    };
</script>

error message below

JS: 'Error in admob.createBanner: TypeError: Cannot read property \'android\' of undefined'
JS: 'admob createBanner error: TypeError: Cannot read property \'android\' of undefined'

i'm already tried to put timeout but no luck.

Please help me :D

Interstitial AD show only first time when navigating to another page

Hello @EddyVerbruggen i have a problem with preloadInterstitial when i first time navigate from my Home to Details Page preloadInterstitial & showInterstitial work as expected. but when i back to Home Page and renavigate to Details Page this time nothing is showing. not even my test Interstitial

// Details Page page Loaded Event
export function onPageLoaded(args: EventData) {
    preloadInterstitial({
        testing: true,
        androidInterstitialId: "ca-app-pub-3940256099942544/1033173712", 
        onAdClosed: function () { console.log("interstitial closed") }
    }).then(
        function() {
            
            // CALLED  showInterstitial when ad is preload.
            // Only work on first time called.
            setTimeout(() => {
                showInterstitialAd();
            }, 50000);

        },
        function(error) {
            console.log("admob preloadInterstitial error: " + error);
        }
    );
}


// Show Interstitial Ad
function showInterstitialAd() {
    showInterstitial().then(
        function() {
            console.log("interstitial showing");
        },
        function(error) {
            console.log("admob showInterstitial error: " + error);
        }
    )
}

Note: I called showInterstitialAd() inside preloadInterstitial promise after a long time in setTimeout()

package.json

{
  "nativescript": {
    "id": "app.xplatform.myapp",
    "tns-android": {
      "version": "5.3.1"
    },
    "tns-ios": {
      "version": "5.3.1"
    }
  },
  "dependencies": {
    "nativescript-admob": "^3.3.2",
    "nativescript-fresco": "5.2.0",
    "nativescript-theme-core": "~1.0.4",
    "nativescript-ui-listview": "^6.1.0",
    "tns-core-modules": "~5.3.0"
  }
}

Environment

λ tns doctor
√ Getting environment information

No issues were detected.
√ Your ANDROID_HOME environment variable is set and points to correct directory.
√ Your adb from the Android SDK is correctly installed.
√ The Android SDK is installed.
√ A compatible Android SDK for compilation is found.
√ Javac is installed and is configured properly.
√ The Java Development Kit (JDK) is installed and is configured properly.
√ Local builds for iOS can be executed only on a macOS system. To build for iOS on a different operating system, you can use the NativeScript cloud infrastructure.
√ Getting NativeScript components versions information...
‼ Update available for component nativescript. Your current version is 5.3.1 and the latest available version is 5.3.2.
√ Component tns-core-modules has 5.3.1 version and is up to date.
√ Component tns-android has 5.3.1 version and is up to date.
√ Component tns-ios has 5.3.1 version and is up to date.

Log

First time navigate to details page

JS: Treating this deviceId as testdevice: D8B96603C82D1318E94C52733B7D985B
JS: onAdLoaded
JS: interstitial preloaded - you can now call 'showInterstitial' whenever you're ready to do so
ActivityManager: START u0 {cmp=app.xplatform.myapp/com.google.android.gms.ads.AdActivity (has extras)} from uid 10194 and from pid 13360 on display 0
JS: interstitial showing

Second time navigate to details page

JS: Treating this deviceId as testdevice: D8B96603C82D1318E94C52733B7D985B
JS: onAdLoaded

TypeError: Cannot read property 'addView' of null

After following the installation instructions exactly, and pasting the code into the app:
`const frames = require("ui/frame");
const observableModule = require("data/observable");
const context = new observableModule.Observable();
const gestures = require("ui/gestures");
const socialShareModule = require("nativescript-social-share");
const localize = require("nativescript-localize").localize;
var admob = require("nativescript-admob");

exports.onLoaded = function (args) {
page = args.object;
page.bindingContext = context;
const swipable = page.getViewById("swipable");
swipable.on(gestures.GestureTypes.swipe, function (args) {
const swipeDirection = args.direction;
if (swipeDirection == 1) {
goToPreviousPage();
}
});

admob.createBanner({
    testing: true,
    size: admob.AD_SIZE.SMART_BANNER,
    //iosBannerId: "ca-app-pub-9517346003011652/3985369721",
    androidBannerId: "ca-app-pub-4966899845463969/8769719340",
    margins: {
        bottom: 50
    }
}).then(
    function() {
      console.log("admob createBanner done");
    },
    function(error) {
      console.log("admob createBanner error: " + error);
    }

);
};`

I get the following errors in the console:
JS: Treating this deviceId as testdevice: 7FB23882623B0AEEC636DCC0E19175C5 JS: admob createBanner done System.err: com.tns.NativeScriptException: System.err: Calling js method run failed System.err: System.err: TypeError: Cannot read property 'addView' of null System.err: File: "file:///data/data/com.greenmouseapps.rorschachtest/files/app/tns_modules/nativescript-admob/admob.js, line: 134, column: 55 System.err: System.err: StackTrace: System.err: Frame: function:'', file:'file:///data/data/com.greenmouseapps.rorschachtest/files/app/tns_modules/nativescript-admob/admob.js', line: 134, column: 56 System.err: Frame: function:'invoke', file:'file:///data/data/com.greenmouseapps.rorschachtest/files/app/tns_modules/tns-core-modules/timer/timer.js', line: 19, column: 48 System.err: Frame: function:'run', file:'file:///data/data/com.greenmouseapps.rorschachtest/files/app/tns_modules/tns-core-modules/timer/timer.js', line: 23, column: 13 System.err: System.err: at com.tns.Runtime.callJSMethodNative(Native Method) System.err: at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1088) System.err: at com.tns.Runtime.callJSMethodImpl(Runtime.java:970) System.err: at com.tns.Runtime.callJSMethod(Runtime.java:957) System.err: at com.tns.Runtime.callJSMethod(Runtime.java:941) System.err: at com.tns.Runtime.callJSMethod(Runtime.java:933) System.err: at com.tns.gen.java.lang.Runnable.run(Runnable.java:10) System.err: at android.os.Handler.handleCallback(Handler.java:751) System.err: at android.os.Handler.dispatchMessage(Handler.java:95) System.err: at android.os.Looper.loop(Looper.java:154) System.err: at android.app.ActivityThread.main(ActivityThread.java:6119) System.err: at java.lang.reflect.Method.invoke(Native Method) System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)

What am I doing wrong?

Adding a banner & tapping overview button quickly , causes exception

In my app ( also in the code itself) - we use timeout - to show the ad.

However - i've noticed a rare scenario where If I navigate (angular) to a screen which in its ngOninit has this :

 setTimeout(() =>
                       {
                           this._admobService.createBanner();
                       }, 3000);
  • if I click the Overview button ( android's most right screen button) within that 3 seconds - then I get this :

image

It's probably becuase it can't find anything to put the banner on.

Is there a check that can be made in our code - not to cause exception ?

Still issue with GoogleMobileAds.kGADSimulatorID

I'm running 1.3.2 - The test ad is shown in the emulator.
i'm using MEDIUM_RECTANGLE - Interstitial is working fine

on the phone via tns run ios it says:
ReferenceError: Metadata for "GoogleMobileAds.kGADSimulatorID" found but symbol not available at runtime.

Test on phone via Xcode: Kinda works, but doesn't show the ad.
CONSOLE LOG file:///app/pages/game/game.component.js:207:24: admob createBanner done 2017-05-28 18:40:39.133577+0200 WhoWillDrink[1361:422462] WF: === Starting WebFilter logging for process WhoWillDrink 2017-05-28 18:40:39.133639+0200 WhoWillDrink[1361:422462] WF: _userSettingsForUser mobile: { filterBlacklist = ( ); filterWhitelist = ( ); restrictWeb = 1; useContentFilter = 0; useContentFilterOverrides = 0; whitelistEnabled = 0; } 2017-05-28 18:40:39.133851+0200 WhoWillDrink[1361:422462] WF: _WebFilterIsActive returning: NO 2017-05-28 18:40:39.444167+0200 WhoWillDrink[1361:422522] <Google:HTML> You are currently using version 7.16.0 of the SDK. Please consider updating your SDK to the most recent SDK version to get the latest features and bug fixes. The latest SDK can be downloaded from http://goo.gl/iGzfsP. A full list of release notes is available at https://developers.google.com/admob/ios/rel-notes.

Any ideas?

Thanks again

a problem that cannot use showInterstitial again

Hi, Eddy

I have make the interstitial work when app is mounted using your codes.(preload... then show....)
I saw the log with onAdloaded, .... onAdClosed message. it worked perfect!
But when I tried to use a button to trigger the same code,
I only saw the onAdloaded message. no Ad shown up, no onAdClosed.
Is there any way to make showInterstitial work more than once?

Is there any improvement on the view feature?

Hi;
is it possible to add Google ads to a scrollview ? I am sure it is one of the most needed things...
It would have been great if the ads were added to the scrollview areas, not the bottom or the top, in a fixed way.

Google-Mobile-Ads-SDK (= 7.16.0) required by Podfile

Hi I just install the plugin and got this error:

Analyzing dependencies
[!] Unable to satisfy the following requirements:

- `Google-Mobile-Ads-SDK (= 7.16.0)` required by `Podfile`

None of your spec sources contain a spec satisfying the dependency: `Google-Mobile-Ads-SDK (= 7.16.0)`.

You have either:
 * out-of-date source repos which you can update with `pod repo update`.
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.

Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default.
Processing node_modules failed. Error: Command pod failed with exit code 1

Interstitial Ad not show in splash screen activity

I'm trying to integrate Interstitial Ad in splash screen activity by using this tutorial .. but the ad not loading.

can anyone tell me where is the problem please?

thanks in advance

here is my code :

public class SplashScreenActivity extends Activity {
private InterstitialAd mInterstitialAd;
        private Timer waitTimer;
    private boolean interstitialCanceled;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_splash);




 mInterstitialAd = new InterstitialAd(this);
    mInterstitialAd.setAdUnitId(getString(R.string.interstitial_full_screen));
    mInterstitialAd.setAdListener(new AdListener()


{
    @Override
    public void onAdLoaded() {
        if (!interstitialCanceled) {
            waitTimer.cancel();
            mInterstitialAd.show();
        }
    }

    @Override
    public void onAdFailedToLoad(int errorCode) {
        startHomeMain();
    }
});

waitTimer = new Timer();
waitTimer.schedule(new TimerTask() {
    @Override
    public void run() {
        interstitialCanceled = true;
        SplashScreenActivity.this.runOnUiThread(new Runnable() {
            @Override
            public void run() {
                startHomeMain();
            }
        });
    }
}, 5000);
} // end of onCreate implementation.

private void startHomeMain() {
    Intent intent = new Intent(this, HomeMain.class);
    startActivity(intent);
    finish();
}

@Override
public void onPause() {
    waitTimer.cancel();
    interstitialCanceled = true;
    super.onPause();
}

@Override
public void onResume() {
    super.onResume();
    if (mInterstitialAd.isLoaded()) {
        mInterstitialAd.show();
    } else if (interstitialCanceled) {
        startHomeMain();
    }
    }
}

The Ads do not appear when the app is downloaded from the store in iOS (also TestFlight)

I can not explain why, but the ads appear correctly on the emulator (tested many times with production and testing) but once I sent the application to the store it does not show the ads (testing through TestFlight not yet released because of the problem).
I sent the application twice so far testing different approaches without success.

Any suggestion ?, it does not affect the app also (like crash) it is just the ads do not appear.

Suggestion: preload Interstitial

Admob team contact me about policy from interstital implementation. They suggest to preload the ad first (ex: when app starts), then show on needed.

This is useful to "Rewarded mediation": https://support.google.com/admob/answer/3063564?hl=en

I have did some modification. It is not the final implementation, but It is a start.

admob.preloadInterstitial = function(arg) {
  return new Promise(function (resolve, reject) {
    try {
      var settings = admob.merge(arg, admob.defaults);
      var activity = application.android.foregroundActivity;
      admob.interstitialView = new com.google.android.gms.ads.InterstitialAd(activity);
      admob.interstitialView.setAdUnitId(settings.androidInterstitialId);

      // Interstitial ads must be loaded before they can be shown, so adding a listener
      var InterstitialAdListener = com.google.android.gms.ads.AdListener.extend({
        onAdLoaded: function () {
          var a = admob.interstitialView.isLoaded();
          resolve(a);
        },
        onAdFailedToLoad: function (errorCode) {
          reject(errorCode);
        }
      });
      admob.interstitialView.setAdListener(new InterstitialAdListener());

      var ad = admob._buildAdRequest(settings);
      admob.interstitialView.loadAd(ad);

    } catch (ex) {
      console.log("Error in admob.createBanner: " + ex);
      reject(ex);
    }
  });
};

Add Native Express Admob

After some research, I could make Admob Native Express works with your plugin. Here is a simple code:

NativesScript: 2.3.0
Runtime: Android

xml

<Page 
  xmlns="http://schemas.nativescript.org/tns.xsd" loaded="pageLoaded">
  <StackLayout>
      <Placeholder creatingView="creatingView" id="bannerView"/>
  </StackLayout>
</Page>

js

var page;
var platformModule = require("platform");
function pageLoaded(args) {
    var page = args.object;
}
var admobNative = function(object) {
    var bannerView = new com.google.android.gms.ads.NativeExpressAdView(object.args.object._context);
    var am = com.google.android.gms.ads.AdSize;
    var tamanho = new am(object.width, object.heigh);
    bannerView.setAdSize(tamanho);
    bannerView.setAdUnitId(object.unitID);
    var MyAdListener = com.google.android.gms.ads.AdListener.extend({
        onAdLeftApplication: function() {
            console.log("Click!!!!");
        }
    });

    var listener = new MyAdListener();
    bannerView.setAdListener(listener);
    var adRequest = new com.google.android.gms.ads.AdRequest.Builder();
    adRequest.addTestDevice(com.google.android.gms.ads.AdRequest.DEVICE_ID_EMULATOR);
    var requestBuild = adRequest.build();
    bannerView.loadAd(requestBuild);
    return bannerView;
}

function creatingView(args) {
    args.view = admobNative({
        args: args,
        unitID: "ca-app-pub-XXXXX", // must be NativeAdmob with correct size
        heigh: 132,
        width: 280
    });
}
exports.pageLoaded = pageLoaded;
exports.creatingView = creatingView;

Maybe you could implement it on the nativescript-admob core

Interstitial Error : Cannot read property 'getContentResolver' of undefined

Hey there,
The error message when trying to show Interstitial Twice on NativeScript version 1.7.0

JS: admob createInterstitial error: TypeError: Cannot read property 'getContentResolver' of undefined

The error Does not appear on previous versions of NativeScript.
The error Does not appear when showing Interstitial ads for the first time..It appears when trying to show ads More than once.

I have checked this on Android 4.4 and 5.0

-Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.