{"id":21300372,"url":"https://github.com/appodeal/cordova-plugin","last_synced_at":"2025-10-03T16:46:32.100Z","repository":{"id":57203623,"uuid":"46460393","full_name":"appodeal/cordova-plugin","owner":"appodeal","description":"Appodeal Cordova Plugin","archived":false,"fork":false,"pushed_at":"2018-05-17T10:08:14.000Z","size":48743,"stargazers_count":7,"open_issues_count":5,"forks_count":9,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-11-09T15:49:13.404Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/appodeal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-19T01:56:06.000Z","updated_at":"2024-03-04T17:02:12.000Z","dependencies_parsed_at":"2022-09-16T14:52:10.029Z","dependency_job_id":null,"html_url":"https://github.com/appodeal/cordova-plugin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appodeal%2Fcordova-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appodeal%2Fcordova-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appodeal%2Fcordova-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appodeal%2Fcordova-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/appodeal","download_url":"https://codeload.github.com/appodeal/cordova-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225465308,"owners_count":17478520,"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-21T15:22:13.693Z","updated_at":"2025-10-03T16:46:27.056Z","avatar_url":"https://github.com/appodeal.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Appodeal Cordova Plugin\r\n\r\nThis is an official Appodeal Cordova plugin, created to support Appodeal SDK with Apache Cordova.\r\n\r\n# How to Update Plugin Manually\r\n\r\n+ Download new Appodeal Android SDK [here](https://www.appodeal.com/sdk/documentation?framework=1\u0026full=1\u0026platform=1) and unzip it somewhere.\r\n+ Copy jars except `android-support-v7-recyclerview` (it is needed for native ads witch is not supported by Cordova plugin) into `libs/Android`.\r\n+ aar libraries from `aar` folder should be unzipped and composed into ant libraries, you can check how it should be structured on existing libraries in [Android](/libs/Android/) folder.\r\n+ Open `plugin.xml` file, scroll down to the end of android platform tag, edit `source-file` tags (it should be equal to the jar names, you've put into `libs/Android` folder) and `framework` tags (should be equal to the library folders, you've composed from aar libraries).\r\n+ Copy new `AndroidManifest.xml` tags from [Appodeal Android Docs](https://www.appodeal.com/sdk/documentation?framework=1\u0026full=1\u0026platform=1) page and replace old with new inside `\u003cconfig-file parent=\"/manifest/application\" target=\"AndroidManifest.xml\"\u003e`.\r\n+ Check [AppodealPlugin.java](/src/android/AppodealPlugin.java) for any API changes.\r\n+ Done, you can use updated plugin for Android Platform.\r\n\r\n## Install\r\n\r\nSimply go to the project folder over console/terminal and run there following command:\r\n\r\n    cordova plugin add com.appodeal.plugin\r\n\r\nGoogle Play Services (v10+) already included to plugin dependencies.\r\n\r\nIf you have issues while installing plugin, follow the Command-line Interface Guide.\r\n\r\nMinimum OS requirements: \r\n\r\n+ Android API level 14 (Android OS 4.0)\r\n\r\nAppodeal Cordova Plugin includes:\r\n\r\n+ Android Appodeal SDK version 2.1.11\r\n\r\n## Cordova Integration\r\n\r\n### Ad Types\r\n\r\n+ Appodeal.INTERSTITIAL\r\n+ Appodeal.BANNER\r\n+ Appodeal.REWARDED_VIDEO\r\n+ Appodeal.NON_SKIPPABLE_VIDEO\r\n\r\nAd types can be combined using \"|\" operator. For example Appodeal.INTERSTITIAL | Appodeal.NON_SKIPPABLE_VIDEO.\r\n\r\n### SDK Initialization\r\n\r\nTo initialize SDK for INTERSTITIAL ad type, call the following code:\r\n\r\n```javascript\r\nvar appKey = \"e7e04e54ae0a8d28cff2f7e7e7d094e78b2a09743be2cc4a\";\r\nAppodeal.disableLocationPermissionCheck();\r\nAppodeal.initialize(appKey, Appodeal.INTERSTITIAL);\r\n```\r\n\r\n+ To initialize only interstitials use `Appodeal.initialize(appKey, Appodeal.INTERSTITIAL)`\r\n+ To initialize only rewarded video use `Appodeal.initialize(appKey, Appodeal.REWARDED_VIDEO)`\r\n+ To initialize only non-skippable video use `Appodeal.initialize(appKey, Appodeal.NON_SKIPPABLE_VIDEO)`\r\n+ To initialize interstitials and non-skippable videos use `Appodeal.initialize(appKey, Appodeal.INTERSTITIAL | Appodeal.NON_SKIPPABLE_VIDEO)`\r\n+ To initialize only banners use `Appodeal.initialize(appKey, Appodeal.BANNER)`\r\n\r\n### Display Ad\r\n\r\nTo display ad you need to call the following code:\r\n\r\n```javascript\r\nAppodeal.show(adTypes);\r\n```\r\n\r\n+ To display interstitial use `Appodeal.show(Appodeal.INTERSTITIAL)`\r\n+ To display rewarded video use `Appodeal.show(Appodeal.REWARDED_VIDEO)`\r\n+ To display non-skippable video use `Appodeal.show(Appodeal.NON_SKIPPABLE_VIDEO)`\r\n+ To display interstitial or non-skippable video use `Appodeal.show(Appodeal.INTERSTITIAL | Appodeal.NON_SKIPPABLE_VIDEO)`\r\n+ To display banner at the bottom of the screen use `Appodeal.show(Appodeal.BANNER_BOTTOM)`\r\n+ To display banner at the top of the screen use `Appodeal.show(Appodeal.BANNER_TOP)`\r\n\r\nAlso it can be used in this way, to get boolean value if ad was successfully shown:\r\n\r\n```javascript\r\nAppodeal.show(adTypes, function(result) {\r\n   // result is a boolean value, that is indicates whether show call was passed to appropriate SDK \r\n});\r\n```\r\n\r\n### Checking if interstitial is loaded\r\n\r\nTo check if ad type was loaded, use following code:\r\n\r\n```javascript\r\nAppodeal.isLoaded(adTypes, function(result){\r\n    // result returns bool value\r\n});\r\n```\r\n\r\n### Hide Banner Ad\r\n\r\nTo hide banner you need to call the following code:\r\n\r\n```javascript\r\nAppodeal.hide(Appodeal.BANNER);\r\n```\r\n\r\n### Callbacks integration\r\n\r\nTo set Interstitial callbacks, use following code:\r\n\r\n```javascript\r\nAppodeal.setInterstitialCallbacks( function(container) {\r\n       if (container.event == 'onLoaded') {\r\n            console.log(\"Appodeal. Interstitial. \" + container.event + \", isPrecache: \" + container.isPrecache  );\r\n            // your code\r\n       } else if (container.event == 'onFailedToLoad') {\r\n            // your code\r\n       } else if (container.event == 'onShown') {\r\n            // your code\r\n       } else if (container.event == 'onClick') {\r\n            // your code\r\n       } else if (container.event == 'onClosed') {\r\n            // your code\r\n       }\r\n});\r\n```\r\n\r\nTo set Banner callbacks, use following code:\r\n\r\n```javascript\r\nAppodeal.setBannerCallbacks( function(container) {\r\n       if (container.event == 'onLoaded') {\r\n            console.log(\"Appodeal. Banner. \" + container.event + \", height: \" + container.height + \", isPrecache: \" + container.isPrecache);\r\n            // your code\r\n       } else if (container.event == 'onFailedToLoad') {\r\n            // your code\r\n       } else if (container.event == 'onShown') {\r\n            // your code\r\n       } else if (container.event == 'onClick') {\r\n            // your code\r\n       }\r\n});\r\n```\r\n\r\nTo set Rewarded Video callbacks, use following code:\r\n\r\n```javascript\r\nAppodeal.setRewardedVideoCallbacks( function(container) {\r\n       if (container.event == 'onLoaded') {\r\n            // your code\r\n       } else if (container.event == 'onFailedToLoad') {\r\n            // your code\r\n       } else if (container.event == 'onShown') {\r\n            // your code\r\n       } else if (container.event == 'onFinished') {\r\n            // container also returns \"name\" and \"amount\" variables with reward amount and currency name you have set for your application\r\n            console.log( \"Appodeal. Rewarded. \" + container.event + \", amount: \" + container.amount + \", name: \" + container.name);\r\n            // your code\r\n       } else if (container.event == 'onClosed') {\r\n            // container also returns \"finished\" variable with boolean value for indicating if video was finished\r\n            console.log(\"Appodeal. Rewarded. \" + container.event + \", finished: \" + container.finished);\r\n            // your code\r\n       }\r\n});\r\n```\r\n\r\nTo set Non Skippable Video callbacks, use following code:\r\n\r\n```javascript\r\nAppodeal.setNonSkippableVideoCallbacks( function(container) {\r\n       if (container.event == 'onLoaded') {\r\n            // your code\r\n       } else if (container.event == 'onFailedToLoad') {\r\n            // your code\r\n       } else if (container.event == 'onShown') {\r\n            // your code\r\n       } else if (container.event == 'onFinished') {\r\n            // your code\r\n       } else if (container.event == 'onClosed') {\r\n            // container also returns \"finished\" variable with boolean value for indicating if video was finished\r\n            console.log(\"Appodeal. Non Skippable Video. \" + container.event + \", finished: \" + container.finished);\r\n            // your code\r\n       }\r\n});\r\n```\r\n\r\n### Advanced Features\r\n\r\n#### Getting reward data for placement\r\n\r\nTo get placement reward data before video is shown use:\r\n\r\n```javascript\r\nAppodeal.getRewardParameters( function(result) {\r\n   console.log(\"Appodeal Reward Amount:\" + result.amount);\r\n   console.log(\"Appodeal Reward Currency:\" + result.currency);\r\n});\r\n```\r\n\r\n#### Enabling 728*90 banners\r\n\r\nTo enable 728*90 banner use the following method:\r\n\r\n```javascript\r\nAppodeal.set728x90Banners(true);\r\n```\r\n\r\n#### Disabling banner refresh animation\r\n\r\nTo disable banner refresh animation use:\r\n\r\n```javascript\r\nAppodeal.setBannerAnimation(false);\r\n```\r\n\r\n#### Disabling smart banners\r\n\r\n```javascript\r\nAppodeal.setSmartBanners(false);\r\n```\r\n\r\n#### Enabling test mode\r\n\r\n```javascript\r\nAppodeal.setTesting(true);\r\n```\r\n\r\nIn test mode test ads will be shown and debug data will be written to log.\r\n\r\n#### Enabling logging\r\n\r\n```javascript\r\nAppodeal.setLogLevel(Appodeal.LogLevel.debug);\r\n```\r\n\r\nAvailable parameters: Appodeal.LogLevel.none, Appodeal.LogLevel.debug, Appodeal.LogLevel.verbose.\r\n\r\n#### Checking if loaded ad is precache\r\n\r\n```javascript\r\nAppodeal.isPrecache(adTypes, function(result){\r\n  // result is a boolean value, that equals true if ad is precache\r\n})\r\n```\r\n\r\nCurrently supported only for interstitials and banners\r\n\r\nTo check if loaded interstitial is precache: use `Appodeal.isPrecache(Appodeal.INTERSTITIAL);`\r\n\r\nTo check if loaded banner is precache: use `Appodeal.isPrecache(Appodeal.BANNER);`\r\n\r\n#### Manual ad caching\r\n\r\n```javascript\r\nAppodeal.cache(adTypes);\r\n```\r\n\r\n+ You should disable automatic caching before SDK initialization using `setAutoCache(adTypes, false)`.\r\n+ To cache interstitial use `Appodeal.cache(Appodeal.INTERSTITIAL)`\r\n+ To cache rewarded video use `Appodeal.cache(Appodeal.REWARDED_VIDEO)`\r\n+ To cache interstitial and non-skippable video use `Appodeal.cache(Appodeal.INTERSTITIAL | Appodeal.NON_SKIPPABLE_VIDEO)`\r\n+ To cache banner use `Appodeal.cache(Appodeal.BANNER)`\r\n\r\n#### Enabling or disabling automatic caching\r\n\r\n```javascript\r\nAppodeal.setAutoCache(adTypes, false);\r\n```\r\n\r\n+ Should be used before SDK initialization\r\n+ To disable automatic caching for interstitials use `Appodeal.setAutoCache(Appodeal.INTERSTITIAL, false)`\r\n+ To disable automatic caching for rewarded videos use `Appodeal.setAutoCache(Appodeal.REWARDED_VIDEO, false)`\r\n+ To disable automatic caching for banners use `Appodeal.setAutoCache(Appodeal.BANNER, false)`\r\n\r\n#### Triggering onLoaded callback on precache\r\n\r\n```javascript\r\nAppodeal.setTriggerOnLoadedOnPrecache(adTypes, true);\r\n```\r\n\r\n+ Currently supported only for interstitials\r\n+ `setOnLoadedTriggerBoth(Appodeal.INTERSTITIAL, false)` - onInterstitialLoaded will trigger only when normal ad was loaded (default)..\r\n+ `setOnLoadedTriggerBoth(Appodeal.INTERSTITIAL, true)` - onInterstitialLoaded will trigger twice, both when precache and normal ad were loaded..\r\n+ Should be used before SDK initialization\r\n\r\n#### Disabling data collection for kids apps\r\n\r\n```javascript\r\nAppodeal.setChildDirectedTreatment(true);\r\n```\r\n\r\n#### Disabling networks\r\n\r\n```javascript\r\nAppodeal.disableNetwork(network);\r\n```\r\n\r\nAvailable parameters: \"adcolony\", \"admob\", \"amazon_ads\", \"applovin\", \"appnext\", \"avocarrot\", \"chartboost\", \"facebook\", \"flurry\", \"inmobi\", \"inner-active\", \"ironsource\", \"mailru\", \"mmedia\", \"mopub\", \"ogury\", \"openx\", \"pubnative\", \"smaato\", \"startapp\", \"tapjoy\", \"unity_ads\", \"vungle\", \"yandex\"\r\n\r\nShould be used before SDK initialization\r\n\r\n#### Disabling location permission check\r\n\r\nTo disable toast messages ACCESS_COARSE_LOCATION permission is missing, use the following method:\r\n\r\n```javascript\r\nAppodeal.disableLocationPermissionCheck();\r\n```\r\n\r\nShould be used before SDK initialization.\r\n\r\n#### Disabling write external storage permission check\r\n\r\nTo disable toast messages WRITE_EXTERNAL_STORAGE permission is missing use the following method:\r\n\r\n```javascript\r\nAppodeal.disableWriteExternalStoragePermissionCheck();\r\n```\r\n\r\nDisables all ad networks that need this permission may lead to low video fillrates.\r\n\r\nShould be used before SDK initialization.\r\n\r\n#### Tracking in-app purchase\r\n\r\n```javascript\r\nAppodeal.trackInAppPurchase(this, 5, \"USD\");\r\n```\r\n\r\n#### Testing third-party networks adapters integration\r\n\r\nTo show test screen for testing adapters integration call:\r\n\r\n```javascript\r\nAppodeal.showTestScreen();\r\n```\r\n\r\n#### Muting videos if call volume is muted\r\n\r\n```javascript\r\nAppodeal.muteVideosIfCallsMuted(true);\r\n```\r\n\r\n### Setting User Data\r\n\r\n#### Set the age of the user\r\n\r\n```javascript\r\nAppodeal.setAge(25);\r\n```\r\n\r\n#### Specify gender of the user\r\n\r\n```javascript\r\nAppodeal.setGender(UserSettings.Gender.FEMALE);\r\n```\r\n\r\nPossible values: Appodeal.Gender.FEMALE, Appodeal.Gender.MALE, Appodeal.Gender.OTHER.\r\n\r\n## Changelog\r\n\r\n3.0.5 (21.04.2018)\r\n\r\n+ Appodeal Android SDK updated to 2.1.11\r\n+ Ogury for Android added as required library\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappodeal%2Fcordova-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fappodeal%2Fcordova-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappodeal%2Fcordova-plugin/lists"}