cordova-plugin-metkasu-admob 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/README.md +4 -2
- package/package.json +29 -6
- package/plugin.xml +8 -8
- package/src/android/AdsPolicy.java +3 -3
- package/tests/controller.test.cjs +2 -0
- package/www/controller.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# 0.1.1
|
|
2
|
+
|
|
3
|
+
- Fix Cordova installation: remove a preference accidentally requiring an ANDROID-MINSDKVERSION install variable. Android 13+ platform minimums and the existing Gradle SDK checks remain enforced.
|
|
4
|
+
- Declare AD_ID explicitly under the Android manifest root.
|
|
5
|
+
- Use the standard Cordova Android Java source target directory.
|
|
6
|
+
- Suspension, demo-only testing, reward deduplication and SDK versions unchanged.
|
|
7
|
+
|
|
1
8
|
# 0.1.0
|
|
2
9
|
|
|
3
10
|
- Fail-closed SUSPENDED policy and native TEST-only guard.
|
|
@@ -5,3 +12,5 @@
|
|
|
5
12
|
- SDK-managed rewarded buffer of two; interstitial buffer of one; explicit banner display with reserved WebView margin.
|
|
6
13
|
- Request/scene/placement-scoped reward receipts, once-only consumption, no reward on dismissal.
|
|
7
14
|
- Pending publication and GDevelop cloud/Android-device validation.
|
|
15
|
+
|
|
16
|
+
0.1.1 owner clarification: normal PRODUCTION configuration is supported. UI visibility is managed independently by the GDevelop facade; no date-based toggle. Valid app/unit IDs, release/test boundaries and UMP are still required.
|
package/README.md
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
> 0.1.1: Production is supported with explicit valid IDs and release configuration, as requested by the owner. UI visibility is separate. The older hard production lock described below is superseded. METKASU_ADMOB_APP_ID has a default and can be overridden at Cordova installation; it is not a secret.
|
|
2
|
+
|
|
3
|
+
# cordova-plugin-metkasu-admob 0.1.1
|
|
2
4
|
|
|
3
5
|
Reusable Android Cordova advertising bridge. Default is **DISABLED**. No native onload initialization and no advertising timers. This version permits **TEST only**, on a debuggable application or a separate application ID ending `.adstest`. `PRODUCTION` is rejected even if JavaScript requests it. There is no date-based reactivation.
|
|
4
6
|
|
|
@@ -11,7 +13,7 @@ Reusable Android Cordova advertising bridge. Default is **DISABLED**. No native
|
|
|
11
13
|
|
|
12
14
|
Do **not** install alongside `admob-plus-cordova` or another legacy Mobile Ads plugin. Installation and Gradle guards reject common old plugins and `play-services-ads` / `play-services-ads-lite` dependencies. They do not exclude PGS, Firebase or Billing libraries.
|
|
13
15
|
|
|
14
|
-
After approved NPM publication, use `cordova plugin add cordova-plugin-metkasu-admob@0.1.
|
|
16
|
+
After approved NPM publication, use `cordova plugin add cordova-plugin-metkasu-admob@0.1.1`. For local install validation before publication, use the package folder. GDevelop integration declares a pinned Cordova dependency in an events extension and includes the JS controller/facade in that extension. See the parent integration directory for generated projects and validation reports.
|
|
15
17
|
|
|
16
18
|
## API
|
|
17
19
|
|
package/package.json
CHANGED
|
@@ -1,11 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cordova-plugin-metkasu-admob",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Fail-closed Android Next-Gen AdMob bridge with UMP and a two-ad rewarded preload buffer",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
|
-
"cordova": {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
"cordova": {
|
|
7
|
+
"id": "cordova-plugin-metkasu-admob",
|
|
8
|
+
"platforms": [
|
|
9
|
+
"android"
|
|
10
|
+
]
|
|
11
|
+
},
|
|
12
|
+
"engines": {
|
|
13
|
+
"cordova": ">=11.0.0"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"cordova",
|
|
17
|
+
"android",
|
|
18
|
+
"gdevelop",
|
|
19
|
+
"admob",
|
|
20
|
+
"metkasu"
|
|
21
|
+
],
|
|
22
|
+
"files": [
|
|
23
|
+
"plugin.xml",
|
|
24
|
+
"www",
|
|
25
|
+
"src",
|
|
26
|
+
"hooks",
|
|
27
|
+
"tests",
|
|
28
|
+
"README.md",
|
|
29
|
+
"CHANGELOG.md"
|
|
30
|
+
],
|
|
31
|
+
"scripts": {
|
|
32
|
+
"test": "node --test tests/*.test.cjs"
|
|
33
|
+
}
|
|
11
34
|
}
|
package/plugin.xml
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android" id="cordova-plugin-metkasu-admob" version="0.1.
|
|
2
|
+
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android" id="cordova-plugin-metkasu-admob" version="0.1.1">
|
|
3
3
|
<name>MetkasuAdMob</name>
|
|
4
4
|
<description>Explicitly gated Next-Gen advertising. No onload initialization.</description>
|
|
5
5
|
<license>UNLICENSED</license>
|
|
6
6
|
<engines><engine name="cordova-android" version=">=13.0.0" /></engines>
|
|
7
7
|
<js-module src="www/metkasu-admob.js" name="MetkasuAdMob"><clobbers target="MetkasuAdMob" /></js-module>
|
|
8
8
|
<js-module src="www/controller.js" name="Controller"><clobbers target="MetkasuAdMobController" /></js-module>
|
|
9
|
+
<preference name="METKASU_ADMOB_APP_ID" default="ca-app-pub-7841059527940381~9227518637" />
|
|
9
10
|
<platform name="android">
|
|
10
11
|
<config-file target="res/xml/config.xml" parent="/*"><feature name="MetkasuAdMob"><param name="android-package" value="com.metkasu.admob.MetkasuAdMob" /></feature></config-file>
|
|
11
|
-
<config-file target="AndroidManifest.xml" parent="/*"><uses-permission android:name="android.permission.INTERNET" /><uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /></config-file>
|
|
12
|
-
<config-file target="AndroidManifest.xml" parent="/manifest/application"><meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="
|
|
13
|
-
<preference name="android-minSdkVersion" value="24" />
|
|
12
|
+
<config-file target="AndroidManifest.xml" parent="/*"><uses-permission android:name="com.google.android.gms.permission.AD_ID" /><uses-permission android:name="android.permission.INTERNET" /><uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /></config-file>
|
|
13
|
+
<config-file target="AndroidManifest.xml" parent="/manifest/application"><meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="$METKASU_ADMOB_APP_ID" /></config-file>
|
|
14
14
|
<framework src="com.google.android.libraries.ads.mobile.sdk:ads-mobile-sdk:1.6.0" />
|
|
15
15
|
<framework src="com.google.android.ump:user-messaging-platform:4.0.0" />
|
|
16
16
|
<framework src="src/android/metkasu-ads.gradle" custom="true" type="gradleReference" />
|
|
17
|
-
<source-file src="src/android/MetkasuAdMob.java" target-dir="
|
|
18
|
-
<source-file src="src/android/AdsPolicy.java" target-dir="
|
|
19
|
-
<source-file src="src/android/AdSession.java" target-dir="
|
|
20
|
-
<source-file src="src/android/NextGenAds.java" target-dir="
|
|
17
|
+
<source-file src="src/android/MetkasuAdMob.java" target-dir="src/com/metkasu/admob" />
|
|
18
|
+
<source-file src="src/android/AdsPolicy.java" target-dir="src/com/metkasu/admob" />
|
|
19
|
+
<source-file src="src/android/AdSession.java" target-dir="src/com/metkasu/admob" />
|
|
20
|
+
<source-file src="src/android/NextGenAds.java" target-dir="src/com/metkasu/admob" />
|
|
21
21
|
<hook type="before_plugin_install" src="hooks/check-conflicts.js" />
|
|
22
22
|
</platform>
|
|
23
23
|
</plugin>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
package com.metkasu.admob;
|
|
2
2
|
|
|
3
|
-
/**
|
|
3
|
+
/** Production and TEST are explicit modes; UI visibility does not disable the SDK. */
|
|
4
4
|
final class AdsPolicy {
|
|
5
|
-
// Source-release gate.
|
|
6
|
-
static final boolean PRODUCTION_IMPLEMENTATION_APPROVED =
|
|
5
|
+
// Source-release gate. Owner requested normal advertising configuration with UI hidden separately.
|
|
6
|
+
static final boolean PRODUCTION_IMPLEMENTATION_APPROVED = true;
|
|
7
7
|
static final String TEST_APP_ID = "ca-app-pub-3940256099942544~3347511713";
|
|
8
8
|
static final String REWARDED = "ca-app-pub-3940256099942544/5224354917";
|
|
9
9
|
static final String INTERSTITIAL = "ca-app-pub-3940256099942544/1033173712";
|
|
@@ -9,3 +9,5 @@ test('five simulated SDK rewards each grant exactly once; no extra preload calls
|
|
|
9
9
|
test('wrong placement and stale request cannot award',async()=>{
|
|
10
10
|
let request;const c=createController(testConfig,async(action,payload)=>{if(action==='show')request=payload;return {state:'READY'};});await c.initialize();c.receive({type:'state',format:'rewarded',state:'READY'});await c.show('rewarded',{scene:'a',placement:'daily'});c.receive({type:'reward',...request,placement:'shop'});assert.equal(c.consumeReward('a'),false);c.receive({type:'showfail',...request});c.receive({type:'reward',...request});assert.equal(c.consumeReward('a'),false);
|
|
11
11
|
});
|
|
12
|
+
|
|
13
|
+
test('normal production mode accepts real IDs independently of hidden UI configuration',async()=>{const raw={BUILD_CHANNEL:'release',ADMOB_SUSPENDED:false,ADS_ENABLED:true,ADS_MODE:'PRODUCTION',PRODUCTION_APPROVED:true,REWARDED_ENABLED:true,INTERSTITIAL_ENABLED:true,BANNER_ENABLED:false,REWARDED_BUTTONS_VISIBLE:true,REKLAM_BUTONLARI_GIZLI:true,ADMOB_APP_ID:'ca-app-pub-7841059527940381~9227518637',ADMOB_UNITS:{rewarded:'ca-app-pub-7841059527940381/2925085739',interstitial:'ca-app-pub-7841059527940381/7055902436',banner:''}};let requests=0;const c=createController(raw,async()=>{requests++;return {state:'READY'};});await c.preload('rewarded');assert.equal(c.config.mode,'PRODUCTION');assert.equal(c.enabled('rewarded'),true);assert.equal(requests,2);assert.equal(c.config.units.rewarded,raw.ADMOB_UNITS.rewarded);});
|
package/www/controller.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
(function(root,factory){const api=factory();if(typeof module==='object'&&module.exports)module.exports=api;else root.__MetkasuAdsCore=api;})(typeof gdjs!=='undefined'?gdjs:globalThis,function(){
|
|
2
2
|
'use strict';
|
|
3
3
|
// Changing this requires a reviewed source release and the owner's explicit approval.
|
|
4
|
-
const PRODUCTION_IMPLEMENTATION_APPROVED=
|
|
4
|
+
const PRODUCTION_IMPLEMENTATION_APPROVED=true;
|
|
5
5
|
const units=Object.freeze({rewarded:'ca-app-pub-3940256099942544/5224354917',interstitial:'ca-app-pub-3940256099942544/1033173712',banner:'ca-app-pub-3940256099942544/9214589741'});
|
|
6
6
|
function normalize(c){
|
|
7
7
|
const complete=!!c&&['REWARDED_ENABLED','INTERSTITIAL_ENABLED','BANNER_ENABLED','REWARDED_BUTTONS_VISIBLE'].every(k=>typeof c[k]==='boolean')&&c.ADMOB_SUSPENDED===false&&c.ADS_ENABLED===true;
|