Skip to content

Commit 980df75

Browse files
Initial commit
0 parents  commit 980df75

15 files changed

+1486
-0
lines changed

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2014 Affinity Influencing Systems
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

README.md

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Cordova Plugin for AdColony #
2+
3+
Present AdColony Ads in Mobile App/Games natively from JavaScript.
4+
5+
Compatible with:
6+
7+
* Cordova CLI, v3.5+
8+
9+
## How to use? ##
10+
11+
If using with Cordova CLI:
12+
```
13+
cordova plugin add https://github.com/gabecoyne/cordova-adcolony-plugin
14+
```
15+
16+
## Quick Start Example Code ##
17+
18+
Step 1: Prepare your AdColony App Id for your app on [AdColony's client site](https://clients.adcolony.com/login).
19+
20+
```javascript
21+
var config = {
22+
ios : {
23+
app_id:"ios_app_id",
24+
zone_ids: ["ios_zone_id"]
25+
},
26+
android : {
27+
app_id:"android_app_id",
28+
zone_ids: ["android_zone_id"]
29+
}
30+
};
31+
32+
// select the right Ad Id according to platform
33+
var setup = (/(android)/i.test(navigator.userAgent)) ? config.android : config.ios;
34+
35+
// Pass in an object with additional configuration
36+
AdColony.initialize(setup.app_id, setup.zone_ids, {
37+
debug: true, // iOS only
38+
optionString: "version:1.0,store:google", // Android only
39+
});
40+
```
41+
42+
Step 2: Create a video ad with single line of javascript
43+
44+
```javascript
45+
AdColony.showVideoAd( zoneId );
46+
AdColony.showV4VCVideoAd( zoneId );
47+
```
48+
49+
## Javascript API Overview ##
50+
51+
Methods:
52+
```javascript
53+
// Call before using API
54+
initialize(appId, zoneIds, options, success, fail);
55+
// Video ads
56+
showVideoAd(zoneId);
57+
showV4VCVideoAd(zoneId);
58+
// Cancel all ads
59+
cancelAd();
60+
// For native ad (coming)
61+
createNativeAd(adId, success, fail);
62+
removeNativeAd(adId);
63+
setNativeAdClickArea(adId,x,y,w,h);
64+
```
65+
66+
## Detailed Documentation ##
67+
68+
The APIs, Events and Options are detailed documented.
69+
70+
Read the detailed API Reference Documentation [English](https://github.com/gabecoyne/cordova-adcolony-plugin/wiki).
71+
72+
## FAQ ##
73+
74+
If encounter problem when using the plugin, please read the [FAQ](https://github.com/gabecoyne/cordova-adcolony-plugin/wiki/FAQ) first.

package.json

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"version": "0.9.0",
3+
"name": "com.affinity.cordova.adcolony",
4+
"cordova_name": "AdColony",
5+
"description": "Cordova/PhoneGap Plugin for AdColony",
6+
"license": "MIT",
7+
"repo": "https://github.com/gabecoyne/cordova-adcolony-plugin.git",
8+
"issue": "https://github.com/gabecoyne/cordova-adcolony-plugin/issues",
9+
"keywords": [
10+
"affinity",
11+
"ad",
12+
"adcolony",
13+
"admob",
14+
"iad",
15+
"mopub",
16+
"audience"
17+
],
18+
"platforms": [
19+
"android",
20+
"ios"
21+
],
22+
"engines": [
23+
{
24+
"name": "cordova",
25+
"version": ">=3.5"
26+
}
27+
]
28+
}

plugin.xml

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
4+
xmlns:android="http://schemas.android.com/apk/res/android"
5+
id="com.affinity.cordova.adcolony"
6+
version="0.9.0">
7+
8+
<name>AdColony</name>
9+
<description>Cordova/PhoneGap Plugin for AdColony</description>
10+
<author>Brant Watrous</author>
11+
<license>MIT</license>
12+
13+
<keywords>adcolony,affinity,ad,admob,iad,mopub,audience</keywords>
14+
<repo>https://github.com/gabecoyne/cordova-adcolony-plugin.git</repo>
15+
<issue>https://github.com/gabecoyne/cordova-adcolony-plugin/issues</issue>
16+
17+
<engines>
18+
<engine name="cordova" version=">=3.0" />
19+
</engines>
20+
21+
<js-module src="www/AdColony.js" name="AdColony">
22+
<clobbers target="window.AdColony" />
23+
</js-module>
24+
25+
<!-- android -->
26+
<platform name="android">
27+
<config-file target="res/xml/config.xml" parent="/*">
28+
<feature name="AdColony">
29+
<param name="android-package" value="com.affinity.cordova.adcolony.AdColonyPlugin"/>
30+
</feature>
31+
</config-file>
32+
33+
<config-file target="AndroidManifest.xml" parent="/*">
34+
<uses-permission android:name="android.permission.INTERNET"/>
35+
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
36+
</config-file>
37+
38+
<config-file target="AndroidManifest.xml" parent="/manifest/application">
39+
<activity android:configChanges="keyboardHidden|orientation|screenSize" android:name="com.jirbo.adcolony.AdColonyOverlay" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
40+
<activity android:configChanges="keyboardHidden|orientation|screenSize" android:name="com.jirbo.adcolony.AdColonyFullscreen" android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" />
41+
<activity android:configChanges="keyboardHidden|orientation|screenSize" android:name="com.jirbo.adcolony.AdColonyBrowser" android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" />
42+
</config-file>
43+
44+
<source-file src="src/android/AdColonyPlugin.java" target-dir="src/com/affinity/cordova/adcolony" />
45+
<source-file src="src/android/adcolony.jar" target-dir="libs" />
46+
</platform>
47+
48+
<!-- ios -->
49+
<platform name="ios">
50+
<config-file target="config.xml" parent="/*">
51+
<feature name="AdColony">
52+
<param name="ios-package" value="AdColonyPlugin" />
53+
</feature>
54+
</config-file>
55+
56+
<header-file src="src/ios/AdColonyPlugin.h" />
57+
<source-file src="src/ios/AdColonyPlugin.m" />
58+
59+
<framework src="src/ios/AdColony.framework" custom="true"/>
60+
<framework src="AdSupport.framework" />
61+
<framework src="CoreGraphics.framework" />
62+
<framework src="CoreMedia.framework" />
63+
<framework src="CoreTelephony.framework" />
64+
<framework src="EventKit.framework" />
65+
<framework src="EventKitUI.framework"/>
66+
<framework src="Foundation.framework" />
67+
<framework src="libz.1.2.5.dylib" />
68+
<framework src="MediaPlayer.framework" />
69+
<framework src="MessageUI.framework" />
70+
<framework src="QuartzCore.framework" />
71+
<framework src="Social.framework" weak="true"/>
72+
<framework src="StoreKit.framework"/>
73+
<framework src="SystemConfiguration.framework" />
74+
<framework src="UIKit.framework" />
75+
</platform>
76+
77+
</plugin>

0 commit comments

Comments
 (0)