Replies: 7 comments 3 replies
-
This is one of the best and most used Cordova Admob plugins there is, with sometimes even more than 500 active downloads and installs per week. For me personally, I use it (and it's predecessors) for about 10 years without any big issues. Development is done slowly, but steady and I am fine with that. And if you don't like it, create it yourself or use the Community Fork. And "yes", showing and hiding is no problem. You can't destroy the instance, but you can hide it and re-generate afterwards. |
Beta Was this translation helpful? Give feedback.
-
Hello, thank you very much for your answer. Please don't get me wrong: I am very grateful for this plugin. I really am. I just can't seem to get it to work completely. It's exasperating. I mean, I manage to get at least one banner to show everywhere - but capitulate when I want it to disappear and reappear. If you've been using this for 10 years - you obviously know your way around the plugin really well. Could you help me find the mistakes I'm making? I would also pay you something. [email protected] |
Beta Was this translation helpful? Give feedback.
-
I can't help you with your specific code / problem. But for me For the record; I do use the "old" version of this plug-in, not the bèta version (since it's bèta and not overall stable). Also I use the https://github.com/EYALIN/community-admob-plus I only work with Cordova / Android and all my apps are SPA : single page application ( I only have one banner, which I can show, or hide. When I try to ad another one, it's stacked on top of the previous banner (which I don't want). If things are not working for you, consider another plugin, based (in the mindset) on the one you are using right now; https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob P.S. Yeah, it's quit silent here in the discussion topic. |
Beta Was this translation helpful? Give feedback.
-
SPA... I see. And a single banner. Ok. That's what I'm doing now (had 15 unitIDs before) I'm really pleased that someone has come forward. Thank you once again. On last thing... do you initialize the plugin (the plugin DeviceReady code) in MainAcitivity or are you using this admob code from the Google Developers page
in MainActivity.java ? I suppose, you're using modals and iframes in your SPA? I'm also using pages with modals. And my intention was hiding the banner on one certain modal with Youtube-video. But the hidebanner function did not work. So I created a iframe and later a seperate html page which I wanted to use as a overlay with a background-color but they didn't work either. Is there a possibility in javascript to force a banner to be invisible? Maybe with a hack to position the banner outside the screen an d hide it with overflow: hidden? |
Beta Was this translation helpful? Give feedback.
-
I have those ads;
Each (of course) with it's own #ID. But I have only one instance of each, not multiple. But you can request as many reward-ads as you want, for example. One sees the reward, closes it, get rewarded and can request a new reward-ad, using the same ID. And banner you can show, or hide withing the same ID (it's updating every minute or so to show another ad). You can bind a single ID to the internal ID of the ad (which is set by Google) and see that in the stats of things like Firebase / Google Analytics. So for me, it's working : I don't want multiple unique banners, one is enough for me (and I can show it, hide it and "read" the stats based on it's internal ID). Regarding you Java-code, I don't write, use or even touch Java-code. I am writing all my apps as HTML-apps, and debug them in my browser. And I use Cordova to wrap in into a real app (the APK-file), so I can communicate with some basic Android API's. I don't use Android Studio, or something like a "real" IDE. I work in Visual Studio Code, with is like a text-editor on steroids. I simply start a new Cordova project, add the Admob plugin (the latest stable version) and initialize it on All debugging and development is done in the browesr; just hit F12 to see the console, set a responsive size for your "app" and away you go. Be aware : AdMob will NOT work in the browser; you need the "real" Android app for that part (on an emulator or real device).
(of course my code is more complex, but in the basic this is it) That's it, I never do anything using Java (the above is Javascript, not Java). O, I don't use iFrames (but can embed Youtube with the default HTML-code, which will show the movie inside an Iframe). And I use Bootstrap for the styling-framework, that comes with modals.
When I add this in my page, it's shown in the app. Afterall Cordova is just HTML / CSS and JS. |
Beta Was this translation helpful? Give feedback.
-
Thank you for the explanations. Yes, I understand. It's the same for me: I also develop with html-css-javascript in VSC and compile the result in cordova, where I insert the admob plugin. Then I import the project into Android Studio and edit it there - exactly as you described. However, I only use banners. I have also compiled native apps in Java in AS - but I haven't worked much with the admob implementation yet. I'm currently in the process of learning it - because the structure and implementation are quite simple. Like VSC, AS also has a preview function next to it in the layout window, where you can see the changes simultaneously. Testing on a real device is also lightning fast. My tendency is already towards native apps in AS - although I would definitely also like to integrate Javascript. There are also a number of Java animation options - but I don't want to do without the many great js libraries. |
Beta Was this translation helpful? Give feedback.
-
AS = Android Studio. But I used a small amount of Action Script in Flash projects years ago. - till Steve Jobs killed the flash plugin. Of course you don't have to use Android Studio to compile apps. But I am also very interested in using it. At the moment I still use VSC and cordova CLI as a basis and make additions in AS. But I consider engines like Ct.js, Godot, renpy or Defold - from which you can compile apps directly - to be very interesting. |
Beta Was this translation helpful? Give feedback.
-
After the problems I have with implementation and the fact that there is little or no help to be found on the web, I assume that very few people are using the plugin. Most of them will most likely have had the same experience as me. That they try and ultimately fail. So I have no choice but to implement Admob directly in Android Studio and do without the plugin. How many of you have successfully used the plugin? I mean with full control in terms of showing and hiding? I guess not many.
Beta Was this translation helpful? Give feedback.
All reactions