ratson / cordova-plugin-admob-free

New development has been moved to "admob-plus-cordova", https://github.com/admob-plus/admob-plus/tree/master/packages/cordova
https://github.com/admob-plus/admob-plus
MIT License
499 stars 214 forks source link

Break after add #26

Closed davidvazteixeira closed 7 years ago

davidvazteixeira commented 7 years ago

Hi,

One line: After install, the main "ready" callback is not called.

Situation: Using Ionic, I'm migrating from "sunny" to yours. I did:

1) cordova plugin remove cordova-plugin-admob-simple 2) cordova plugin add cordova plugin add cordova-plugin-admob-free 3) cordova platform remove android 4) cordova platform add android 5) => insert an "alert" in the start of "ready" callback of device 6) ionic run android

The ready call back isn't called.

I'm sorry to not show any error log but I have small experience with android SDK. You can ask anything and I'll try to find.

P.S.: The sunny plugin was "working". The replace is for the average malfuncion of the plugin (adshare and to much ad download errors)

vintage commented 7 years ago

Do alert() function works on real devices? I'm not sure about it. Better approach to check if the ready event is called is to put console.log. You can debug it using https://developers.google.com/web/tools/chrome-devtools/remote-debugging/

davidvazteixeira commented 7 years ago

@vintage, this trick maybe help bu i'm using VirtualBox and not a real device.


alert works in "run", but do not works in "ready" first line.


But first, let's me write this:

I started a brand new project and used the "example". Not working, but in "ionic serve" I got this on console:

Refused to execute inline script because it violates the following Content Security Policy directive: "default-src 'self' data: gap: https://ssl.gstatic.com 'unsafe-eval'". Either the 'unsafe-inline' keyword, a hash ('sha256-gpnLwpFw97DB28/JjA3G79AHgq5DtCgFiFwjahrA1d4='), or a nonce ('nonce-...') is required to enable inline execution. Note also that 'script-src' was not explicitly set, so 'default-src' is used as a fallback.

EDIT:

This error has some with livereload. I disabled it and the error is gone, but the ad still do not show.

davidvazteixeira commented 7 years ago

A have some news.

After a talk, we found that the Android version is main problem. The same code breaks with 4.2.x but runs with 6.x (i.e. the ready callback goes fine). This is a sensible point because of today marketshare.

You wrote that this project is a fork from sunny, with removed adshare, but there is some "new updated code" under the hoody. Sunny works.

vintage commented 7 years ago

@davidvazteixeira : Do you use crosswalk for older Android versions?

davidvazteixeira commented 7 years ago

I updated for crosswalk only after your tip for chrome debuging.

davidvazteixeira commented 7 years ago

I tried many VMs here. Without change the app code:

5.0 runs (no break) but do not show ads. 5.1 runs (no break) but do not show ads. 6.0 runs and shows interstitial

vintage commented 7 years ago

@davidvazteixeira can you paste your ionic info?

oangelo commented 7 years ago

I am working with @davidvazteixeira and I am also experiencing the exact same problem... Here is my ionic info:

$ ionic info
Cordova CLI: 6.4.0 
Ionic CLI Version: 2.1.7
Ionic App Lib Version: 2.1.4
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Linux 4.4
Node Version: v7.0.0
Xcode version: Not installed ```
davidvazteixeira commented 7 years ago

I will send mine too:

Cordova CLI: 5.4.1 Gulp version: CLI version 3.9.0 Gulp local: Local version 3.9.0 Ionic Version: 1.3.1 Ionic CLI Version: 1.7.14 Ionic App Lib Version: 0.7.0 OS: Distributor ID: Ubuntu Description: Ubuntu 16.04.1 LTS Node Version: v6.9.1

oangelo commented 7 years ago

I've managed to put the plugin to work in different Android versions using Crosswalk. Is Crosswalk mandatory? If it is, I would like to suggest to add this as a dependency or, at least, this should be mentioned at the README.mk.

ratson commented 7 years ago

@davidvazteixeira @oangelo The latest version should emit more compatible code for old devices. Let me know if your problem solve. Crosswalk is not mandatory by design, I am wondering why it fixes your problem.

ratson commented 7 years ago

Since there is no updates, closing this.