Comments (7)
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.
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.
N5 is not required. Does the demo app work for you? And is it similar on borg platforms?
from nativescript-admob.
@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.
Typo, sorry: BOTH 😬
from nativescript-admob.
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 addconsole.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.
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)
- Unable to apply changes on device: . Error is: Socket connection timed out.. HOT 1
- Hardcoding Symbols HOT 3
- Native ads support HOT 1
- Banner disappears HOT 4
- Ads immersive mode support
- Ads not showing HOT 2
- App crash when going back: The specified child already has a parent. You must call removeView() on the child's parent first. HOT 1
- set: request.testDevices = @[ @"6a08b8cca00a33ad944a728ea4114fc5" ] HOT 9
- nativescript-admob for NS Vue HOT 1
- Adds not showing in other views HOT 1
- ITMS-90809: Deprecated API Usage - New apps that use UIWebView are no longer accepted HOT 3
- Getting the height of the SMART_BANNER HOT 3
- Error: java.lang.NullPointerException: Context cannot be null HOT 2
- only preloadRewardedVideoAd working but other don't working
- Violation of Interfering with Apps, Third-party Ads, or Device Functionality policy
- Error In TNS Preview - ReferenceError: Can't find variable: GADInterstitialDelegate HOT 2
- Just Testing: Fails on Interstitial BUT Banner and Video works! HOT 2
- How to show Banner ad in iOS Modal? (Error in admob.createBanner: Error: +[UIView addSubview:]: unrecognized selector sent to class 0x7fff86f5e4a0)
- Admob Rewarded video stuck on Test Mode on all ads even under production HOT 1
- It doesn't work with Android 11 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nativescript-admob.