Ultimate Ads - AdMob for C2 and C3 (Plugins)

Discuss Scirra's 2D Asset Store

Post » Mon Mar 19, 2018 6:39 pm

I did and its not working... Not showing the ads :( Also i added the permision of network status on the androidmanifest.xml and the dependencies of google ads... I am using android studio to test the apk on my cellphone
<?xml version="1.0" encoding="UTF-8"?>

-<widget xmlns:cdv="http://cordova.apache.org/ns/1.0" xmlns="http://www.w3.org/ns/widgets" version="1.0.0.0" id="com.mycompany.myapp" android-versionCode="1000000">


-<feature name="InAppBrowser">

<param name="android-package" value="org.apache.cordova.inappbrowser.InAppBrowser"/>

</feature>


-<feature name="Whitelist">

<param name="android-package" value="org.apache.cordova.whitelist.WhitelistPlugin"/>

<param name="onload" value="true"/>

</feature>

<name>Juego Uno</name>

<description>testeo</description>

<author href="http://"/>

<allow-intent href="http://*/*"/>

<allow-intent href="https://*/*"/>

<icon width="256" src="www/icons/icon-256.png" height="256" density="xxxhdpi"/>

<icon width="128" src="www/icons/icon-128.png" height="128" density="xhdpi"/>

<icon width="114" src="www/icons/icon-114.png" height="114"/>

<icon width="32" src="www/icons/icon-32.png" height="32"/>

<icon width="16" src="www/icons/icon-16.png" height="16"/>

<access origin="*"/>

<preference name="loglevel" value="DEBUG"/>

<preference name="orientation" value="portrait"/>

<preference name="fullscreen" value="false"/>

<preference name="DisallowOverscroll" value="true"/>

<preference name="android-minSdkVersion" value="22"/>

<preference name="android-targetSdkVersion" value="23"/>

<plugin name="cocoon-plugin-ads-android-admob"/>

</widget>
B
11
S
4
G
4
Posts: 55
Reputation: 2,875

Post » Mon Mar 19, 2018 11:57 pm

I did the admob guide using the ad id in the guide and here is what its on my mainactivity.java
package com.mycompany.myapp;

import android.os.Bundle;
import org.apache.cordova.*;
import com.google.android.gms.ads.MobileAds;

public class MainActivity extends CordovaActivity
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
MobileAds.initialize(this,"ca-app-pub-3940256099942544~3347511713");

// enable Cordova apps to be started in the background
Bundle extras = getIntent().getExtras();
if (extras != null && extras.getBoolean("cdvStartInBackground", false)) {
moveTaskToBack(true);
}

// Set by <content src="index.html" /> in config.xml
loadUrl(launchUrl);
}
}
B
11
S
4
G
4
Posts: 55
Reputation: 2,875

Post » Wed Mar 21, 2018 3:40 am

@GabrielIq What do you use to wrap the final game? PhoneGap, Cocoon, C3 wrapper or commandline Cordova?
ImageImageImage
B
45
S
23
G
89
Posts: 1,100
Reputation: 50,611

Post » Wed Mar 21, 2018 3:45 am

Toby R wrote:@GabrielIq What do you use to wrap the final game? PhoneGap, Cocoon, C3 wrapper or commandline Cordova?

Its exported from C3 on android cordoba,debug apk. I did export for android studio project too, to try to modify the gradle for ads, but still not working.
Trying to test all the ways.

With the default mobile advert plugin i can see the test ads, but not with the Ultimate ads plugin....
B
11
S
4
G
4
Posts: 55
Reputation: 2,875

Post » Wed Mar 21, 2018 3:55 am

GabrielIq wrote:
Toby R wrote:@GabrielIq What do you use to wrap the final game? PhoneGap, Cocoon, C3 wrapper or commandline Cordova?

Its exported on android cordoba,debug apk. I did export for android studio project too. Trying to test all the ways.

With the default mobile advert plugin i can see the test ads, but not with the Ultimate ads plugin....


Alright so if you do it directly with Cordova then please do not add the XML part manually. Instead please run the following command from the command line.
Code: Select all
cordova plugin add cocoon-plugin-ads-android-admob


This will add the plugin to your project and make the required references. Let me know if it worked for you please.
ImageImageImage
B
45
S
23
G
89
Posts: 1,100
Reputation: 50,611

Post » Wed Mar 21, 2018 4:02 am

Toby R wrote:
GabrielIq wrote:
Toby R wrote:@GabrielIq What do you use to wrap the final game? PhoneGap, Cocoon, C3 wrapper or commandline Cordova?

Its exported on android cordoba,debug apk. I did export for android studio project too. Trying to test all the ways.

With the default mobile advert plugin i can see the test ads, but not with the Ultimate ads plugin....


Alright so if you do it directly with Cordova then please do not add the XML part manually. Instead please run the following command from the command line.
Code: Select all
cordova plugin add cocoon-plugin-ads-android-admob


This will add the plugin to your project and make the required references. Let me know if it worked for you please.


Excuse me for my ignorance, Wich command line in construct 3?
If is my own command line, wich are the previous commands before the add plugin section?
I never installed a plugin by command, and there is no guide on the forum
B
11
S
4
G
4
Posts: 55
Reputation: 2,875

