Skip to content

Commit

Permalink
v2.0.6 > Check the release notes
Browse files Browse the repository at this point in the history
  • Loading branch information
EMI-INDO committed Jan 26, 2025
1 parent 9b9b000 commit 180a0af
Show file tree
Hide file tree
Showing 8 changed files with 370 additions and 340 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<img width="543" alt="cp" src="https://github.com/user-attachments/assets/c19a682f-63c4-4754-a008-2e59b46493ac">



### emi-indo-cordova-plugin-admob
Expand Down
168 changes: 59 additions & 109 deletions example/www/css/index.css
Original file line number Diff line number Diff line change
@@ -1,110 +1,60 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
* {
-webkit-tap-highlight-color: rgba(0,0,0,0); /* make transparent link selection, adjust last value opacity 0 to 1.0 */
}

body {
-webkit-touch-callout: none; /* prevent callout to copy image, etc when tap to hold */
-webkit-text-size-adjust: none; /* prevent webkit from resizing text to fit */
-webkit-user-select: none; /* prevent copy paste, to allow, change 'none' to 'text' */
background-color:#E4E4E4;
background-image:linear-gradient(to bottom, #A7A7A7 0%, #E4E4E4 51%);
font-family: system-ui, -apple-system, -apple-system-font, 'Segoe UI', 'Roboto', sans-serif;
font-size:12px;
height:100vh;
margin:0px;
padding:0px;
/* Padding to avoid the "unsafe" areas behind notches in the screen */
padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
text-transform:uppercase;
width:100%;
}

/* Portrait layout (default) */
.app {
background:url(../img/logo.png) no-repeat center top; /* 170px x 200px */
position:absolute; /* position in the center of the screen */
left:50%;
top:50%;
height:50px; /* text area height */
width:225px; /* text area width */
text-align:center;
padding:180px 0px 0px 0px; /* image height is 200px (bottom 20px are overlapped with text) */
margin:-115px 0px 0px -112px; /* offset vertical: half of image height and text area height */
/* offset horizontal: half of text area width */
}

/* Landscape layout (with min-width) */
@media screen and (min-aspect-ratio: 1/1) and (min-width:400px) {
.app {
background-position:left center;
padding:75px 0px 75px 170px; /* padding-top + padding-bottom + text area = image height */
margin:-90px 0px 0px -198px; /* offset vertical: half of image height */
/* offset horizontal: half of image width and text area width */
}
}

h1 {
font-size:24px;
font-weight:normal;
margin:0px;
overflow:visible;
padding:0px;
text-align:center;
}

.event {
border-radius:4px;
color:#FFFFFF;
font-size:12px;
margin:0px 30px;
padding:2px 0px;
}

.event.listening {
background-color:#333333;
display:block;
}

.event.received {
background-color:#4B946A;
display:none;
}

#deviceready.ready .event.listening { display: none; }
#deviceready.ready .event.received { display: block; }

@keyframes fade {
from { opacity: 1.0; }
50% { opacity: 0.4; }
to { opacity: 1.0; }
}

.blink {
animation:fade 3000ms infinite;
-webkit-animation:fade 3000ms infinite;
}


@media screen and (prefers-color-scheme: dark) {
body {
background-image:linear-gradient(to bottom, #585858 0%, #1B1B1B 51%);
}
}
font-family: Arial, sans-serif;
margin: 0;
height: 100%;
padding: 20px;
display: flex;
flex-direction: column;
align-items: center;
background-color: #f4f4f4;
}


h1 {
color: #333;
margin-bottom: 20px;
}

.button-container {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
gap: 10px;
width: 100%;
max-width: 600px;
}

button {
padding: 10px 15px;
font-size: 14px;
border: none;
background-color: #007bff;
color: white;
border-radius: 5px;
cursor: pointer;
text-align: center;
transition: background-color 0.3s ease;
}

button:hover {
background-color: #0056b3;
}

textarea {
width: 100%;
max-width: 600px;
margin-top: 20px;
padding: 10px;
font-size: 14px;
border: 1px solid #ccc;
border-radius: 5px;
resize: none;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
height: 150px;
}

label {
font-size: 16px;
font-weight: bold;
margin-top: 20px;
color: #333;
}
77 changes: 38 additions & 39 deletions example/www/index.html
Original file line number Diff line number Diff line change
@@ -1,44 +1,43 @@
<html>
<!DOCTYPE html>
<html lang="en">
<head>
<script type="text/javascript" src="cordova.js"></script>
<script src="js/deviceready.js" defer></script>
<script src="js/appOpenAd.js" defer></script>
<script src="js/bannerAd.js" defer></script>
<script src="js/interstitialAd.js" defer></script>
<script src="js/rewardedAd.js" defer></script>
<script src="js/rewardedInterstitialAd.js" defer></script>
<script src="js/adSense.js" defer></script>
<script src="js/privacyOptionsFormShow.js" defer></script>
<meta charset="utf-8">
<meta name="viewport" content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="theme-color" content="#000000">
<title>Cordova | Capacitor | Quasar</title>
<style> </style>
<link rel="stylesheet" href="css/index.css">
<script type="text/javascript" src="cordova.js"></script>
<script src="js/deviceready.js" defer></script>
<script src="js/appOpenAd.js" defer></script>
<script src="js/bannerAd.js" defer></script>
<script src="js/interstitialAd.js" defer></script>
<script src="js/rewardedAd.js" defer></script>
<script src="js/rewardedInterstitialAd.js" defer></script>
<script src="js/adSense.js" defer></script>
<script src="js/privacyOptionsFormShow.js" defer></script>
</head>
<body>


<label for="event">Debug Event All response :</label>
<textarea id="log" name="log" rows="20" cols="40"></textarea>

<p> <button onclick="loadAppOpen();">Auto Show App Open Ad</button></p>

<p> <button onclick="loadBanner();">load a show Banner Ad</button></p>
<p> <button onclick="showBanner();">show Banner Ad</button></p>
<p> <button onclick="hideBanner();">hide Banner Ad</button></p>
<p> <button onclick="removeBanner();">remove Banner Ad</button></p>

<p> <button onclick="loadInterstitial();">Load Interstitial Ad</button></p>
<p> <button onclick="showInterstitial();">Show Interstitial Ad</button></p>

<p> <button onclick="loadRewarded();">Load Rewarded Ad</button></p>
<p> <button onclick="showRewarded();">Show Rewarded Ad</button></p>

<p> <button onclick="loadRewardedInt();">Load Rewarded Int Ad</button></p>
<p> <button onclick="showRewardedInt();">Show Rewarded int Ad</button></p>

<p> <button onclick="registerWebView();">AdSense Register</button></p>
<p> <button onclick="loadUrl();">AdSense load Url</button></p>

<p> <button onclick="showPrivacyOptionsForm();">Show Privacy Options Form</button></p>
<p> <button onclick="forceDisplayPrivacyForm();">Force Display Privacy Form</button></p>

<p> <button onclick="cleanText();">Clean response Text</button></p>

<h1>Ad Management Panel</h1>
<div class="button-container">
<button onclick="loadAppOpen();">Auto Show App Open Ad</button>
<button onclick="loadBanner();">Load and Show Banner Ad</button>
<button onclick="showBanner();">Show Banner Ad</button>
<button onclick="hideBanner();">Hide Banner Ad</button>
<button onclick="removeBanner();">Remove Banner Ad</button>
<button onclick="loadInterstitial();">Load Interstitial Ad</button>
<button onclick="showInterstitial();">Show Interstitial Ad</button>
<button onclick="loadRewarded();">Load Rewarded Ad</button>
<button onclick="showRewarded();">Show Rewarded Ad</button>
<button onclick="loadRewardedInt();">Load Rewarded Int Ad</button>
<button onclick="showRewardedInt();">Show Rewarded Int Ad</button>
<button onclick="registerWebView();">AdSense Register</button>
<button onclick="loadUrl();">AdSense Load Url</button>
<button onclick="showPrivacyOptionsForm();">Show Privacy Options Form</button>
<button onclick="forceDisplayPrivacyForm();">Force Display Privacy Form</button>
<button onclick="cleanText();">Clean Response Text</button>
</div>
<label for="log">Debug Event All Response:</label>
<textarea id="log" name="log" placeholder="Logs will appear here..."></textarea>
</body>
</html>
12 changes: 8 additions & 4 deletions example/www/js/bannerAd.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function loadBanner() {
adUnitId: Banner_ID, //Banner_ID,
position: "bottom-center", // "Recommended: bottom-center"
size: "banner", // autoResize: true (only responsive_adaptive)
collapsible: "bottom", // position: top | bottom (disable, empty string)
collapsible: "", // position: top | bottom (disable, empty string)
autoResize: true, // default false
autoShow: true, // default false

Expand Down Expand Up @@ -158,7 +158,7 @@ on.banner.hide
// This is only triggered when cordova.plugins.emiAdmobPlugin.styleBannerAd
document.addEventListener('on.style.banner.ad', (data) => {
console.log("on.style.banner.ad: " + JSON.stringify(data));
/*
/* (ANDROID)
const navBarHeight = data.navBarHeight;
const screenHeight = data.screenHeight;
const usableHeight = data.usableHeight;
Expand All @@ -168,8 +168,12 @@ document.addEventListener('on.style.banner.ad', (data) => {
const marginsInPx = data.marginsInPx;
*/

// You can load banner ads here, or manipulate variables, even rearrange cordova.plugins.emiAdmobPlugin.styleBannerAd to your liking.

/* (IOS)
const screenHeight = data.screenHeight;
const screenWidth = data.screenWidth;
const safeAreaTop = data.safeAreaTop;
const safeAreaBottom = data.safeAreaBottom;
*/

});

Expand Down
10 changes: 5 additions & 5 deletions example/www/js/deviceready.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ document.addEventListener("deviceready", function () {


if (isPlatformIOS){

// with callback: https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/issues/57
cordova.plugins.emiAdmobPlugin.requestIDFA(); // requestTrackingAuthorization

}
Expand All @@ -100,8 +100,8 @@ document.addEventListener("deviceready", function () {
cordova.plugins.emiAdmobPlugin.initialize({

isUsingAdManagerRequest: true, // true = AdManager | false = AdMob (Default true)
isResponseInfo: true, // debug Default false
isConsentDebug: true, // debug Default false
isResponseInfo: false, // debug true | Production false
isConsentDebug: false, // debug true | Production false

});

Expand All @@ -112,8 +112,8 @@ document.addEventListener("deviceready", function () {
// JSON.stringify(data)
const sdkVersion = data.version;
// const adAdapter = data.adapters;
const conStatus = data.consentStatus;
const attStatus = data.attStatus;
const conStatus = data.consentStatus; // UMP
const attStatus = data.attStatus; // ATT
// const gdprApplie = data.gdprApplies;
// const purposeConsent = data.purposeConsents;
// const vendorConsents = data.vendorConsents;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "emi-indo-cordova-plugin-admob",
"version": "2.0.5",
"version": "2.0.6",
"description": "Cordova/Quasar/Capacitor Plugin Admob Android IOS",
"cordova": {
"id": "emi-indo-cordova-plugin-admob",
Expand Down
2 changes: 1 addition & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="emi-indo-cordova-plugin-admob" version="2.0.5">
id="emi-indo-cordova-plugin-admob" version="2.0.6">

<name>emiAdmobPlugin</name>
<description>Cordova/Quasar/Capacitor Plugin Admob Android IOS</description>
Expand Down
Loading

0 comments on commit 180a0af

Please sign in to comment.