Giter VIP home page Giter VIP logo

Comments (7)

EddyVerbruggen avatar EddyVerbruggen commented on June 18, 2024 1

I've now fixed that iOS issue regarding GoogleMobileAds.kGADSimulatorID. Just released 3.2.0 which includes this fix.

While testing on a real Android device, and going through a "preload interstitial" --> "show interstitial" ---> "preload..." loop it showed a different Ad every time, so can't reproduce that. Perhaps update your Play Services SDK (via Android Studio) to the latest version.

from nativescript-admob.

lin-brian-l avatar lin-brian-l commented on June 18, 2024

I am running into this issue as well. My package.json contains the following:

{
  "nativescript": {
    "id": "<my-app-id>",
    "tns-android": {
      "version": "4.2.0"
    },
    "tns-ios": {
      "version": "4.2.0"
    }
  },
  "description": "NativeScript Application",
  "license": "SEE LICENSE IN <your-license-filename>",
  "repository": "<fill-your-repository-here>",
  "dependencies": {
    "@angular/animations": "~6.1.0",
    "@angular/common": "~6.1.0",
    "@angular/compiler": "~6.1.0",
    "@angular/core": "~6.1.0",
    "@angular/forms": "~6.1.0",
    "@angular/http": "~6.1.0",
    "@angular/platform-browser": "~6.1.0",
    "@angular/platform-browser-dynamic": "~6.1.0",
    "@angular/router": "~6.1.0",
    "@ngrx/store": "^6.1.2",
    "moment": "^2.22.2",
    "nativescript-admob": "^3.1.0",
    "nativescript-angular": "~6.1.0",
    "nativescript-animated-circle": "^1.1.0",
    "nativescript-background-http": "^3.3.0",
    "nativescript-camera": "^4.0.3",
    "nativescript-carousel": "^4.0.2",
    "nativescript-checkbox": "^3.0.3",
    "nativescript-facebook": "^2.2.4",
    "nativescript-geolocation": "^4.3.1",
    "nativescript-google-maps-sdk": "^2.6.1",
    "nativescript-imagepicker": "^6.0.4",
    "nativescript-iqkeyboardmanager": "^1.3.0",
    "nativescript-plugin-firebase": "^7.3.0",
    "nativescript-stripe": "^5.0.1",
    "nativescript-theme-core": "~1.0.4",
    "nativescript-ui-listview": "^3.7.1",
    "nativescript-ui-sidedrawer": "^4.3.1",
    "nativescript-web-image-cache": "^4.2.6",
    "number-abbreviate": "^2.0.0",
    "reflect-metadata": "~0.1.8",
    "rxjs": "^6.3.3",
    "rxjs-compat": "^6.3.3",
    "tns-core-modules": "^4.2.1",
    "zone.js": "^0.8.26"
  },
  "devDependencies": {
    "@angular/compiler-cli": "~6.1.0",
    "@ngtools/webpack": "~6.2.0",
    "babel-traverse": "6.26.0",
    "babel-types": "6.26.0",
    "babylon": "6.18.0",
    "lazy": "1.0.11",
    "nativescript-dev-sass": "^1.6.0",
    "nativescript-dev-typescript": "~0.7.0",
    "nativescript-dev-webpack": "^0.16.2",
    "typescript": "~2.7.2"
  },
  "readme": "NativeScript Application"
}

tns doctor shows that my non-Nativescript configurations are fine, and it says the following with regards to potential updates:

⚠ Update available for component nativescript. Your current version is 4.2.4 and the latest available version is 5.0.1.
⚠ Update available for component tns-core-modules. Your current version is 4.2.1 and the latest available version is 5.0.2.
⚠ Update available for component tns-android. Your current version is 4.2.0 and the latest available version is 5.0.0.
⚠ Update available for component tns-ios. Your current version is 4.2.0 and the latest available version is 5.0.0.

However, given that Nativescript 5.0 is so new, I did not think that I would have to upgrade in order for this plugin to work. Do you have any ideas of what could be happening?

from nativescript-admob.

EddyVerbruggen avatar EddyVerbruggen commented on June 18, 2024

N5 is not required. Does the demo app work for you? And is it similar on borg platforms?

from nativescript-admob.

lin-brian-l avatar lin-brian-l commented on June 18, 2024

@EddyVerbruggen Thank you for the quick reply, unfortunately I didn't get the chance to test this today. I'll double-check the demo app on Monday and let you know. I'm not sure what you mean by "borg" platforms though, can you elaborate?

from nativescript-admob.

EddyVerbruggen avatar EddyVerbruggen commented on June 18, 2024

Typo, sorry: BOTH 😬

from nativescript-admob.

lin-brian-l avatar lin-brian-l commented on June 18, 2024

Hi Eddy,

Thanks for your patience - I downloaded the master branch's demo app and tested preoloading and showing interstitial ads on an iOS emulator, iOS device, and Android device.

  • Preloading interstitial ads on iOS emulator worked as expected and I was able to view multiple ads.
  • Interstitial ads on an iOS device raises the error ReferenceError: Metadata for "GoogleMobileAds.kGADSimulatorID" found but symbol is not available at runtime.. This issue is probably the same as raised in issue 22.
  • Preloading and showing (as well as creating and showing) interstitial ads on an Android device works the first time, but subsequent attempts lead to the same issue that I ran across in my own project. In the doPreloadInterstitial() function, I modified it slightly to add console.log statements:
  doPreloadInterstitial(): void {
    console.log("preloading interstitial");
    preloadInterstitial({
      testing: true,
      iosInterstitialId: "ca-app-pub-9517346003011652/6938836122",
      androidInterstitialId: "ca-app-pub-9517346003011652/6938836122",
      onAdClosed: () => this.message = "Interstitial closed"
    }).then(() =>  {
        console.log("interstitial preloaded ***********************************");
        this.message = "Interstitial preloaded";
    }, error => this.message = "Error preloading interstitial: " + error
    )
  }

In the console, here's what logs:

JS: preloading interstitial
JS: Treating this deviceId as testdevice: 5954B2A4519564FA61BBCC8FC5268465
chromium: [INFO:library_loader_hooks.cc(36)] Chromium logging enabled: level = 0, default verbosity = 0
11-19 09:27:19.767  9468  9468 I cr_BrowserStartup: Initializing chromium process, singleProcess=false
JS: onAdLoaded
JS: interstitial preloaded ***********************************
JS: preloading interstitial
JS: Treating this deviceId as testdevice: 5954B2A4519564FA61BBCC8FC5268465
JS: onAdLoaded

I don't have experience developing in Android, but perhaps some process required to trigger ads (11-19 09:27:19.767 9468 9468 I cr_BrowserStartup: Initializing chromium process, singleProcess=false) is not being re-run upon subsequent attempts to load interstitial ads. Do you have any hints as to what's going on?

from nativescript-admob.

lin-brian-l avatar lin-brian-l commented on June 18, 2024

Hey Eddy, thanks for the quick update! I ran the most recent version of the demo and confirmed that interstitial ads are showing on my iOS device -thank you for resolving this.

I also tried my Android device (without updating the Play Services SDK) and, although it seems like the contents of the preloaded callback function aren't being executed (this.message is stuck at 'Interstitial closed' even after loading), I am able to hit "Show Interstitial" and see a new ad. I have a (hacky) solution for my problem now though, thanks for your help!

from nativescript-admob.

Related Issues (20)

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.