Skip to content

TechingCrewMatt/com-techingcrew-cordova-adcolony

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

com-techingcrew-cordova-adcolony

Free and open source Cordova plugin for AdColony rewarded videos.

-Tested on Samsung Galaxy S6 using Android 7.0 and project built using CLI 6.1.1 -iOS version is in development.

  1. Install the plugin
cordova plugin add com-techingcrew-cordova-adcolony
  1. Add the following JavaScript functions to your project.
  
            var success = function (result) {
                console.log(result);
                if (result === 'onRequestFilled') {
                      console.log('Video Request Filled');
                }
                if (result === 'onRewardVideoAdCompleted') {
                    console.log('Reward Video Completed. Reward the user and request another video.');
                    requestVideo();
                }
                if (result === 'onReward Failed'){
                    console.log('Reward video did not complete successfully. The user may have exited the video.');
                }
                adcolony._SUCCESS = true;
            }
            
            var error = function (e) {
                console.log(e);
            }

            function showVideo([], success, error) {
                window.adcolony.showVideo();
            }

            function requestVideo() {
                window.adcolony.requestVideo([], success, error);
            }

            function initColony() {
                window.adcolony.setup(['xxxxAppIdxxxx', 'xxxxZoneIdxxxx'], success, error);
            }
            
  
  1. Replace the arguments in initColony with your development App Id and Zone Id. In production, requests for video ads are not filled as often as you'd like. Test your implementation with development credentials.
  2. On deviceready call initColony. This initializes AdColony and requests a video to be played by calling showVideo.
  3. Create a link or button that calls showVideo onclick.

About

Free and open source Cordova plugin for AdColony rewarded videos. No revenue sharing.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published