Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/steveleetn91/cordova-plugin-admob-free-2

Cordova Admob Plugin support Android and iOS
https://github.com/steveleetn91/cordova-plugin-admob-free-2

admob-sdk cordova cordova-admob cordova-admob-android cordova-admob-ios-16 cordova-admob-plugin cordova-android cordova-android-plugin cordova-ios-admob cordova-ios-plugin cordova-plugin stevelee

Last synced: about 1 month ago
JSON representation

Cordova Admob Plugin support Android and iOS

Awesome Lists containing this project

README

        

![alt text](https://github.com/steveleetn91/cordova-plugin-admob-free-2/blob/dev/demo.png?raw=true)

# Cordova AdMob Plugin (iOS)

This plugin consider from [cordova-plugin-admob-free] plugin. Support GoogleMobileAds SDK version `10.8.0` for iOS and Android `22.2.0`.

## Required

- NodeJS >= 19

## ADS SUPPORT

- Banner -> yes
- Interstilial -> yes
- Reward -> yes

## How to install

First step you need clone or download plugin after that run:

cordova plugin add path/to/plugin/cordova-plugin-admob-free-2 --save --variable ADMOB_APP_ID=""

change `path/to/plugin` by your path to plugin cloned or downloaded. If you have error "Error: undefined is not an object (evaluating 'window.nuke_admob.iOS')" maybe you will need reinstall `node_modules`, go to `./plugins/cordova-plugin-admob-free-2` and delete folder `./node_modules`, run `npm install && npm run build`.

Remove

cordova plugin remove cordova-plugin-admob-free-2 --save --variable ADMOB_APP_ID=""

## Config

First step your need add this into `config.xml` . You need consider this link for config iOS `https://developers.google.com/admob/ios/quick-start`.



NSAllowsArbitraryLoads




ca-app-pub-3940256099942544~1458002511




SKAdNetworkIdentifier
cstr6suwn9.skadnetwork


SKAdNetworkIdentifier
4fzdc2evr5.skadnetwork


SKAdNetworkIdentifier
4pfyvq9l8r.skadnetwork


SKAdNetworkIdentifier
2fnua5tdw4.skadnetwork


SKAdNetworkIdentifier
ydx93a7ass.skadnetwork


SKAdNetworkIdentifier
5a6flpkh64.skadnetwork


SKAdNetworkIdentifier
p78axxw29g.skadnetwork


SKAdNetworkIdentifier
v72qych5uu.skadnetwork


SKAdNetworkIdentifier
ludvb6z3bs.skadnetwork


SKAdNetworkIdentifier
cp8zw746q7.skadnetwork


SKAdNetworkIdentifier
c6k4g5qg8m.skadnetwork


SKAdNetworkIdentifier
s39g8k73mm.skadnetwork


SKAdNetworkIdentifier
3qy4746246.skadnetwork


SKAdNetworkIdentifier
3sh42y64q3.skadnetwork


SKAdNetworkIdentifier
f38h382jlk.skadnetwork


SKAdNetworkIdentifier
hs6bdukanm.skadnetwork


SKAdNetworkIdentifier
prcb7njmu6.skadnetwork


SKAdNetworkIdentifier
v4nxqhlyqp.skadnetwork


SKAdNetworkIdentifier
wzmmz9fp6w.skadnetwork


SKAdNetworkIdentifier
yclnxrl5pm.skadnetwork


SKAdNetworkIdentifier
t38b2kh725.skadnetwork


SKAdNetworkIdentifier
7ug5zh24hu.skadnetwork


SKAdNetworkIdentifier
9rd848q2bz.skadnetwork


SKAdNetworkIdentifier
y5ghdn5j9k.skadnetwork


SKAdNetworkIdentifier
n6fk4nfna4.skadnetwork


SKAdNetworkIdentifier
v9wttpbfk9.skadnetwork


SKAdNetworkIdentifier
n38lu8286q.skadnetwork


SKAdNetworkIdentifier
47vhws6wlr.skadnetwork


SKAdNetworkIdentifier
kbd757ywx3.skadnetwork


SKAdNetworkIdentifier
9t245vhmpl.skadnetwork


SKAdNetworkIdentifier
a2p9lx4jpn.skadnetwork


SKAdNetworkIdentifier
22mmun2rn5.skadnetwork


SKAdNetworkIdentifier
4468km3ulz.skadnetwork


SKAdNetworkIdentifier
2u9pt9hc89.skadnetwork


SKAdNetworkIdentifier
8s468mfl3y.skadnetwork


SKAdNetworkIdentifier
av6w8kgt66.skadnetwork


SKAdNetworkIdentifier
klf5c3l5u5.skadnetwork


SKAdNetworkIdentifier
ppxm28t8ap.skadnetwork


SKAdNetworkIdentifier
424m5254lk.skadnetwork


SKAdNetworkIdentifier
ecpz2srf59.skadnetwork


SKAdNetworkIdentifier
uw77j35x4d.skadnetwork


SKAdNetworkIdentifier
mlmmfzh3r3.skadnetwork


SKAdNetworkIdentifier
578prtvx9j.skadnetwork


SKAdNetworkIdentifier
4dzt52r2t5.skadnetwork


SKAdNetworkIdentifier
gta9lk7p23.skadnetwork


SKAdNetworkIdentifier
e5fvkxwrpn.skadnetwork


SKAdNetworkIdentifier
8c4e2ghe7u.skadnetwork


SKAdNetworkIdentifier
zq492l623r.skadnetwork


SKAdNetworkIdentifier
3rd42ekr43.skadnetwork


SKAdNetworkIdentifier
3qcr597p9d.skadnetwork





Sometime a some texteditor auto format will appears a some errors. If on that case you can consider google document for iOS version 10.8.0.

## Add SDK ( Simulator && Real Device )

Default plugin support for simulator but if you need run on Real Device, so let's go to `./plugins/cordova-plugins-admob-free-2/plugin.xml` and comment all framework support for simulator and uncomment all framework support for Real Device ( I have comment at that, please check it ). After that you need reinstall iOS platform, maybe it'll apprear error
because project no select device for compile, don't worry you can open Project with Xcode and select Real Device, next step you can build in XCode or command line.

## How to use?

### Example Banner iOS

const x = (window.outerWidth - 320) / 2;
const y = window.outerHeight - 100;
const size = 2;
// size = 0 : 300x50
// size = 1 : 320x50
// size = 2 : 320x100
// size = 3 : 320x250
// size = 4 : 468x60
// size = 5 : 728x90

window.nuke_admob.ios.banner.createAd(UnitAdId, x,y,size)
.then(() => {
admob.ios.banner.loadAd();
});
document.addEventListener("admob.banner.events.LOAD",() => {
console.log("ADS LOAD");
admob.ios.banner.showAd();
})

### Example Banner Android

const x = (window.outerWidth - 320) / 2;
const y = window.outerHeight - 100;
const size = 2;
// size = 0 : 300x50
// size = 1 : 320x50
// size = 2 : 320x100
// size = 3 : 320x250
// size = 4 : 468x60
// size = 5 : 728x90

window.nuke_admob.android.banner.createAd(UnitAdId, x,y,size)
.then(() => {
admob.android.banner.loadAd();
});

document.addEventListener("admob.banner.events.LOAD",() => {
console.log("ADS LOAD");
admob.android.banner.showAd();
})

### Example Interstitial iOS

window.nuke_admob.ios.interstitial.createAd(UnitId);

document.addEventListener("admob.interstitial.events.LOAD",() => {
window.nuke_admob.ios.interstitial.showAd();
});

### Example Interstitial Android

window.nuke_admob.android.interstitial.createAd(UnitId);

document.addEventListener("admob.interstitial.events.LOAD",() => {
window.nuke_admob.android.interstitial.showAd();
});

### Example ReWard iOS

window.nuke_admob.ios.rewardvideo.createAd(UnitId);

document.addEventListener("admob.rewardvideo.events.LOAD",() => {
window.nuke_admob.ios.rewardvideo.showAd();
});

### Example ReWard Android

window.nuke_admob.android.rewardvideo.createAd(UnitId);

document.addEventListener("admob.rewardvideo.events.LOAD",() => {
window.nuke_admob.android.rewardvideo.showAd();
});

## Events iOS

- admob.interstitial.events.LOAD
- admob.interstitial.events.OPEN
- admob.interstitial.events.LOAD_FAIL
- admob.interstitial.events.DID_DISMISS

- admob.banner.events.LOAD
- admob.banner.events.OPEN
- admob.banner.events.LOAD_FAIL
- admob.banner.events.DID_RECORD
- admob.banner.events.WILL_DISMISS
- admob.banner.events.DISMISS

- admob.rewardvideo.events.LOAD
- admob.rewardvideo.events.OPEN
- admob.rewardvideo.events.LOAD_FAIL
- admob.rewardvideo.events.DID_DISMISS

## Events Android

- admob.interstitial.events.CLICK
- admob.interstitial.events.LOAD
- admob.interstitial.events.OPEN
- admob.interstitial.events.LOAD_FAIL
- admob.interstitial.events.DISMISS
- admob.interstitial.events.IMPRESSION

- admob.banner.events.CLICK
- admob.banner.events.LOAD
- admob.banner.events.OPEN
- admob.banner.events.LOAD_FAIL
- admob.banner.events.CLOSE
- admob.banner.events.IMPRESSION

- admob.rewardvideo.events.LOAD
- admob.rewardvideo.events.OPEN
- admob.rewardvideo.events.LOAD_FAIL
- admob.rewardvideo.events.IMPRESSION
- admob.rewardvideo.events.DISMISS
- admob.rewardvideo.events.CLICK

## Issue

If you need anything please create new issue `https://github.com/steveleetn91/cordova-plugin-admob-free-2/issues`

## Freelancer Service (Cordova/Ionic)

If you need a freelancer for cordova project, so let's me know. I can work 16 hours / 1 day and rate is 10$/1 hour. I can speak english and IELTS scope is `6.0~7.0`.

- Write plugin
- Coding App
- Maintain cordova/ionic app

Contact email : [email protected]

Facebook: https://www.facebook.com/profile.php?id=100015561036994

## License

[MIT](LICENSE)