npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cordova-plugin-adcolony

v3.0.0

Published

AdColony plugin for Apache Cordova

Downloads

9

Readme

AdColony

Allows you to integrate AdColony monetization platform with your Apache Cordova app.

Requirements

AdColony framework versions:

iOS SDK version is 4.1.0

Android SDK version is 4.1.0

Please make sure that you read the AdColony Project setup guides for both Android and iOS if you're building on both platforms.

All the documentation is available from here:

AdColony Android SDK

AdColony iOS SDK

This update integrates AdColony using a podspec in the plugin definition

Install plugin

$ cordova plugin add cordova-plugin-adcolony

See the AdColonyDemoApp code for how to configure and provide an APP_ID and a ZONE_ID within your JavaScript

Android

You will need to manually merge the contents of the file platforms/android/proguard-adcolony.txt to your existing project proguard-project.txt file (I need to figure out how to do this via a script still)

iOS

Please note that you must follow steps 2 onwards in the AdColony Project Setup notes (https://github.com/AdColony/AdColony-iOS-SDK/wiki/Project-Setup)

Methods

AdColony.configureWithAppID(appID, zoneIDs, options)

Initial method wich connects to AdColony.

AdColony.setAppOptions(options)

Set App Options.

| Argument | Type | Description | |----------|--------|-----------------------| | options | Object | JSON Array typically with ONE element a JSON object with the app options|

AdColony.configureWithAppID(appID, zoneIDs, options)

Initial method wich connects to AdColony.

| Argument | Type | Description | |----------|--------|-----------------------| | appID | string | the appID of your app in AdColony Dashboard | | zoneIDs | [strings] | array of your ad zones ids | | options | Object | arapp options defined here |

AdColony.setAppOptions(options)

Set App Options.

| Argument | Type | Description | |----------|--------|-----------------------| | options | Object | JSON Array typically with ONE element a JSON object with the options. Options defined here |

Note that I use the following strings from the Android SDK for cross-platform compatability

orientation
app_orientation
origin_store
disable_logging
user_id
gdpr_required
consent_string
test_mode
multi_window_enabled
mediation_network
mediation_network_version
plugin
plugin_version
keep_screen_on

AdColony.setAdOptions(options)

Set Ad options. options - JSON Array typically with ONE element a JSON object with the options. Options defined here

AdColony.setUserMetaData(metadata)

Set User meta-data for ad retrieval. Calling this sets the user metadata for all future ad requests metadata - JSON Array typically with ONE element a JSON object with the user meta-data. User meta-data defined here

| Argument | Type | Description | |----------|--------|-----------------------| | metadata | Object | JSON Array typically with ONE element a JSON object with the user meta-data|

AdColony.requestInterstitialInZone(zoneID)

Request ad with given zoneID

| Argument | Type | Description | |----------|-------- |-----------------------| | zoneId | String | Your ad zone id|

AdColony.requestInterstitial()

Request ad with current zoneID

AdColony.registerRewardReceiver(rewardHandler)

Register the given Javascript method to handle rewards (Demo uses 'AdColony.onRewardReceived'

| Argument | Type | Description | |----------|-------- |-----------------------| | rewardHandler | Function | Reward handler|

AdColony.showWithPresentingViewController()

After ad is loaded you can show it by calling this method.

Events

document.addEventListener('ConfigureSuccess', () => {  
  console.log('AdColonyPlugin: Configuration successfully completed.');
});

document.addEventListener('AdColonyRequestSubmitted', () => {
 console.log('AdColonyPlugin: Interstitial ad requested.');
});

document.addEventListener('AdColonyRequestFilled', () => {
 console.log('AdColonyPlugin: Interstitial ad loaded.');
});

document.addEventListener('AdColonyRequestNotFilled', (error) => {
  console.log('AdColonyPlugin: Request interstitial failed with error: ' + error);
});

document.addEventListener('AdColonyRequestOpened', () => {
  console.log('AdColonyPlugin: Interstitial ad opened.');
});

document.addEventListener('AdColonyRequestClosed', () => {
  console.log('AdColonyPlugin: Interstitial ad closed.');
});

document.addEventListener('AdColonyRequestExpiring', () => {
  console.log('AdColonyPlugin: Interstitial ad expiring.');
});

Example

let appID = 'AdColonyAppID';
let zoneIDs = ['myZoneID1', 'myZoneID2'];
let options = null;

AdColony.configureWithAppID(appID, zoneIDs, options);

document.addEventListener('ConfigureSuccess', () => {  
   AdColony.requestInterstitialInZone(zoneIDs[0]);
});

document.addEventListener('AdColonyRequestFilled', () => {
 AdColony.showWithPresentingViewController();
});

document.addEventListener('AdColonyRequestClosed', () => {
  console.log('AdColonyPlugin: Interstitial ad closed.');
});

document.addEventListener('AdColonyRequestNotFilled', (error) => {
  console.log('AdColonyPlugin: Request interstitial failed with error: ' + error);
});

Also, Ferdil created great full working demo.

Thanks

Ferdil for the big PR #1

If you have saved some time using our work, do consider donating us something :) All donations I'll devide between all contributors.

paypal