Post » Wed Mar 21, 2018 4:28 am

GabrielIq wrote:Excuse me for my ignorance, Wich command line in construct 3?
If is my own command line, wich are the previous commands before the add plugin section?


I'm sorry I misunderstood you. It's 5 am here I'm a bit tired. I thought you mean that you made it with Cordova CLI... alright so please do not build the APK directly in C3. Instead during export to Android cordova, you will have an option to download the project zipped. Then open the config.xml, enter the XML part we talked about earlier "<plugin..." and save the config.xml.

Now you can zip it and wrap with PhoneGap for instance. Maybe you can also upload it back to C3 system? I don't know because I never tested it with C3 APK builder and never wrote it works there as Scirra restricts not their plugins for whatever reason (since other service providers do not). But you can try.

Basically, you have several choices:
- you can do as I said with downloading the zip and editing config.xml and then using Phonegap
- you can download that zip and use Cocoon (it's a bit different approach, please see the video tutorial and this one)
- you can download and edit the zip and try to upload it back to C3 and make an APK there (I haven't tried that)
- you can use Cordova CLI, but that's rather for advanced users

Actually, all I'm explaining here is also covered in the video tutorials I prepared for this plugin. So please try any of the approaches I listed and It will work. I am going off to bed, so if you'll need any further assistance I should be online tomorrow.
ImageImageImage
B
45
S
23
G
89
Posts: 1,100
Reputation: 50,611

Post » Wed Mar 21, 2018 5:21 am

i modified the config.xml like you said, adding the plugin and still not working
<?xml version='1.0' encoding='utf-8'?>
<widget android-versionCode="1000000" id="com.avisos.miavisos" version="1.0.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<feature name="ConstructAd">
<plugin name="cocoon-plugin-ads-android-admob" spec="~1.0.6" />
<param name="android-package" value="com.scirra.ConstructAd" />
</feature>
<feature name="Whitelist">
<param name="android-package" value="org.apache.cordova.whitelist.WhitelistPlugin" />
<param name="onload" value="true" />
</feature>
<name>adstertes</name>
<description>avisos</description>
<author />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<icon density="xxxhdpi" height="512" src="www/icons/icon-512.png" width="512" />
<icon height="256" src="www/icons/icon-256.png" width="256" />
<icon density="xhdpi" height="128" src="www/icons/icon-128.png" width="128" />
<icon density="mdpi" height="64" src="www/icons/icon-64.png" width="64" />
<icon height="32" src="www/icons/icon-32.png" width="32" />
<icon height="16" src="www/icons/icon-16.png" width="16" />
<access origin="*" />
<preference name="loglevel" value="DEBUG" />
<preference name="orientation" value="portrait" />
<preference name="fullscreen" value="false" />
<preference name="DisallowOverscroll" value="true" />
<preference name="android-minSdkVersion" value="21" />
<preference name="android-targetSdkVersion" value="23" />
</widget>
B
11
S
4
G
4
Posts: 55
Reputation: 2,875

Post » Wed Mar 21, 2018 6:00 pm

GabrielIq wrote:i modified the config.xml like you said, adding the plugin and still not working


Please be more precise. Not working using which wrapper? PhoneGap? Cocoon? C3? What have you tried?

Also, I don't know what's the ConstructAd feature. Are you using both C3 and Ultimate Ads plugins?
Code: Select all
<feature name="ConstructAd">
<plugin name="cocoon-plugin-ads-android-admob" spec="~1.0.6" />
<param name="android-package" value="com.scirra.ConstructAd" />
</feature>


Please put this line
Code: Select all
<plugin name="cocoon-plugin-ads-android-admob" />


After some "<preference " line. Not in the "<feature ", that's also in the video tutorial.
ImageImageImage
B
45
S
23
G
89
Posts: 1,100
Reputation: 50,611

Post » Wed Mar 21, 2018 7:22 pm

Toby R wrote:
GabrielIq wrote:i modified the config.xml like you said, adding the plugin and still not working


Please be more precise. Not working using which wrapper? PhoneGap? Cocoon? C3? What have you tried?

Also, I don't know what's the ConstructAd feature. Are you using both C3 and Ultimate Ads plugins?
Code: Select all
<feature name="ConstructAd">
<plugin name="cocoon-plugin-ads-android-admob" spec="~1.0.6" />
<param name="android-package" value="com.scirra.ConstructAd" />
</feature>


Please put this line
Code: Select all
<plugin name="cocoon-plugin-ads-android-admob" />

After some "<preference " line. Not in the "<feature ", that's also in the video tutorial.


I did a simple project with 3 text objects being changed with a int goblal variable and 1 touch object to show video,to test the 3 different type of ads with ultimateads and mobile advert to see if was my mistake on some kind of event or action, but i did all integration ads on your videos.
Its on C3, and as u said, i did an android export project, open the config xml, and adding the plugin, and this time is after the preference, but still not showing ads...
Its posible to update your plugin Ultimate ads on the future please?, because mobile advert is working, but your addon has a lot of more features, just like adding the banner on the top, on finished video and more..
B
11
S
4
G
4
Posts: 55
Reputation: 2,875

PreviousNext

Return to Scirra Store

Who is online

Users browsing this forum: No registered users and 2 guests