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

Reward video don't show #45

Open chinatjnet opened 7 years ago

chinatjnet commented 7 years ago

It's ok for banner and interstitial, but no use with rewardVideo ads. I have added inmobi to Admob. Should I add inmobi adapter to it?

warcry2000 commented 7 years ago

Hello, You need an adapter and InMobi sdk. Look here: https://firebase.google.com/docs/admob/android/mediation-networks

ratson commented 7 years ago

@chinatjnet Yes, you could try cordova-admob-inmobi

warcry2000 commented 7 years ago

@ratson In this plugin I see src/android/libadapterinmobi.jar But the src folder does not exist.

In addition to the adapter, should the sdk be included?

rebrandsoftware commented 7 years ago

I think the SDK has to be included, and it's not in the repository linked above, neither are the android manifest or iOS plist configurations listed as required by InMobi.

To get around that problem I created an InMobi mediation plugin here: cordova-plugin-admob-mediation-inmobi which I am trying to use with cordova-plugin-admob-free. It includes the SDK and config files. Please have a look at it and let me know if it looks correct to you (it is my first attempt at a mediation plugin). When using it, I'm having trouble determining whether videos are coming from InMobi or AdMob, and I don't know if InMobi shows statistics on requests when in test mode. In other words, it's very difficult to know for sure that it's working before turning off test mode.

warcry2000 commented 7 years ago

Hello @rebrandsoftware Do you need the adapter in your plugin? https://firebase.google.com/docs/admob/android/mediation-networks

In Performance reports in admob you can see:

vintage commented 7 years ago

@ratson @warcry2000 It seems it's impossible to install the inmobi mediation plugin:

$ cordova plugin add cordova-admob-inmobi
Installing "cordova-admob-inmobi" for android
Error during processing of action! Attempting to revert...
Failed to install 'cordova-admob-inmobi':Error
    at copyFile (/Users/kamilrykowski/workspace/party_game/platforms/android/cordova/lib/pluginHandlers.js:219:36)
    at copyNewFile (/Users/kamilrykowski/workspace/party_game/platforms/android/cordova/lib/pluginHandlers.js:250:5)
    at install (/Users/kamilrykowski/workspace/party_game/platforms/android/cordova/lib/pluginHandlers.js:43:17)
    at ActionStack.process (/Users/kamilrykowski/workspace/party_game/platforms/android/cordova/node_modules/cordova-common/src/ActionStack.js:56:25)
    at PluginManager.doOperation (/Users/kamilrykowski/workspace/party_game/platforms/android/cordova/node_modules/cordova-common/src/PluginManager.js:117:20)
    at PluginManager.addPlugin (/Users/kamilrykowski/workspace/party_game/platforms/android/cordova/node_modules/cordova-common/src/PluginManager.js:147:17)
    at /Users/kamilrykowski/workspace/party_game/platforms/android/cordova/Api.js:254:18
    at _fulfilled (/Users/kamilrykowski/workspace/party_game/platforms/android/cordova/node_modules/q/q.js:834:54)
    at self.promiseDispatch.done (/Users/kamilrykowski/workspace/party_game/platforms/android/cordova/node_modules/q/q.js:863:30)
    at Promise.promise.promiseDispatch (/Users/kamilrykowski/workspace/party_game/platforms/android/cordova/node_modules/q/q.js:796:13)
Error: Uh oh!
"/Users/kamilrykowski/workspace/party_game/plugins/cordova-admob-inmobi/src/android/libadapterinmobi.jar" not found!

I don't really also understand how could it work, as there is nothing interesting in the plugin directory itself - https://github.com/rehy/cordova-admob-mediation/tree/master/packages/cordova-admob-inmobi

@rebrandsoftware I've tried to install your plugin. It installed without any errors, so I've tried to run it on iOS using:

engine.rewardvideo.config({
        id: reward,
        isTesting: true,
        autoShow: true
      });
engine.rewardvideo.prepare();

But nothing shown up. In the xcode I've received following error/warning:

2017-02-21 13:00:18.973802 Zgadula[6553:2125243] createRewardVideo
2017-02-21 13:00:18.973998 Zgadula[6553:2125243] __cycleRewardVideo
2017-02-21 13:00:20.295810 Zgadula[6553:2125243] interstitial did fail with error=Server returned a no-fill. Please try again.
2017-02-21 13:00:20.295959 Zgadula[6553:2125243] error code=1

Is anyone using the inmobi plugin in their app?

vintage commented 7 years ago

Small update - It seems that I didn't properly enabled reward videos in the Admob dashboard. After connecting inmobi account credentials I've been able to see the ads. Seems to work with the https://github.com/rebrandsoftware/cordova-plugin-admob-mediation-inmobi/

Additionally I've just received an email that Admob would be able to present reward videos without any ad mediation provider (builtin reward videos from Admob). It's a really good news, as it should be able from now to display some reward videos without extra plugins (I'm still going to use inmobi for mediation).

pinikynet commented 7 years ago

Dear @ratson I use only Admob Network. for Android when I use cordova-admob-sdk , I see only black screen for Rewarded video and some error. in plugin.xml

 <platform name="android">
        <framework src="com.google.android.gms:play-services-base:+" />
        <framework src="com.google.android.gms:play-services-ads:+" />
    </platform>

in android SDK Manager I updated this image

and I add https://github.com/cranberrygame/cordova-plugin-extras-google-play-services plugin Real Device Android 4.1.2 works fine. Thanks @ratson . Sorry for my English. in plugin.xml

`<platform name="android">
    <config-file target="AndroidManifest.xml" parent="/manifest/application">
        <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
    </config-file>

    <framework src="com.google.android.gms:play-services-games:+" />
    <framework src="com.google.android.gms:play-services-plus:+" />
    <framework src="com.google.android.gms:play-services-ads:+" />
  </platform>`
ratson commented 7 years ago

@pinikynet Which mediation library are you using?

pinikynet commented 7 years ago

@ratson I use only Admob without extra plugins or mediation library.

PrithiviRajG commented 6 years ago

After adding mediation plugins also I am not able to see reward Video but I am able to see 'Ad displayed' log from the console (using the below code)

 this.admobFree.rewardVideo.show().then((ad)=>{
      console.log("Ad displayed");
      console.log(ad);
    }).catch((e)=>{
      console.log("Ad display exception");
      console.log(e);
    });
angelbuzon commented 6 years ago

first of all: congratulations on the plugin, it's great ;)

My problem is with the rewarded-videos, i am using only Admob network. I had create a reward ad on my Admob panel. When i run admob.rewardvideo.prepare() i only get a LOAD_FAIL event.

I have made several combinations of plugins (thanks @pinikynet ). This is what I have now. but nothing, i can not make it work.

my plugins list: cordova-admob-sdk 0.8.0 "AdMob SDK" cordova-plugin-admob-free 0.10.0 "Cordova AdMob Plugin" cordova-plugin-admob-mediation-facebook 1.2.4 "AdMob Mediation Adapter for Facebook Audience Network" cordova-plugin-extras-google-play-services 1.0.5 "Google Play Services for Android"

Is there anyone who can run the rewarded video ads?

UPDATE: Hi. Now the video reward works. I think you have to wait a few minutes from creating the Ad reward on the Admob console until the video is functional. Anyway I will continue testing with a clean compilation.

sksk008 commented 5 years ago

@angelbuzon CAN YOU PLZ SHARE YOUR CODE ??for reward video.