{"id":20372602,"url":"https://github.com/txchen/adgap","last_synced_at":"2026-06-07T11:31:45.940Z","repository":{"id":57207658,"uuid":"46819074","full_name":"txchen/adgap","owner":"txchen","description":"ads plugin for cordova","archived":false,"fork":false,"pushed_at":"2016-08-25T01:34:08.000Z","size":1579,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-11T09:50:03.577Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/cordova-plugin-adgap","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/txchen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-24T21:16:07.000Z","updated_at":"2016-07-13T17:53:40.000Z","dependencies_parsed_at":"2022-09-17T11:25:45.394Z","dependency_job_id":null,"html_url":"https://github.com/txchen/adgap","commit_stats":null,"previous_names":["txchen/ad-gap"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/txchen%2Fadgap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/txchen%2Fadgap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/txchen%2Fadgap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/txchen%2Fadgap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/txchen","download_url":"https://codeload.github.com/txchen/adgap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240142604,"owners_count":19754628,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T01:13:59.218Z","updated_at":"2026-06-07T11:31:45.908Z","avatar_url":"https://github.com/txchen.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# adgap\nads plugin for cordova, aggregates multiple networks. Only supports banner ad format.\n\nNow adgap supports the following networks:\n\n* Facebook Audience Network\n* Mopub\n* Admob\n* mMedia\n* InMobi\n\n## Usage\n\nFirst, add the plugin to your cordova project:\n\n```\ncordova plugin add cordova-plugin-adgap --save\n```\n\nSince mMedia requires minSDKVer to be GE 16, if you get build error, then add the following to your config.xml\n\n```\n\u003cplatform name=\"android\"\u003e\n    \u003cpreference name=\"android-minSdkVersion\" value=\"16\" /\u003e   \u003c------ add this\n    \u003callow-intent href=\"market:*\" /\u003e\n\u003c/platform\u003e\n```\n\n### Show banner ads\n\nThen, write code to show ads, after cordova is ready, call `configBanner` and start the banner logic in the successCallback:\n\n```js\nadgap.configBanner({\n  reloadSec: 26,\n  networks: {\n    fban: { name: 'fban', pid: 'YOUR_FBAN_PLACEMENT_ID', weight: 100, reloadSec: 25 },\n    admob: { name: 'admob', pid: 'YOUR_ADMOB_PLACEMENT_ID', weight: 100, reloadSec: 25 },\n    mopub: { name: 'mopub', pid: 'YOUR_MOPUD_PLACEMENT_ID', weight: 100, reloadSec: 25 },\n    mm: { name: 'mm', pid: 'YOUR_MMEDIA_PLACEMENT_ID', weight: 100, reloadSec: 25 },\n    inmobi: { name: 'inmobi', pid: 'YOUR_INMOBI_PLACEMENT_ID', acctid: 'YOUR_INMOBI_ACCOUNT_ID', weight: 100, reloadSec: 25 },\n  }\n}, function () { // successCallback\n  adgap.startBanner()\n})\n```\n\nThe plugin will auto reload banner every X seconds, so when you create placement at network, don't enable auto reload.\n\nWhen the banner is loaded, or fail to load, events will be published and you can subscribe them:\n\n```js\nwindow.addEventListener('adgap_event', function (adsEvent) {\n    // HERE, cannot use JSON.stringify on the info, Event is created by cordova, and cannot be serialized.\n    // adsEvent contains ads_type, network_name, event_name, event_detail\n    // ads_type = banner\n    // network_name = fban\n    // event_name = LOAD_OK | LOAD_ERROR | CLICKED\n    // event_detail = when error happens, error code like '1001'\n  }, false);\n```\n\nIf you want to pause the banner loop for a while, let it stop loading new ads for some time, you can:\n\n```js\nadgap.snoozeBanner(15000) // will pause the banner loop for 15000 ms\n```\n\n### Send broadcast\n\n```js\nintenthelper.sendBroadcast('com.xzy.abc.ACTION_NAME',\n  { extraName1: 'extraValue1', extraName2: 'extraValue2' })\n```\n\n### Get ads info\n\n```js\nintenthelper.getAdsInfo(\n  function (info) {\n    // now get info.adsid and info.adslimittracking\n  },\n  function (error) {\n\n  }\n)\n```\n\n### Check if a package is installed or not:\n\n```js\nintenthelper.checkPackage('com.awesome.pkg', function (installed) {\n  // installed is boolean\n})\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftxchen%2Fadgap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftxchen%2Fadgap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftxchen%2Fadgap/lists"}