http://developer.ad4game.com/index.php?title=Special:NewPages&feed=atom&limit=50&offset=&namespace=0&username=&tagfilter=Ad4Game Developers - New pages [en]2024-03-29T11:42:06ZFrom Ad4Game DevelopersMediaWiki 1.20.2http://developer.ad4game.com/index.php/Advertiser_APIAdvertiser API2015-07-10T11:32:50Z<p>Mostapha: </p>
<hr />
<div>{{#iDisplay:http://developer.ad4game.com/advertiserapi.html|800|800}}</div>Mostaphahttp://developer.ad4game.com/index.php/Video_Ads_APIVideo Ads API2015-04-03T11:38:24Z<p>Mostapha: </p>
<hr />
<div>==Description==<br />
This API is specific to '''reward video ads'''<br />
<br>Returns the reward transactions details for a given period.<br />
<br>Results can display a set of fields for reward transactions: <br />
<ul><br />
<li>- TransactionId : The transaction id ('''unique''')<br />
<li>- Date : the transaction date<br />
<li>- User : the user id <br />
<li>- ZoneId : the zone id.<br />
<li>- CampaignId : the campaign id.<br />
</ul><br />
<br />
==URL==<br />
https://traffic.ad4game.com/www/admin/reward-video-api.php?apiKey=[YOUR API KEY]&affiliateId=[YOUR AFFILIATE ID]&zoneId=[YOUR ZONE ID]&method=getRewardVideos&format=[xml OR json]&period_start=[yyyy-mm-dd]&period_end=[yyyy-mm-dd]<br />
<br />
==Reponses types==<br />
===JSON===<br />
<dd><br />
{"error":"Success",<br />
"Transactions":<br />
{"goaogNzky8PckHOBfX+grYWJrH+g0piGm2h6g3t8m4I=":{<br />
"transactionid":"goaogNzky8PckHOBfX+grYWJrH+g0piGm2h6g3t8m4I=",<br />
"date":"2015-04-01 10:30:34",<br />
"userid":"1544sqdqs",<br />
"zoneid":"325200",<br />
"campaignid":"15268" <br />
}<br />
}<br />
}<br />
<br />
===XML===<br />
<dd><br />
<Transactions><br />
<Transaction><br />
<TransactionId>goaogNzky8PckHOBfX+grYWJrH+g0piGm2h6g3t8m4I=</TransactionId><br />
<Date>2015-04-01 10:30:34</Date><br />
<User>1544sqdqs</User><br />
<ZoneId>325200</ZoneId><br />
<CampaignId>15268</CampaignId><br />
</Transaction><br />
</Transactions></div>Mostaphahttp://developer.ad4game.com/index.php/GetConversionsDetailsGetConversionsDetails2014-11-21T10:47:03Z<p>Mostapha: /* URL */</p>
<hr />
<div>==Description==<br />
<br />
Returns the conversions details for a given period.<br />
<br>Results can display a set of fields for conversions: <br />
<ul><br />
<li>- TransactionType : lead, sale ...<br />
<li>- Status : Approved or Disaproved<br />
<li>- OfferName : the offer name <br />
<li>- OfferId : the offer id.<br />
<li>- TrackingDateTime : the tracking date.<br />
<li>- TrackerId : the tracker id.<br />
<li>- Commission : the payout.<br />
<li>- Currency : dollar, euro ...<br />
<li>- subid<br />
<li>- subid2<br />
<li>- subid3<br />
<li>- subid4<br />
<li>- Affid<br />
</ul><br />
<br />
==URL==<br />
https://traffic.ad4game.com/www/admin/offers-api.php?apiKey=[YOUR API KEY]&affiliateId=[YOUR AFFILIATE ID]&zoneId=[YOUR ZONE ID]&method=getConversionsDetails&format=[xml OR json]&period_start=[yyyy-mm-dd]&period_end=[yyyy-mm-dd]<br />
<br />
==Reponses types==<br />
===JSON===<br />
<dd><br />
{"error":"Success",<br />
"Conversions":<br />
{"1030":{<br />
"transaction_type":"lead",<br />
"status":"Approved",<br />
"offer_name":"Travian",<br />
"offer_id":"325",<br />
"tracking_date_time":"2014-11-12 08:26:29",<br />
"TrackerId":"711",<br />
"Commission":"2.5",<br />
"Curency":"$",<br />
"subid":"125482",<br />
"subid2":"0",<br />
"subid3":"0",<br />
"subid4":"0",<br />
"affid":"125482HjUGH"<br />
}<br />
}<br />
}<br />
<br />
===XML===<br />
<dd><br />
<Conversions><br />
<Conversion><br />
<TransactionType>lead</TransactionType><br />
<Status>Approved</Status><br />
<OfferName>Travian</OfferName><br />
<OfferId>325</OfferId><br />
<TrackingDateTime>2014-11-12 08:26:29</TrackingDateTime><br />
<TrackerId>711</TrackerId><br />
<Commission>2.5</Commission><br />
<Currency>$</Currency><br />
<subid>125482</subid><br />
<subid2>0</subid2><br />
<subid3>0</subid3><br />
<subid4>0</subid4><br />
<AffId>125482HjUGH</AffId><br />
</Conversion><br />
</Conversions></div>Mostaphahttp://developer.ad4game.com/index.php/GetCreativesGetCreatives2013-08-15T16:38:45Z<p>Mostapha: /* Description */</p>
<hr />
<div>==Description==<br />
<br />
Return all the creatives files associated to an offer.<br /><br />
Result can display a set of fields for the matching offer. <br /><br />
such as Country Name, file Name, file width, and file height <br /><br />
<br />
==URL==<br />
https://traffic.ad4game.com/www/admin/offers-api.php?apiKey=[YOUR API KEY]&zoneId=[YOUR ZONE ID]&affiliateId=[YOUR AFFILIATE ID]&method=getCreatives&format=[xml OR json]&offerId=[OFFER ID]<br />
==HTTP Method(s)==<br />
GET, POST<br />
<br />
==Reponses types==<br />
===JSON===<br />
<dd><br />
{"error":"Success",<br />
"OfferId":"3",<br />
"OfferName":"The West",<br />
"Creatives":{<br />
"AT":[<br />
{"width":"728","height":"90","fileName":"http:\/\/cdn.ad4game.com\/dbae1d612de94e74817735eb51c7e20a.swf"},<br />
{"width":"160","height":"600","fileName":"http:\/\/cdn.ad4game.com\/9504ec9ee6c94679779dd7621d315052.swf"},<br />
{"width":"300","height":"250","fileName":"http:\/\/cdn.ad4game.com\/76084ead58673a5f304922b59dd27d2d.swf"}<br />
],<br />
"AU":[<br />
{"width":"160","height":"600","fileName":"http:\/\/cdn.ad4game.com\/a1163f53d6f49d2fb49c65c3e269e596.swf"},<br />
{"width":"300","height":"250","fileName":"http:\/\/cdn.ad4game.com\/89d7794a8d54339cf4b43e94b807a8e7.swf"},<br />
{"width":"728","height":"90","fileName":"http:\/\/cdn.ad4game.com\/4e04f020481de02c6311a9058483666d.swf"}<br />
]<br />
}<br />
}<br />
===XML===<br />
<dd><br />
<?xml version='1.0' encoding='UTF-8' ?><br />
<Offer Id='3'><br />
<Name>The West</Name><br />
<Creatives><br />
<Country Name='AT'><br />
<Banners><br />
<File width='300' height='300' >http://cdn.ad4game.com/dd0bd0b0af09e9e17179d4cfa455defd.jpg</File><br />
<File width='728' height='728' >http://cdn.ad4game.com/8cb39dd7855d5a170ba11991a72373f2.swf</File><br />
<File width='160' height='160' >http://cdn.ad4game.com/84abefe1c89ade028b8b5d5ad689ae56.swf</File><br />
</Banners><br />
</Country><br />
<Country Name='AU'><br />
<Banners><br />
<File width='300' height='300' >http://cdn.ad4game.com/89d7794a8d54339cf4b43e94b807a8e7.swf</File><br />
<File width='160' height='160' >http://cdn.ad4game.com/fd6156cce1914e1e55fc92ee2bd807f1.swf</File><br />
<File width='728' height='728' >http://cdn.ad4game.com/6caec43d33a9528bb256f8cde5201547.swf</File><br />
</Banners><br />
</Country><br />
</Creatives><br />
</Offer></div>Mostaphahttp://developer.ad4game.com/index.php/FindOneFindOne2013-08-15T16:36:57Z<p>Mostapha: /* XML */</p>
<hr />
<div>==Description==<br />
<br />
Returns information for a specific offer.<br />
Result can display a set of fields for the requested offer: <br />
<ul><br />
<li>- Id : the offer id<br />
<li>- Name : the offer name<br />
<li>- Platform : supported <br />
<li>- DailyCap : max lead per day.<br />
<li>- PreviewUrl : offer landing page.<br />
<li>- TrackingUrl : Ad4Game tracking url<br />
<li>- Description : Description of the offer<br />
<li>- RestricteddTraffic :<br />
<li>- Country : targeted country<br />
<li>- OptIn : offer opt-in can be either DOI or SOI<br />
<li>- Rate : Net Rate paid to affiliate in $ USD<br />
<li>- EndDate : expire time of the offer<br />
</ul><br />
<br />
==URL==<br />
https://traffic.ad4game.com/www/admin/offers-api.php?apiKey=[YOUR API KEY]&zoneId=[YOUR ZONE ID]&affiliateId=[YOUR AFFILIATE ID]&method=findOne&format=[xml OR json]&offerId=[OFFER ID]<br />
<br />
==HTTP Method(s)==<br />
GET, POST<br />
<br />
==Filters :==<br />
<ul><br />
<li>countries : list of countries (ISO code) sperated by a comma (CA,US,FR,JP).</li><br />
<li>optIn : can be either DOI or SOI.</li><br />
<li>platform : can be either Display, Android, IOS or Android & IOS.</li><br />
<li>restrictedTraffic : restricted traffic sources can be either S, SEM, B, D, E, P or T</li><br />
S: Social traffic (facebook, etc)<br />
SEM: Search Engine Marketing e.g. Google AdWords<br />
B: Brand Bidding<br />
D: Display / Banners<br />
E: Email Marketing<br />
P: Pop Unders<br />
T: Text Links / Editorial content<br />
</ul><br />
<br />
==Reponses types==<br />
===JSON===<br />
<dd><br />
{"error":"Success",<br />
"Offers":<br />
{"3":{<br />
"OfferId":"3",<br />
"OfferName":"The West",<br />
"Platform":"Display",<br />
"DailyCap":"None",<br />
"PreviewUrl":"http:\/\/www.the-west.net",<br />
"TrackingUrl":"http:\/\/ads.ad4game.com\/www\/delivery\/dck.php?offerid=3&zoneid=7711",<br />
"Description":"Discover new land and experience exciting adventures and duels! The West is waiting for you!",<br />
"RestrictedTraffic":" Display \/ Banners, Email Marketing, Pop Unders, Text Links \/ Editorial content","Restrictions":"",<br />
"countries":[<br />
{"CountryName":"AT","OptIn":"SOI","endDate":"2013-08-16 15:55:42","Rate":"1.92"},<br />
{"CountryName":"AU","OptIn":"SOI","endDate":"2013-08-16 15:55:42","Rate":"0.40"}<br />
]<br />
}<br />
}<br />
}<br />
===XML===<br />
<dd><br />
<Offers><br />
<Offer Id="656"><br />
<Name>The Hobbit Android</Name><br />
<Platform>Android Smartphone & Tablet</Platform><br />
<DailyCap>63</DailyCap><br />
<PreviewUrl>https://play.google.com/store/apps/details?id=com.kabam.fortress</PreviewUrl><br />
<TrackingUrl>http://ads.ad4game.com/www/delivery/dck.php?offerid=656&zoneid=7711</TrackingUrl><br />
<Description>The battle for Middle-earth has just begun! PLAY FOR FREE and join thousands worldwide to drive ..</Description><br />
<RestrictedTraffic> Social traffic (facebook, etc), Social traffic (facebook, etc) Email MarketingM, Brand Bidding</RestrictedTraffic><br />
<Countries><br />
<Country name="US"><br />
<OptIn>SOI</OptIn><Rate>$3.75</Rate><br />
<EndDate>2013-09-15 16:47:12</EndDate><br />
</Country><br />
</Countries><br />
</Offer><br />
</Offers></div>Mostaphahttp://developer.ad4game.com/index.php/FindAllFindAll2013-08-15T16:22:48Z<p>Mostapha: </p>
<hr />
<div>==Description==<br />
<br />
Returns details for all offers or a result set with optional filters.<br />
Results can display a set of fields for all matching offers: <br />
<ul><br />
<li>- Id : the offer id<br />
<li>- Name : the offer name<br />
<li>- Platform : supported <br />
<li>- DailyCap : max lead per day.<br />
<li>- PreviewUrl : offer landing page.<br />
<li>- TrackingUrl : Ad4Game tracking url<br />
<li>- Description : Description of the offer<br />
<li>- RestrictedTraffic : list of restricted traffic sources<br />
<li>- Country : Targeted country<br />
<li>- OptIn : offer opt-in can be either DOI or SOI<br />
<li>- Rate : Net Rate paid to affiliate in $ USD<br />
<li>- EndDate : The expire time of the offer<br />
</ul><br />
<br />
==URL==<br />
https://traffic.ad4game.com/www/admin/offers-api.php?apiKey=[YOUR API KEY]&zoneId=[YOUR ZONE ID]&affiliateId=[YOUR AFFILIATE ID]&method=findAll&format=[xml OR json]<br />
<br />
==HTTP Method(s)==<br />
GET, POST<br />
<br />
==Filters :==<br />
<ul><br />
<li>countries : list of countries (ISO code) sperated by a comma (CA,US,FR,JP).</li><br />
<li>optIn : can be either DOI or SOI.</li><br />
<li>platform : can be either Display, Android, IOS or Android & IOS.</li><br />
<li>restrictedTraffic : restricted traffic sources can be either S, SEM, B, D, E, P or T</li><br />
S: Social traffic (facebook, etc)<br />
SEM: Search Engine Marketing e.g. Google AdWords<br />
B: Brand Bidding<br />
D: Display / Banners<br />
E: Email Marketing<br />
P: Pop Unders<br />
T: Text Links / Editorial content<br />
</ul><br />
<br />
==Reponses types==<br />
===JSON===<br />
<dd><br />
{"error":"Success",<br />
"Offers":<br />
{"3":{<br />
"OfferId":"3",<br />
"OfferName":"The West",<br />
"Platform":"Display",<br />
"DailyCap":"None",<br />
"PreviewUrl":"http:\/\/www.the-west.net",<br />
"TrackingUrl":"http:\/\/ads.ad4game.com\/www\/delivery\/dck.php?offerid=3&zoneid=7711",<br />
"Description":"Discover new land and experience exciting adventures and duels! The West is waiting for you!",<br />
"RestrictedTraffic":" Display \/ Banners, Email Marketing, Pop Unders, Text Links \/ Editorial content","Restrictions":"",<br />
"countries":[<br />
{"CountryName":"AT","OptIn":"SOI","endDate":"2013-08-16 15:55:42","Rate":"1.92"},<br />
{"CountryName":"AU","OptIn":"SOI","endDate":"2013-08-16 15:55:42","Rate":"0.40"}<br />
]<br />
}<br />
}<br />
}<br />
===XML===<br />
<dd><br />
<Offers><br />
<Offer Id="656"><br />
<Name>The Hobbit Android</Name><br />
<Platform>Android Smartphone & Tablet</Platform><br />
<DailyCap>63</DailyCap><br />
<PreviewUrl>https://play.google.com/store/apps/details?id=com.kabam.fortress</PreviewUrl><br />
<TrackingUrl>http://ads.ad4game.com/www/delivery/dck.php?offerid=656&zoneid=7711</TrackingUrl><br />
<Description>The battle for Middle-earth has just begun! PLAY FOR FREE and join thousands worldwide to drive ..</Description><br />
<RestrictedTraffic> Social traffic (facebook, etc), Social traffic (facebook, etc) Email MarketingM, Brand Bidding</RestrictedTraffic><br />
<Countries><br />
<Country name="US"><br />
<OptIn>SOI</OptIn><Rate>$3.75</Rate><br />
<EndDate>2013-09-15 16:47:12</EndDate><br />
</Country><br />
</Countries><br />
</Offer><br />
</Offers></div>Mostaphahttp://developer.ad4game.com/index.php/Offers_APIOffers API2013-08-15T15:58:15Z<p>Mostapha: </p>
<hr />
<div>The Offers API allows you to interact with Ad4Game platform. <br /><br />
It provides you an easy way to keep your system updated with our offers. <br /><br />
through its methods, you can either retrieve all offers linked to your zoneid, get the creatives files of a specific offer or get the conversions details <br /><br />
In order to use the offers API, we've generated an Api Key for you, please login to our ad4game platform to get it.<br /><br />
All requests require your Api Key, affiliateId and zoneId.<br /><br />
We offer two responses formats : XML and JSON<br /><br />
<br />
<ul><br />
<li>[[findAll]]</li><br />
<li>[[findOne]] </li><br />
<li>[[getCreatives]]</li><br />
<li>[[getConversionsDetails]]</li><br />
</ul></div>Mostaphahttp://developer.ad4game.com/index.php/UnityUnity2013-08-15T09:55:55Z<p>Mostapha: /* Handling Events */</p>
<hr />
<div><br><img>http://developer.ad4game.com/images/Unity-Logo.jpg</img><br />
= <font color='green'>Android Unity</font> =<br />
<img>http://developer.ad4game.com/download/unity/androidUnity.png</img><br />
== <font color='#2D95DB'>Publishers</font> ==<br />
===<font color='#2D95DB'>Download Android SDK</font> ===<br />
<h5><font color='red'>What's new!</font></h5><br />
<br>The new Android SDK v3.0 for Unity supports now <b>Google’s Advertising Identifier</b><br />
<br>The new Android SDK v4.0 for Unity allows you handling ads events.<br />
Download the [[http://developer.ad4game.com/download/unity/Android_SDK_Publisher_Unity_v4.0.zip Android SDKv4.0 publishers for Unity]]. Decompress the zip file and extract the files to your development computer.<br />
<br>The Android SDK for Unity is provided as three java JAR files ('''AndroidSDKPublisher4.0.jar''', '''a4gpublisherunity.jar''' et et '''google-play-services.jar'''), making it easy to include in your Android project.<br />
<br />
===<font color='#2D95DB'>Setup the Unity Project</font> ===<br />
- Create a ‘Plugins’ folder and within this create another folder called ‘Android’ ('''Assets>Plugins>Android''').<br />
<br><br>- Copy the '''AndroidSDKPublisher4.0.jar''', '''a4gpublisherunity.jar''' and the '''google-play-services.jar''' into this folder.<br />
<br><br>- Create a ‘res’ folder and within this create another folder called ‘values’ ('''Assets>Plugins>Android>res>values'''). Copy the '''version.xml''' to this folder.<br />
<br><br>Build the project for Android and then go into the ‘'''Temp\StagingArea'''’ folder with your project folder and copy the '''AndroidManifest.xml''' file into the ‘Android’ folder. <br>This manifest file now needs to be edited to look like this:<br />
<br><img>http://developer.ad4game.com/download/unity/manifest.png</img><br />
<br />
===<font color='#2D95DB'>Display Mobile Ads</font> ===<br />
You will create a C# file that will attach to a Unity GameObject as a script. The C# file need to be under the '''Assets''' folder.<br />
<br>You'll then need to call the '''loadTopAds''' or '''loadBottomAds''' (you can call the both methods to display two ads (one on the top, and the other on the bottom of the <br />
screen) methods in the '''Awake()''' function of an empty GameObject in your startup scene:<br />
<dd><font color='blue'>AndroidJavaClass</font> jc = <font color='blue'>new AndroidJavaClass</font>(<font color='magenta'>"com.unity3d.player.UnityPlayer"</font>); <br />
<font color='blue'>AndroidJavaObject</font> a4g = jc.GetStatic<<font color='blue'>AndroidJavaObject</font>>(<font color='magenta'>"currentActivity"</font>); <br />
a4g.Call(<font color='magenta'>"loadTopAds"</font>, <font color='magenta'>"yourZoneID"</font>); <br />
a4g.Call(<font color='magenta'>"loadBottomAds"</font>, <font color='magenta'>"yourSecondZoneID"</font>);<br />
====<font color='#2D95DB'>Handling Events</font> ====<br />
If you want to handle ads events, you need first to set your GameObject in the '''Awake()''' function as follow :<br />
a4g.Call(<font color='magenta'>"setGameObject", "game object name"</font>);<font color='green'>// Main Camera for example</font><br />
Then, you can call the following functions :<br />
<font color='blue'>void</font> onAdLoaded() {<br />
<font color='green'>// Do your treatment</font><br />
}<br />
<font color='blue'>void</font> onAdFailed() {<br />
<font color='green'>// Do your treatment</font><br />
}<br />
<font color='blue'>void</font> onAdClicked() {<br />
<font color='green'>// Do your treatment</font><br />
}<br />
<br />
Now, go to '''File >Build Settings >Player Settings''', and change the Bundle Identifier to '''com.a4gpublisherunity'''.<br />
<br>Build the Unity project for Android platform and run it on your device to see the ads.<br />
<br />
===<font color='#2D95DB'>Display Android Editorials</font> ===<br />
To display Android Editorials inside your unity project, you need to use one of the three methods (you can use all of them) bellow:<br />
<br>'''1- showA4GEditos :''' If you want to display the editorials once the activity's started.<br />
<br>'''2- showA4GEditosWithStartTime :''' If you want to display the editorials after certain time.<br />
<br>'''3- showA4GEditosWithStartAndEndTime :''' If you want to display the editorials after certain time and close them automatically after certain time. <br />
<br>'''4- showA4GEditosOnClick :''' If you want to display the editorials when the user click on a button.<br />
<dd><font color='red'>'''Note:'''</font> The three first methods mentioned above are valid only if your project target android '''3.0''' or above, '''showA4GEditoOnClick''' is <br>valid from android '''2.3''' or above.<br />
<img>http://developer.ad4game.com/download/unity/Unity-Publisher.png</img><br />
====<font color='#2D95DB'>Handling Events</font> ====<br />
If you want to handle Editorials events, you need first to set your GameObject in the '''Awake()''' function as follow :<br />
a4g.Call(<font color='magenta'>"setGameObject", "game object name"</font>);<font color='green'>// Main Camera for example</font><br />
Then, you can call the following functions :<br />
<font color='blue'>void</font> onEditorialLoaded() {<br />
<font color='green'>// Do your treatment</font><br />
}<br />
<font color='blue'>void</font> onEditorialFailed() {<br />
<font color='green'>// Do your treatment</font><br />
}<br />
<font color='blue'>void</font> onEditorialClicked() {<br />
<font color='green'>// Do your treatment</font><br />
}<br />
<font color='blue'>void</font> onEditorialClosed() {<br />
<font color='green'>// Do your treatment</font><br />
}<br />
<br />
===<font color='#2D95DB'>Display Android Interstitials</font> ===<br />
To display Android interstitials inside your unity project, you need to use one of the three methods (you can use all of them) bellow:<br />
<br>'''1- showA4GInterstitials :''' If you want to display the interstitials once the activity's started.<br />
<br>'''2- showA4GInterstitialsWithStartTime :''' If you want to display the interstitials after certain time.<br />
<br>'''3- showA4GInterstitialsWithStartAndEndTime :''' If you want to display the interstitials after certain time and close them automatically after certain time.<br />
<br><br><img>http://developer.ad4game.com/download/unity/Android-Interstitials-Unity.png</img><br />
<br />
====<font color='#2D95DB'>Handling Events</font> ====<br />
If you want to handle Interstitials events, you need first to set your GameObject in the '''Awake()''' function as follow :<br />
a4g.Call(<font color='magenta'>"setGameObject", "game object name"</font>);<font color='green'>// Main Camera for example</font><br />
Then, you can call the following functions :<br />
<font color='blue'>void</font> onInterstitialsLoaded() {<br />
<font color='green'>// Do your treatment</font><br />
}<br />
<font color='blue'>void</font> onInterstitialsFailed() {<br />
<font color='green'>// Do your treatment</font><br />
}<br />
<font color='blue'>void</font> onInterstitialsClicked() {<br />
<font color='green'>// Do your treatment</font><br />
}<br />
<font color='blue'>void</font> onInterstitialsClosed() {<br />
<font color='green'>// Do your treatment</font><br />
}<br />
<br />
== <font color='#2D95DB'>Advertisers</font> ==<br />
===<font color='#2D95DB'>Download Android SDK</font> ===<br />
<h5><font color='red'>What's new!</font></h5><br />
<br>The new Android SDK v2.0 for Unity supports now <b>Google’s Advertising Identifier</b><br />
Download the [[http://developer.ad4game.com/download/unity/Android_SDK_Tracker_Unity_v2.0.zip Android SDKv2.0 advertisers for Unity]]. Decompress the zip file and extract the files to your development computer.<br />
<br>The Android SDK for Unity is provided as three java JAR files ('''AndroidSDKTracker2.0.jar''' , '''A4GTrackerUnity.jar''' et '''google_play_services.jar'''), making it easy to include in your Unity project.<br />
<br />
===<font color='#2D95DB'>Setup the Unity Project</font> ===<br />
- Create a ‘Plugins’ folder and within this create another folder called ‘Android’ ('''Assets>Plugins>Android'''). Copy the '''AndroidSDKTracker2.0.jar''', '''A4GTrackerUnity.jar''' and the '''google-play-services.jar''' into this folder.<br />
<br><br>- Create a ‘res’ folder and within this create another folder called ‘values’ ('''Assets>Plugins>Android>res>values'''). Copy the '''version.xml''' to this folder.<br />
<br><br>- Build the project for Android and then go into the ‘'''Temp\StagingArea'''’ folder with your project folder and copy the '''AndroidManifest.xml''' file into the ‘Android’ folder.<br />
<br><br>This manifest file now needs to be edited to look like this:<br />
<br><img>http://developer.ad4game.com/download/unity/AndroidManifestTracking2.png</img><br />
<br>You will then create a C# file that will attach to a Unity GameObject as a script. The C# file need to be under the '''Assets''' folder.<br />
<br>You'll then need to call the '''loadTrack''' method in the '''Awake()''' function of an empty GameObject in your startup scene:<br />
<dd><font color='blue'>AndroidJavaClass</font> jc = <font color='blue'>new AndroidJavaClass</font>(<font color='magenta'>"com.unity3d.player.UnityPlayer"</font>); <br />
<font color='blue'>AndroidJavaObject</font> a4g = jc.GetStatic<<font color='blue'>AndroidJavaObject</font>>(<font color='magenta'>"currentActivity"</font>); <br />
a4g.Call(<font color='magenta'>"loadTrack"</font>, <font color='magenta'>"yourTrackerID"</font>); <br />
Now, go to F'''ile >Build Settings >Player Settings''', and change the Bundle Identifier to '''com.a4gtrackerunity'''.<br />
<br />
= <font color='green'>iOS Unity</font> =<br />
<img>http://developer.ad4game.com/download/unity/unityIos.jpeg</img><br />
== <font color='#2D95DB'>Publishers</font> ==<br />
===<font color='#2D95DB'>Download iOS SDK</font> ===<br />
Download the [[http://developer.ad4game.com/download/unity/iOS_SDK_Publisher_Unity_v3.0.zip iOS SDKv3.0 publishers for Unity]]. Decompress the zip file and extract the files to your development computer.<br />
<br>The iOS SDK for Unity is provided as a single framework file ('''A4GPubUnity.framework'''), making it easy to include in your iOS project.<br />
<br />
===<font color='#2D95DB'>Include the A4GPubUnity.framework</font> ===<br />
Build your Unity project for iOS, then open the generated xcode project.<br />
<br>To include the A4GPubUnity.framework to your xcode project, you need to select your target project, and then go to '''Build Phases → Link Binary With Libraries''', <br />
then click on the '''+''' sign '''→ Add Other''', and select the A4GPubUnity.framework saved on your computer.<br />
===<font color='#2D95DB'>Include the AdSupport.framework</font> ===<br />
You need to include the AdSupport.framework to your project target to enable the Advertiser Identifier functionality. Go to '''Build Phases → Link Binary With <br />
Libraries''', then click on the '''+''' sign to add the AdSupport.framework.<br />
<br>Then, change the value of AdSupport.framework from Required to '''Optional'''.<br />
===<font color='#2D95DB'>Include the SystemConfiguration.framework</font> ===<br />
You need to include the SystemConfiguration.framework to your project target to enable the detection of the connection type. Go to '''Build Phases → Link Binary <br />
With Libraries''', then click on the '''+''' sign to add the SystemConfiguration.framework.<br />
===<font color='#2D95DB'>Display Mobile Ads</font> ===<br />
To display ads on your iOS project, you need to follow the steps bellow:<br />
<br>– You need to add this line into your '''appController.h''' file<br />
<br><font color='magenta'>@property</font> (<font color='magenta'>strong , nonatomic</font>) <font color='#9A2EFE'>UIWindow</font> *window;<br />
<br>In your '''appController.mm''' file<br />
<br>– You need to import the A4GPubUnity.framework, after the last #import.<br />
<br><font color='brown'>#import</font> <font color='red'><A4GPubUnity/A4GPubUnityViewController.h></font><br />
<br>– Go to '''startUnity''' method and do these steps :<br />
<br>– Instantiate the window declared inside appController.h file.<br />
<br>– Instantiate an object of A4GPubUnityViewController.<br />
<br>– Add a imageView and Button with the same size of the ad to display (the button need to be above the imageView and need to be transparent).<br />
<br>– call the different method to display ads. The methods are:<br />
<br>'''* setZoneID''' method allows you to set the zoneID.<br />
<br>'''* getRefresh''' method to refresh the display of banners.<br />
<br>'''* loadAds''' method to get banners from ad4game servers.<br />
<br>Your code need to be similar to this:<br />
<br><img>http://developer.ad4game.com/download/unity/iospublisherunity.png</img><br />
<br />
===<font color='#2D95DB'>Display iOS Editorials</font> ===<br />
To display mobile Editorials on your iOS project developed by Unity, you need to follow the steps bellow:<br />
<br>– You need to add this line into your '''appController.h''' file<br />
<br><font color='magenta'>@property</font> (<font color='magenta'>strong , nonatomic</font>) <font color='#9A2EFE'>UIWindow</font> *window;<br />
<br>In your '''appController.mm''' file<br />
<br>– You need to import the A4GPubUnity.framework, after the last #import.<br />
<br><font color='brown'>#import</font> <font color='red'><A4GPubUnity/A4GPubUnityViewController.h></font><br />
<br><font color='brown'>#import</font> <font color='red'><A4GPubUnity/A4GEdito.h></font><br />
<br>– Go to '''startUnity''' method and do these steps :<br />
<br>– Instantiate the window declared inside appController.h file.<br />
<br>– Instantiate an object of A4GEdito.<br />
<br>– You need to add a '''UIButton''' if you want to launch the editorials when the user clicks on that button.<br />
<br>– call the different method to display mobile Editorials. The methods are:<br />
<br>'''* setZoneID''' method allows you to set the zoneID.<br />
<br>'''* showA4GEditos''' method, to display directly the Editorials when the app started.<br />
<br>'''* showA4GEditosWithStartTime''' method, to display the Editorials after a certain time.<br />
<br>'''* showA4GEditosWithStartAndEndTime''' method, to display the Editorials after a certain time, and close them automatically after a certain time.<br />
<br>Your code need to be similar to this:<br />
<dd><br />
-(<font color='magenta'>void</font>) startUnity:(<font color='#9A2EFE'>UIApplication</font>*)application {<br />
<font color='magenta'>self</font>.<font color='green'>window</font> = [[<font color='#9A2EFE'>UIWindow</font> alloc] initWithFrame:[[<font color='#9A2EFE'>UIScreen</font> mainScreen] bounds]];<br />
<font color='#9A2EFE'>A4GEdito</font> *a4gEdito = [[<font color='#9A2EFE'>A4GEdito</font> alloc]init];<br />
[a4gEdito <font color='#9A2EFE'>setZoneID</font>:<font color='red'>@"32593"</font>]; <font color='green'>// set ZoneID</font><br />
<font color='#9A2EFE'>UIButton</font> *button = [<font color='#9A2EFE'>UIButton</font> buttonWithType:UIButtonTypeRoundedRect];<br />
button.<font color='#9A2EFE'>frame</font> = CGRectMake(20, 20, 50, 50); <font color='green'>// Create a button where x=20, y=20, width=50, height=50;</font><br />
[button setTitle:<font color='red'>@”Editorials”</font> forState:UIControlStateNormal];<br />
[button addTarget:a4gEdito action:<font color='magenta'>@selector</font>('''showA4GEditos''') forControlEvents:UIControlEventTouchUpInside];<br />
<br />
[<font color='magenta'>self</font>.<font color='green'>window</font> <font color='#9A2EFE'>addSubview</font>:button];<br />
[<font color='magenta'>self</font>.<font color='green'>window</font> <font color='#9A2EFE'>makeKeyAndVisible</font>];<br />
[a4gEdito <font color='#9A2EFE'>showA4GEditos</font>]; <font color='green'>// Show Editorials when the app started</font>.<br />
[a4gEdito <font color='#9A2EFE'>showA4GEditosWithStartTime</font> : <font color='blue'>10</font>]; <font color='green'>// Show Editorials after 10 seconds</font>.<br />
[a4gEdito <font color='#9A2EFE'>showA4GEditosWithStartAndEndTime</font> : <font color='blue'>10</font> <font color='#9A2EFE'>withArg2</font> : <font color='blue'>20</font>]; <font color='green'>// Show Editorials after 10 seconds and close it automatically after 20 seconds</font>.<br />
===<font color='#2D95DB'>Display iOS Interstitials</font> ===<br />
To display mobile Interstitials on your iOS project developed by Unity, you need to follow the steps bellow:<br />
<br>– You need to add this line into your '''appController.h''' file<br />
<br><font color='magenta'>@property</font> (<font color='magenta'>strong , nonatomic</font>) <font color='#9A2EFE'>UIWindow</font> *window;<br />
<br>In your '''appController.mm''' file<br />
<br>– You need to import the A4GPubUnity.framework, after the last #import.<br />
<br><font color='brown'>#import</font> <font color='red'><A4GPubUnity/A4GPubUnityViewController.h></font><br />
<br><font color='brown'>#import</font> <font color='red'><A4GPubUnity/A4GInterstitials.h></font><br />
<br>– Go to '''startUnity''' method and do these steps :<br />
<br>– Instantiate the window declared inside appController.h file.<br />
<br>– Instantiate an object of A4GInterstitials.<br />
<br>– call the different method to display mobile Editorials. The methods are:<br />
<br>'''* setZoneID''' method allows you to set the zoneID.<br />
<br>'''* showA4GInterstitials''' method, to display directly the Interstitials when the app started.<br />
<br>'''* showA4GInterstitialsWithStartTime''' method, to display the Interstitials after a certain time.<br />
<br>'''* showA4GInterstitialsWithStartAndEndTime''' method, to display the Interstitials after a certain time, and close them automatically after a certain time.<br />
<br>Your code need to be similar to this:<br />
<dd><br />
-(<font color='magenta'>void</font>) startUnity:(<font color='#9A2EFE'>UIApplication</font>*)application {<br />
<font color='magenta'>self</font>.<font color='green'>window</font> = [[<font color='#9A2EFE'>UIWindow</font> alloc] initWithFrame:[[<font color='#9A2EFE'>UIScreen</font> mainScreen] bounds]];<br />
<font color='#9A2EFE'>A4GInterstitials</font> *a4gInter = [[<font color='#9A2EFE'>A4GInterstitials</font> alloc]init];<br />
[a4gInter <font color='#9A2EFE'>setZoneID</font>:<font color='red'>@"32593"</font>]; <font color='green' size=1>// set ZoneID</font><br />
[a4gInter <font color='#9A2EFE'>showA4GInterstitials</font>]; <font color='green' size=1>// Show Interstitials when the app started</font>.<br />
[a4gInter <font color='#9A2EFE'>showA4GInterstitialsWithStartTime</font> : <font color='blue'>10</font>]; <font color='green' size=1>// Show Interstitials after 10 seconds</font>.<br />
[a4gInter <font color='#9A2EFE'>showA4GInterstitialsWithStartAndEndTime</font> : <font color='blue'>10</font> <font color='#9A2EFE'>withArg2</font> : <font color='blue'>20</font>]; <font color='green' size=1>// Show Interstitials after 10 seconds and close them automatically after 20 seconds</font>.<br />
[<font color='magenta'>self</font>.<font color='green'>window</font> <font color='#9A2EFE'>makeKeyAndVisible</font>];<br />
<br />
== <font color='#2D95DB'>Advertisers</font> ==<br />
===<font color='#2D95DB'>Download iOS SDK</font> ===<br />
Download the [[http://developer.ad4game.com/download/unity/iOS_SDK_Advertisers_Unity_v1.0.zip iOS SDKv1.0 advertisers for Unity]]. Decompress the zip file and extract the files to your development computer.<br />
<br>The iOS SDK for Unity is provided as a single framework file ('''A4GUnityTracker.framework'''), making it easy to include <br />
in your iOS project.<br />
<br />
===<font color='#2D95DB'>Setup the Unity project</font> ===<br />
To integrate the Ad4game iOS plugin in your Unity app, you will be creating a C# file that will attach to a Unity GameObject as a script.<br />
<br>The C# file need to be under the '''Assets''' folder.<br />
<br>In the C# scripts, '''DllImport''' attribute needs to be set for the '''trackInstall''' method to be imported from the plugin code.<br />
<br>Remember that you need to add this line on the top of the C# file: <br />
<dd><font color='blue'>using</font> System.Runtime.InteropServices; <br />
[DllImport (<font color='magenta'>"__Internal"</font>)]<br />
<font color='blue'>private static extern void</font> trackInstall(<font color='blue'>string</font> trackerID);<br />
You'll then need to call the '''trackInstall''' function in the '''Awake()''' function of an empty GameObject in your startup scene:<br />
<dd><font color='blue'>void</font> Awake () {<br />
trackInstall(<font color='magenta'>"yourTrackerID"</font>);<br />
}<br />
Build the Unity project for iOS platform.<br />
Note that a new iOS Xcode project is generated.<br />
===<font color='#2D95DB'>Include the A4GUnityTracker.framework</font> ===<br />
Open the iOS project in Xcode.<br />
<br>To include the '''A4GUnityTracker.framework''' to your xcode project, you need to select your target project,<br />
<br>and then go to '''Build Phases → Link Binary With Libraries''', then click on the '''+''' sign '''→ Add Other''', and select the A4GUnityTracker.framework saved on your computer.<br />
===<font color='#2D95DB'>Include the AdSupport.framework</font> ===<br />
You need to include the '''AdSupport.framework''' to your project target to enable the Advertiser Identifier functionality.<br />
<br>Go to '''Build Phases → Link Binary With Libraries''', then click on the '''+''' sign to add the AdSupport.framework.<br />
<br>Then, change the value of AdSupport.framework from Required to '''Optional'''.<br />
===<font color='#2D95DB'>Include the SystemConfiguration.framework</font> ===<br />
You need to include the '''SystemConfiguration.framework''' to your project target to enable detection of the internet availability.<br />
<br>Go to '''Build Phases → Link Binary With Libraries''', then click on the '''+''' sign to add the SystemConfiguration.framework.<br />
<br />
= <font color='#2D95DB'>Contact</font> =<br />
<br />
If you've got questions, we've got answers!<br />
Please Contact Us at <font color='blue'>tech@ad4game.com</font> with any technical queries.</div>Mostaphahttp://developer.ad4game.com/index.php/IOSIOS2013-08-13T13:28:22Z<p>Mostapha: /* Display iOS Editorials */</p>
<hr />
<div><br><img>http://developer.ad4game.com/images/ios.jpg</img><br />
= <font color='green'>Publishers</font> =<br />
== <font color='#2D95DB'>Download iOS SDK</font> ==<br />
Download the [[http://developer.ad4game.com/download/iOS/Pub_IOS_SDK_3.0.zip iOS SDKv3.0 for publishers]]. Decompress the zip file and extract the files to your development mac.<br />
<br>The Ad4game iOS SDK is provided as a single framework file ('''A4GPub.framework'''), making it easy to include in your iOS project.<br />
<br />
== <font color='#2D95DB'>Include the A4GPub.framework</font> ==<br />
To include the A4GPub.framework to your xcode project, you need to select your target project, and then go to '''Build Phases → Link Binary With Libraries''',<br />
<br>then click on the '''+''' sign → '''Add Other''', and select the A4GPub.framework saved on your mac as shown below:<br />
<br><img>http://developer.ad4game.com/download/iOS/A4GPubFramework.png</img><br />
<br />
== <font color='#2D95DB'>Include the AdSupport.framework</font> ==<br />
You need to include the '''AdSupport.framework''' to your project target to enable the Advertiser Identifier functionality.<br />
<br>Go to '''Build Phases → Link Binary With Libraries''', then click on the '''+''' sign to add the AdSupport.framework as shown below:<br />
<br><img>http://developer.ad4game.com/download/iOS/AdSupport.png</img><br />
<br>Then, change the value of AdSupport.framework from Required to '''Optional'''.<br />
<br />
== <font color='#2D95DB'>Include the SystemConfiguration.framework</font> ==<br />
You need to include the '''SystemConfiguration.framework''' to your project target to enable detection of the connection type.<br />
Go to '''Build Phases → Link Binary With Libraries''', then click on the '''+''' sign to add the SystemConfiguration.framework.<br />
<br />
== <font color='#2D95DB'>Include the QuartzCore.framework</font> ==<br />
You need to include the '''QuartzCore.framework''' to your project target to customize the interface.<br />
<br>Go to '''Build Phases → Link Binary With Libraries''', then click on the '''+''' sign to add the QuartzCore.framework.<br />
<br />
== <font color='#2D95DB'>Display Mobile Ads</font> ==<br />
To display ads on your iOS project, you need to follow the steps bellow:<br />
<br>In your '''ViewController.xib'''<br />
<br>– You need to add an '''UIImageView''' with the size of the ad.<br />
<br>– You need to add an '''UIButton''' above the UIImageView with the same size of the ad.<br />
<br>Connect the UIImageView and the UIButton to your ViewController.h file.<br />
<br><br>In your '''ViewController.h''' file<br />
<br>– You need to import the A4GPub.framework.<br />
<br>– Declare an Object of A4GPubViewController.<br />
<br>Your code need to be similar to this:<br />
<dd><font color='brown'>#import</font> <font color='red'><A4GPub/A4GPubViewController.h></font><br />
<font color='magenta'>@interface</font> TestViewController : <font color='#9A2EFE'>UIViewController</font> {<br />
<font color='magenta'>IBOutlet</font> <font color='magenta'>UIImageView</font> *image;<br />
<font color='#9A2EFE'>A4GPubViewController</font> *a4g;<br />
}<br />
- (<font color='magenta'>IBAction</font>)button : (<font color='magenta'>id</font>)sender;<br />
<font color='magenta'>@end</font><br />
In your '''ViewController.m''' file<br />
<br>– You need to import the A4GPub.framework.<br />
<br>– In your '''viewDidLoad''' method, you need to instantiate the object created on viewController.h file and call the different method to display ads.<br />
<br>The methods are:<br />
<br>'''* setZoneID''' method allows you to set the zoneID.<br />
<br>'''* setImageView''' method allows you to set your UIImageView.<br />
<br>'''* getRefresh''' method to refresh the display of banners.<br />
<br>'''* loadAds''' method to get banners from ad4game servers.<br />
<br><br>Your code need to be similar to this:<br />
<dd><font color='magenta'>#import</font> <font color='red'><A4GPub/A4GPubViewController.h></font><br />
<font color='magenta'>@implementation</font> TestViewController<br />
–<br />
(<font color='magenta'>void</font>)viewDidLoad<br />
{<br />
[<font color='magenta'>super</font> <font color='#9A2EFE'>viewDidLoad</font>];<br />
<font color='green'>a4g</font> = [[<font color='#9A2EFE'>A4GPubViewController</font> alloc] init];<br />
[<font color='green'>a4g</font> <font color='#9A2EFE'>setZoneID</font> : @"yourZoneID"];<br />
[<font color='green'>a4g</font> <font color='#9A2EFE'>setImageView</font> : yourUIImageView]; <font color='green'>//in this example, its name is image</font><br />
[<font color='green'>a4g</font> <font color='#9A2EFE'>getRefresh</font>];<br />
[<font color='green'>a4g</font> <font color='#9A2EFE'>loadAds</font>];<br />
}<br />
– In your '''(IBAction)button : (id)sender''' method, you need to call the '''loadClick''' method allowing you to get the click associate to the ad displayed.<br />
<dd>– (<font color='magenta'>IBAction</font>)button : (<font color='magenta'>id</font>)sender<br />
{<br />
[<font color='green'>a4g</font> <font color='#9A2EFE'>loadClick</font>];<br />
}<br />
<br />
<dd><font color='red'>'''Note:'''</font> You can add many zones as you want, just instantiate the A4GPubViewController object as follow :<br />
<br />
In your '''ViewController.h''' :<br />
<dd><font color='brown'>#import</font> <font color='red'><A4GPub/A4GPubViewController.h></font><br />
<font color='magenta'>@interface</font> TestViewController : <font color='#9A2EFE'>UIViewController</font> {<br />
<font color='magenta'>IBOutlet</font> <font color='#9A2EFE'>UIImageView</font> *imageOne;<br />
<font color='magenta'>IBOutlet</font> <font color='#9A2EFE'>UIImageView</font> *imagetwo;<br />
<font color='#9A2EFE'>A4GPubViewController</font> *a4gObject;<br />
<font color='#9A2EFE'>A4GPubViewController</font> *secondObject;<br />
}<br />
– (<font color='magenta'>IBAction</font>)buttonOne : (<font color='magenta'>id</font>)sender;<br />
– (<font color='magenta'>IBAction</font>)buttonTwo : (<font color='magenta'>id</font>)sender;<br />
<font color='magenta'>@end</font><br />
<br />
In your '''ViewController.m''' :<br />
<dd><font color='brown'>#import</font> <font color='red'><A4GPub/A4GPubViewController.h></font><br />
<font color='magenta'>@implementation</font> TestViewController<br />
-(<font color='magenta'>void</font>)viewDidLoad<br />
{<br />
[<font color='magenta'>super</font> <font color='#9A2EFE'>viewDidLoad</font>];<br />
<font color='green'>a4gObject</font> = [[<font color='#9A2EFE'>A4GPubViewController</font> alloc] init];<br />
<font color='green'>secondObject</font> = [[<font color='#9A2EFE'>A4GPubViewController</font> alloc] init];<br />
[<font color='green'>a4gObject</font> <font color='#9A2EFE'>setZoneID</font> : @"FirstZoneID"];<br />
[<font color='green'>a4gObject</font> <font color='#9A2EFE'>setImageView</font> : yourUIImageView];<br />
[<font color='green'>a4gObject</font> <font color='#9A2EFE'>getRefresh</font>];<br />
[<font color='green'>a4gObject</font> <font color='#9A2EFE'>loadAds</font>];<br />
[<font color='green'>secondObject</font> <font color='#9A2EFE'>setZoneID</font> : @"SecondZoneID"];<br />
[<font color='green'>secondObject</font> <font color='#9A2EFE'>setImageView</font> : yourUIImageView];<br />
[<font color='green'>secondObject</font> <font color='#9A2EFE'>getRefresh</font>];<br />
[<font color='green'>secondObject</font> <font color='#9A2EFE'>loadAds</font>];<br />
}<br />
– (<font color='magenta'>IBAction</font>)buttonOne : (<font color='magenta'>id</font>)sender<br />
{<br />
[<font color='green'>a4gObject</font> <font color='#9A2EFE'>loadClick</font>];<br />
}<br />
– (<font color='magenta'>IBAction</font>)buttonTwo : (<font color='magenta'>id</font>)sender<br />
{<br />
[<font color='green'>secondObject</font> <font color='#9A2EFE'>loadClick</font>];<br />
}<br />
== <font color='#2D95DB'>Display iOS Editorials</font> ==<br />
To display iOS Editorials on your iOS project, you need to follow the steps bellow:<br />
<br><br>In your '''ViewController.xib'''<br />
<br>You need to add a '''UIButton''' if you want to launch the editorials when the user clicks on that button.<br />
<br>Connect the UIButton to your ViewController.h file.<br />
<br><br>In your '''ViewController.h''' file<br />
<br>– You need to import the '''A4GEdito.h''' header file.<br />
<br>– Declare an Object of A4GEdito.<br />
<br>Your code need to be similar to this:<br />
<dd><font color='brown'>#import</font> <font color='red'><A4GPub/A4GEdito.h></font><br />
<font color='magenta'>@interface</font> TestViewController : <font color='#9A2EFE'>UIViewController</font> {<br />
<font color='magenta'>IBOutlet</font> <font color='#9A2EFE'>UIButton</font> *editoButton;<br />
<font color='#9A2EFE'>A4GEdito</font> *a4gEdito;<br />
}<br />
<font color='magenta'>@end</font><br />
<br />
In your '''ViewController.m''' file<br />
<br>– In your '''viewDidLoad''' method, you need to instantiate the object created on your ViewController.h file and call the different method to display Editorials.<br />
<br>The methods are:<br />
<br>'''* setZoneID''' method, allows you to set the zoneID.<br />
<br>* '''setButton''' method, allows you to set your UIButton.<br />
<br>'''* showA4GEditos''' method, to display directly the Editorials when the app started.<br />
<br>'''* showA4GEditosWithStartTime''' method, to display the Editorials after a certain time.<br />
<br>'''* showA4GEditosWithStartAndEndTime''' method, to display the Editorials after a certain time, and close them automatically after a certain time.<br />
<br><br>Your code need to be similar to this:<br />
<br />
<dd><font color='magenta'>@implementation</font> TestViewController<br />
–(<font color='magenta'>void</font>)viewDidLoad<br />
{<br />
[<font color='magenta'>super</font> <font color='#9A2EFE'>viewDidLoad</font>];<br />
<font color='green'>a4gEdito</font> = [[<font color='#9A2EFE'>A4GEdito</font> alloc] init];<br />
[<font color='green'>a4gEdito</font> <font color='#9A2EFE'>setZoneID</font> : @"yourZoneID"];<br />
[<font color='green'>a4gEdito</font> <font color='#9A2EFE'>setButton</font> : yourUIButton]; <font color='green'>//in this example, its name is editoButton</font>.<br />
[[<font color='green'>a4gEdito</font> <font color='#9A2EFE'>getButton</font>] <font color='#9A2EFE'>addTarget</font> : <font color='green'>a4gEdito</font> <font color='#9A2EFE'>action</font> : <font color='red'>@selector</font>(<font color='#9A2EFE'>showA4GEditos</font>) <font color='#9A2EFE'>forControlEvents:UIControlEventTouchUpInside</font>];<br />
<font color='green'> //this line add “showA4GEditos” action to your UIButton</font>.<br />
[<font color='green'>a4gEdito</font> <font color='#9A2EFE'>showA4GEditos</font>]; <font color='green'>//Display Editorials directly when the app started</font>.<br />
[<font color='green'>a4gEdito</font> <font color='#9A2EFE'>showA4GEditosWithStartTime</font>:<font color='blue'>15</font>]; <font color='green'>//Display Editorials after 15 seconds</font>.<br />
[<font color='green'>a4gEdito</font> <font color='#9A2EFE'>showA4GEditosWithStartAndEndTime</font> : <font color='blue'>10</font> <font color='#9A2EFE'>withArg2</font> : <font color='blue'>30</font>]; <font color='green'>//Display Editorials after 10 seconds and close it automatically after 30 seconds</font>.<br />
}<br />
== <font color='#2D95DB'>Display iOS Interstitials</font> ==<br />
To display iOS Interstitials on your iOS project, you need to follow the steps bellow:<br />
<br>In your '''ViewController.h''' file<br />
<br>- You need to import the '''A4GInterstitials.h''' header file.<br />
<br>- Declare an Object of A4GInterstitials.<br />
<br>Your code need to be similar to this:<br />
<dd><font color='brown'>#import</font> <font color='red'><A4GPub/A4GInterstitials.h></font><br />
<font color='magenta'>@interface</font> TestViewController : <font color='#9A2EFE'>UIViewController</font> {<br />
<font color='#9A2EFE'>A4GInterstitials</font> *a4gInter;<br />
}<br />
<font color='magenta'>@end</font><br />
<br />
'''In your ViewController.m file'''<br />
<br />
- In your '''viewDidLoad''' method, you need to instantiate the object created on your ViewController.h file and call the differents method to display Interstitials.<br />
<br>The methods are:<br />
<br />
<br>'''* setZoneID''' method, allows you to set the zoneID.<br />
<br>'''* showA4GInterstitials''' method, to display directly the Interstitials when the app started.<br />
<br>'''* showA4GInterstitialsWithStartTime''' method, to display the interstitials after a certain time.<br />
<br>'''* showA4GInterstitialsWithStartAndEndTime''' method, to display the interstitials after a certain time, and close them automatically after a certain time.<br />
<br>Your code need to be similar to this:<br />
<br />
<dd><font color='magenta'>@implementation</font> TestViewController<br />
–(<font color='magenta'>void</font>)viewDidLoad<br />
{<br />
[<font color='magenta'>super</font> <font color='#9A2EFE'>viewDidLoad</font>];<br />
<font color='green'>a4gInter</font> = [[<font color='#9A2EFE'>A4GInterstitials</font> alloc] init];<br />
[<font color='green'>a4gInter</font> <font color='#9A2EFE'>setZoneID</font> : @"yourZoneID"];<br />
[<font color='green'>a4gInter</font> <font color='#9A2EFE'>showA4GInterstitials</font>]; <font color='green' size=1>//Display Interstitials directly when the app started</font>.<br />
[<font color='green'>a4gInter</font> <font color='#9A2EFE'>showA4GInterstitialsWithStartTime</font>:<font color='blue'>15</font>]; <font color='green' size=1>//Display Interstitials after 15 seconds</font>.<br />
[<font color='green'>a4gInter</font> <font color='#9A2EFE'>showA4GInterstitialsWithStartAndEndTime</font> : <font color='blue'>10</font> <font color='#9A2EFE'>withArg2</font> : <font color='blue'>30</font>]; <font color='green' size=1>//Display Interstitials after 10 seconds and close them automatically after 30 seconds</font>.<br />
}<br />
<br />
= <font color='green'>Advertisers</font> =<br />
== <font color='#2D95DB'>Download iOS SDK</font> ==<br />
Download the [[http://developer.ad4game.com/download/iOS/Track_IOS_SDK_1.0.zip iOS SDKv1.0 for advertisers]]. Decompress the zip file and extract the files to your development mac.<br />
<br>The Ad4game iOS SDK is provided as a single framework file ('''A4GTrack.framework'''), making it easy to include in your iOS project.<br />
<br />
== <font color='#2D95DB'>Include the A4GTrack.framework</font> ==<br />
To include the A4GTrack.framework to your xcode project, you need to select your target project, and then go to '''Build Phases → Link Binary With Libraries''', then <br />
click on the '''+''' sign '''→ Add Other''', and select the A4GTrack.framework saved on your mac as shown below:<br />
<br><img>http://developer.ad4game.com/download/iOS/A4GFramework.png</img><br />
<br />
== <font color='#2D95DB'>Include the AdSupport.framework</font> ==<br />
You need to include the AdSupport.framework to your project target to enable the Advertiser Identifier functionality.<br />
<br>Go to '''Build Phases → Link Binary With Libraries''', then click on the '''+''' sign to add the AdSupport.framework as shown below:<br />
<br><img>http://developer.ad4game.com/download/iOS/AdSupport.png</img><br />
<br>Then, change the value of AdSupport.framework from Required to '''Optional'''.<br />
<br />
== <font color='#2D95DB'>Include the SystemConfiguration.framework</font> ==<br />
You need to include the '''SystemConfiguration.framework''' to your project target to enable detection of the internet availability.<br />
<br>Go to '''Build Phases → Link Binary With Libraries''', then click on the '''+''' sign to add the SystemConfiguration.framework.<br />
== <font color='#2D95DB'>Tracking installations</font> ==<br />
In your '''appDelegate.m''', you need to import the '''A4GTrack.framework'''<br />
<br><font color='brown'>#import</font> <font color='brown'><A4GTrack/A4GTrackViewController.h></font><br />
<br>In your '''didFinishLaunchingWithOptions''' method, you need to call the '''trackInstall''' method thatallow you tracking installations once per user.<br />
<br>[ <font color='#9A2EFE'>A4GTrackViewController</font> <font color='blue'>trackInstall</font>:<font color='red'>@"yourTrackerID"</font>].<br />
= <font color='#2D95DB'>Contact</font> =<br />
<br />
If you've got questions, we've got answers!<br />
Please Contact Us at <font color='blue'>tech@ad4game.com</font> with any technical queries.</div>Mostaphahttp://developer.ad4game.com/index.php/AndroidAndroid2013-08-13T10:27:08Z<p>Mostapha: </p>
<hr />
<div><img>http://developer.ad4game.com/images/android-logo-white-2.png</img><br />
= <font color='green'>Publishers</font> =<br />
== <font color='#2D95DB'>Download Android SDK</font> ==<br />
<h5><font color='red'>What's new!</font></h5><br />
<br>The new Android SDK v4.0 supports now <b>Google’s Advertising Identifier</b><br />
<br>The new Android SDK v4.0 allows you to handle ads events.<br />
<br>Download the [[http://developer.ad4game.com/download/Android/Pub_AndroidSDK_4.0.zip Android SDKv4.0 for publishers]]. Decompress the zip file and extract the files to your development computer. <br />
<br>The Android SDK is provided as a single java JAR file ('''AndroidSDKPublisher4.0.jar'''), making it easy to include in your Android project.<br />
<br />
== <font color='#2D95DB'>Configure AndroidManifest.xml</font> ==<br />
The SDK requires the following permissions. Put these in before closing the manifest tag. <br />
<br><br>'''Internet Permission (Mandatory):''' <br />
<br>The Internet permission is required to connect to publishing servers. <br />
<br><br><<font color='green'>uses-permission</font> <font color='magenta'>android:name</font>="<font color='blue'>android.permission.INTERNET</font>"/><br />
<br><br>'''Wifi State Permission (Recommended):''' <br />
<br>This permission enable the SDK to access information about whether you are connected to a WiFi network and obtain the device’s MAC address.<br />
<br><br><<font color='green'>uses-permission</font> <font color='magenta'>android:name</font>="<font color='blue'>android.permission.ACCESS_WIFI_STATE</font>" /><br />
<br><br>'''Connection Type Permission (Recommended):''' <br />
<br>This permission enable the SDK to detect if you are connected from a WiFi network or 3G network.<br />
<br><br><<font color='green'>uses-permission</font> <font color='magenta'>android:name</font>="<font color='blue'>android.permission.ACCESS_NETWORK_STATE</font>" /><br />
<br><br>'''Tasks Permission (Mandatory):''' <br />
<br>Allows the SDK to get information about the currently or recently running tasks to set the refresh value. <br />
<br><br><<font color='green'>uses-permission</font> <font color='magenta'>android:name</font>="<font color='blue'>android.permission.GET_TASKS</font>" /><br />
<br><br>'''Google’s Advertising Identifier (Mandatory):'''<br />
<br>Allows the SDK to get Google's Advertising Identifier.<br />
<br>Open your manifest file and add the following tag as a child of the <font color='blue'><application></font> element:<br />
<font color='green'><meta-data</font> <font color='magenta'>android:name=</font><font color='blue'>"com.google.android.gms.version"</font><br />
<font color='magenta'>android:value=</font><font color='blue'>"@integer/google_play_services_version"</font> <font color='green'>/></font><br />
<br />
== <font color='#2D95DB'>Install the Android SDK</font> ==<br />
Add '''AndroidSDKPublisher4.0.jar''' to your Android project's build path. <br />
<br>If you are using Eclipse, right click on your '''project folder > Properties > Java Build Path > Libraries > Add JARs'''.<br />
<br>(As of ADT 17.0, you can simply place '''AndroidSDKPublisher4.0.jar''' in a folder called “libs” in your project directory and Eclipse will automatically include the jar as part of the build under the classpath container “Android Dependencies”) .<br />
<br />
== <font color='#2D95DB'>Display Mobile Ads</font> ==<br />
To display mobile ads inside your android application, you need to set the value of <font color='blue'>"refresh"</font> variable to refresh banners.<br />
<br>You'll then need to instantiate the A4GPublisher class to allow you to call the functions from the AndroidSDKPublisher. <br />
<br>Generally, the code is placed inside your main activity’s onCreate(Bundle) method. <br />
<br>You will need to pass the layout ID to the '''findViewById''' method, and then call '''loadZoneId'''(“'''ZoneID'''”) method.<br />
<br><br><font color='magenta'>public class</font> MyClass <font color='magenta'>extends</font> Activity {<br />
<br><dd><font color='magenta'>public static int</font> <font color='blue'>refresh</font> = 30000; <font color='green'>//30 seconds</font><br />
<br><font color='#676A6C'>@Override</font><br />
<br><font color='magenta'>protected void</font> onCreate(Bundle savedInstanceState) {<br />
<br><dd><font color='magenta'>super</font>.onCreate(savedInstanceState);<br />
<br>setContentView(R.layout.<font color='blue'>activity_a4g</font>);<br />
<br>A4GPublisher widget = (A4GPublisher) findViewById(R.id.<font color='blue'>yourLayoutID</font>);<br />
<br>widget.loadZoneId("<font color='blue'>ZoneID</font>"); <br />
<br>}<br />
<br>}<br />
<br />
<br>In your '''layout.xml''' file, you need to include the properties of the layout where you want to display the banners as follows<br />
<br />
<br><font color='green'><com.a4gpublisher.A4GPublisher</font><br />
<br><font color='magenta'>android:id</font>=<font color='blue'>"@+id/yourLayoutID"</font><br />
<br><font color='magenta'>android:id</font>=<font color='blue'>"@+id/yourLayoutID"</font> <br />
<br><font color='magenta'>android:layout_width</font>=<font color='blue'>"350dp"</font><br />
<br><font color='magenta'>android:layout_height</font>=<font color='blue'>"250dp"</font> <br />
<br>...<br />
<br><font color='green'>/></font><br />
<br><br><font color='red'>Note:</font> You can add many zones as you want, just instantiate the A4GPublisher object to create many widgets.<br />
<br><br><font color='red'>Example:</font><br />
<br>A4GPublisher <font color='#676A6C'>widget1</font> = (A4GPublisher) findViewById(R.id.<font color='blue'>yourFirstLayoutID</font>);<br />
<br><font color='#676A6C'>widget1</font>.loadZoneId("<font color='blue'>ZoneID</font>"); <br />
<br><br>A4GPublisher <font color='#676A6C'>widget2</font> = (A4GPublisher) findViewById(R.id.<font color='blue'>yourSecondLayoutID</font>);<br />
<br><font color='#676A6C'>widget2</font>.loadZoneId("<font color='blue'>ZoneID</font>");<br />
=== <font color='#2D95DB'>Handling Events</font> ===<br />
If you want to handle ads events, you need to call '''A4GListener''' interface that includes '''onAdLoaded''', '''onAdFailed''' and '''onAdClicked''' methods as follow :<br />
A4GPublisher widget = (A4GPublisher)findViewById(R.id.a4glayoutid);<br />
widget.loadZoneId(<font color='blue'>"ZoneID</font>");<br />
widget.'''setA4GListener'''(new A4GListener() {<br />
<font color='grey'>@Override</font><br />
<font color='magenta'>public void</font> onAdLoaded() {<br />
<font color='green'>//Do your treatment</font><br />
}<br />
<font color='grey'>@Override</font><br />
<font color='magenta'>public void</font> onAdFailed() {<br />
<font color='green'>//Do your treatment</font><br />
}<br />
<font color='grey'>@Override</font><br />
<font color='magenta'>public void</font> onAdClicked() {<br />
<font color='green'>//Do your treatment</font><br />
}<br />
});<br />
<br />
== <font color='#2D95DB'>Display Android Editorials</font> ==<br />
To display Android Editorials inside your android application, you need to instantiate the A4GEditorial class to allow you to call the functions from the AndroidSDKPublisher.<br />
<br>You need to use one of the three methods (you can use all of them) bellow:<br />
<br>'''1- showA4GEdito :''' If you want to display the editorials once the activity's started.<br />
<br>'''2- showA4GEditoWithStartTime :''' If you want to display the editorials after certain time.<br />
<br>'''3- showA4GEditoWithStartAndEndTime :''' If you want to display the editorials after certain time and close them automatically after certain time. <br />
<br>'''4- showA4GEditoOnClick :''' If you want to display the editorials when the user click on a button.<br />
<dd><font color='red'>'''Note:'''</font> The three first methods mentioned above are valid only if your project target android '''3.0''' or above, '''showA4GEditoOnClick''' is <br>valid from android '''2.3''' or above.<br />
<br>To use one of the three methods mentioned above, you need to define a View and assign it to the A4GEditorial object like shown bellow:<br />
<dd><font color='magenta'>'''protected void'''</font> onCreate(Bundle savedInstanceState) {<br />
<font color='magenta'>'''super'''</font>.onCreate(savedInstanceState);<br />
setContentView(<font color='blue'>R.layout.activity_main</font>);<br />
A4GEditorial <font color='blue'>a4gEdito</font> = <font color='magenta'>new</font> A4GEditorial(getApplicationContext());<br />
a4gEdito.setZoneid("<font color='blue'>zoneID</font>");<br />
View v = findViewById(R.id.<font color='blue'>yourView</font>); <font color='green'>// a textView or any composant that you use inside your activity</font><br />
<font color='blue'>a4gEdito</font>.setVue(v);<br />
<font color='blue'>a4gEdito</font>.showA4GEdito(getApplicationContext());<br />
<font color='blue'>a4gEdito</font>.showA4GEditoWithStartTime(getApplicationContext(), <font color='blue'>5000</font>);<br />
<font color='blue'>a4gEdito</font>.showA4GEditoWithStartAndEndTime(getApplicationContext(), <font color='blue'>3000</font>, <font color='blue'>10000</font>);<br />
}<br />
<br>To use '''showA4GEditoOnClick''' function, you need to define a button and assign it to the A4GEditorial object like shown below:<br />
Button <font color='blue'>myButton</font> = (Button)findViewById(<font color='blue'>R.id.yourButton</font>);<br />
<font color='blue'>a4gEdito</font>.setButton(<font color='blue'>myButton</font>);<br />
<font color='blue'>a4gEdito</font>.showA4GEditoOnClick(getApplicationContext());<br />
<br />
=== <font color='#2D95DB'>Handling Events</font> ===<br />
If you want to handle editorials events, you need to call '''A4GEditoListener''' interface that includes '''onEditorialLoaded''', '''onEditorialFailed''', '''onEditorialClicked''' and '''onEditorialClosed''' methods as follow:<br />
<br />
A4GEditorial ag4Edito = <font color='magenta'>new</font> A4GEditorial(getApplicationContext());<br />
ag4Edito.setZoneid(<font color='blue'>"43516</font>");<br />
ag4Edito.setVue(txt);<br />
ag4Edito.setA4GEditoListener(new A4GEditoListener() {<br />
<font color='grey'>@Override</font><br />
<font color='magenta'>public void</font> onEditorialLoaded() {<br />
<font color='green'>//Do your treatment</font><br />
}<br />
<font color='grey'>@Override</font><br />
<font color='magenta'>public void</font> onEditorialFailed() {<br />
<font color='green'>//Do your treatment</font><br />
}<br />
<font color='grey'>@Override</font><br />
<font color='magenta'>public void</font> onEditorialClicked() {<br />
<font color='green'>//Do your treatment</font><br />
}<br />
<font color='grey'>@Override</font><br />
<font color='magenta'>public void</font> onEditorialClosed() {<br />
<font color='green'>//Do your treatment</font><br />
}<br />
});<br />
ag4Edito.showA4GEdito(getApplicationContext());<br />
ag4Edito.showA4GEditoWithStartTime(getApplicationContext(), 10000);<br />
ag4Edito.showA4GEditoWithStartAndEndTime(getApplicationContext(), 10000, <br />
20000);<br />
<br />
== <font color='#2D95DB'>Display Android Interstitials</font> ==<br />
To display Android Interstitials ('''simple''' version or '''html5''' version) inside your android application, you need to instantiate the '''A4GInterstitials''' class to allow you to call the functions from the AndroidSDKPublisher.<br />
<br>you need to use one of the three methods (you can use all of them) bellow:<br />
<br><br>'''1- showA4GInterstitials :''' If you want to display the interstitials once the activity's started.<br />
<br>'''2- showA4GInterstitialsWithStartTime :''' If you want to display the interstitlas after certain time.<br />
<br>'''3- showA4GInterstitialsWithStartAndEndTime :''' If you want to display the interstitials after certain time and close it automatically after certain time.<br />
<br><br>To use one of the three methods mentioned above, you need to define a View and assign it to the A4GInterstitials object like shown bellow:<br />
<dd><font color='magenta'>'''protected void'''</font> onCreate(Bundle savedInstanceState) {<br />
<font color='magenta'>'''super'''</font>.onCreate(savedInstanceState);<br />
setContentView(<font color='blue'>R.layout.activity_main</font>);<br />
A4GInterstitials <font color='blue'>a4gInter</font> = <font color='magenta'>new</font> A4GInterstitials(getApplicationContext());<br />
a4gInter.setZoneid("<font color='blue'>zoneID</font>");<br />
View v = findViewById(R.id.<font color='blue'>yourView</font>); <font color='green' size=1>// a textView or any composant that you use inside your activity</font><br />
<font color='blue'>a4gInter</font>.setVue(v);<br />
<font color='blue'>a4gInter</font>.showA4GInterstitials(getApplicationContext());<br />
<font color='blue'>a4gInter</font>.showA4GInterstitialsWithStartTime(getApplicationContext(), <font color='blue'>5000</font>);<br />
<font color='blue'>a4gInter</font>.showA4GInterstitialsWithStartAndEndTime(getApplicationContext(), <font color='blue'>3000</font>, <font color='blue'>10000</font>);<br />
}<br />
=== <font color='#2D95DB'>Handling Events</font> ===<br />
If you want to handle interstitials events, you need to call '''A4GInterListener''' interface that includes '''onInterstitialLoaded''', '''onInterstitialFailed''', '''onInterstitialClosed''' and '''onInterstitialClicked''' methods as follow:<br />
<br />
<br />
A4GInterstitials a4gInter = <font color='magenta'>new</font> A4GInterstitials(getApplicationContext());<br />
a4gInter.setZoneid(<font color='blue'>"43517"</font>, getApplicationContext());<br />
a4gInter.setVue(txt);<br />
a4gInter.setA4GInterListener(new A4GInterListener() {<br />
<font color='grey'>@Override</font><br />
<font color='magenta'>public void</font> onInterstitialLoaded() {<br />
<font color='green'>//Do your treatment</font><br />
}<br />
<font color='grey'>@Override</font><br />
<font color='magenta'>public void</font> onInterstitialFailed() {<br />
<font color='green'>//Do your treatment</font><br />
}<br />
<font color='grey'>@Override</font><br />
<font color='magenta'>public void</font> onInterstitialClosed() {<br />
<font color='green'>//Do your treatment</font><br />
}<br />
<font color='grey'>@Override</font><br />
<font color='magenta'>public void</font> onInterstitialClicked() {<br />
<font color='green'>//Do your treatment</font><br />
}<br />
});<br />
a4gInter.showA4GInterstitials(getApplicationContext());<br />
a4gInter.showA4GInterstitialsWithStartTime(getApplicationContext(), 10000);<br />
a4gInter.showA4GInterstitialsWithStartAndEndTime(getApplicationContext(), <br />
10000, 20000);<br />
<br />
= <font color='green'>Advertisers</font> =<br />
== <font color='#2D95DB'>Download Android SDK</font> ==<br />
<h5><font color='red'>What's new!</font></h5><br />
<br>The new Android SDK v2.0 supports now <b>Google’s Advertising Identifier</b><br />
<br>Download the [[http://developer.ad4game.com/download/Android/Track_AndroidSDK_2.0.zip Android SDKv2.0 for advertisers]]. Decompress the zip file and extract the files to your development computer. <br />
<br>The Android SDK is provided as a single java JAR file ('''AndroidSDKTracker2.0.jar'''), making it easy to include in your Android project.<br />
<br />
== <font color='#2D95DB'>Install the Android SDK</font> ==<br />
<br />
Add '''AndroidSDKTracker2.0.jar''' to your Android project's build path. <br />
<br>If you are using Eclipse, right click on your '''project folder > Properties > Java Build Path > Libraries > Add JARs'''.<br />
<br>(As of ADT 17.0, you can simply place '''AndroidSDKTracker2.0.jar''' in a folder called “libs” in your project directory and Eclipse will automatically include the jar as part of the build under the classpath container “Android Dependencies”) .<br />
<br />
== <font color='#2D95DB'>Configure AndroidManifest.xml</font> ==<br />
<br />
The SDK requires the following permissions. Put these in before closing the manifest tag. <br />
<br><br>'''Internet Permission (Mandatory):''' <br />
<br>The Internet permission is required to connect to tracking servers. <br />
<br><br><<font color='green'>uses-permission</font> <font color='magenta'>android:name</font>="<font color='blue'>android.permission.INTERNET</font>"/><br />
<br><br>'''Wifi State Permission (Mandatory):''' <br />
<br>This permission enable the SDK to access information about whether you are connected to a WiFi network and obtain the device’s MAC address.<br />
<br><br><<font color='green'>uses-permission</font> <font color='magenta'>android:name</font>="<font color='blue'>android.permission.ACCESS_WIFI_STATE</font>" /><br />
<br><br>'''Connection State Permission (Mandatory):''' <br />
<br>This permission enable the SDK to track installations when the user is connected to internet.<br />
<br><br><<font color='green'>uses-permission</font> <font color='magenta'>android:name</font>="<font color='blue'>android.permission.ACCESS_NETWORK_STATE</font>" /><br />
<br><br>'''Google’s Advertising Identifier (Mandatory):'''<br />
<br>Allows the SDK to get Google's Advertising Identifier.<br />
<br>Open your manifest file and add the following tag as a child of the <font color='blue'><application></font> element:<br />
<font color='green'><meta-data</font> <font color='magenta'>android:name=</font><font color='blue'>"com.google.android.gms.version"</font><br />
<font color='magenta'>android:value=</font><font color='blue'>"@integer/google_play_services_version"</font> <font color='green'>/></font><br />
<br />
<br>The SDK requires setting up a Tracker receiver in your Android manifest. Put this receiver inside your application tags. <br />
<br>'''Install Referral (Required):'''<br />
<br>Gives the SDK access to the install referrer value from Google Play Store. <br />
<br><br><font color='green'><receiver</font> <font color='magenta'>android:name</font>="<font color='blue'>com.mypackage.MyReceiverClass</font>" <font color='magenta'>android:exported</font>=<font color='blue'>"true"</font>><br />
<br />
<br><dd><font color='green'><intent-filter></font><br />
<br><font color='green'><action</font> <font color='magenta'>android:name</font>="<font color='blue'>com.android.vending.INSTALL_REFERRER</font>" /><br />
<br><font color='green'></intent-filter></font><br />
<br><font color='green'></receiver></font><br />
<br />
<br>You need to create your ReceiverClass as follow:<br />
<br>yourReceiverClass extends the '''BroadcastReceiver'''. Inside the '''onReceive''' method, you need to instantiate the '''A4GTracking''' class, and then call the '''trackInstall''' method which has these parameters trackerID, context and intent.<br />
<br />
<br><font color='magenta'>public class</font> MyReceiverClass <font color='magenta'>extends</font> BroadcastReceiver{<br />
<br><dd><font color='#676A6C'>@Override</font><br />
<br><font color='magenta'>public void</font> onReceive(Context context, Intent intent) {<br />
<br><font color='#2D95DB'>//Begin of tracking installs</font><br />
<br>A4GTracking a4g = <font color='magenta'>new</font> A4GTracking(context);<br />
<br>a4g.trackInstall("<font color='blue'>yourTrackerID</font>", context, intent);<br />
<br><font color='#2D95DB'>// End of tracking installs</font><br />
<br>}<br />
<br>}<br />
<br />
<br>In your '''onCreate''' method, you need to instantiate the '''A4GTracking''' class to allow you to call the functions from the AndroidSDKTracker.<br />
<br />
<br><br><font color='magenta'>public class</font> MyActivity <font color='magenta'>extends</font> Activity {<br />
<br><dd><font color='#676A6C'>@Override</font><br />
<br><font color='magenta'>protected void</font> onCreate(Bundle savedInstanceState) {<br />
<br><font color='magenta'>super</font>.onCreate(savedInstanceState);<br />
<br>setContentView(R.layout.<font color='blue'>activity_main</font>);<br />
<br><font color='#2D95DB'>//Begin of tracking installs</font><br />
<br>//Instantiate the A4GTracking class<br />
<br>A4GTracking a4g = <font color='magenta'>new</font> A4GTracking(getApplicationContext());<br />
<br>a4g.trackInstall("<font color='blue'>yourTrackerID</font>", getApplicationContext(), null);<br />
<br><font color='#2D95DB'>// End of tracking installs</font><br />
<br>}<br />
<br>}<br />
<br />
= <font color='#2D95DB'>Contact</font> =<br />
<br />
If you've got questions, we've got answers!<br />
Please Contact Us at <font color='blue'>tech@ad4game.com</font> with any technical queries.</div>Mostaphahttp://developer.ad4game.com/index.php/Main_PageMain Page2013-08-12T16:01:52Z<p>Mostapha: </p>
<hr />
<div>This Developer Resource Center outlines the Android SDK, iOS SDK and Unity Plugins allowing you to track installations, displaying mobile ads, mobile editorials and mobile Interstitials inside your mobile applications.<br />
Today users expect the same highquality experience regardless of device and if they don't get it, they blame your brand. This is why we use '''Akamai number 1 CDN world wide''' to display your ads.<br />
<br><img>http://developer.ad4game.com/images/android-logo-white-2.png</img><br />
<br>The Android SDK v3.0 allows tracking installations, displaying mobile ads, mobile editorials and mobile Interstitials inside android applications.<br />
<br>The current version of the Android SDK is compatible with Android 2.3 and above.<br />
<br><img>http://developer.ad4game.com/images/ios.jpg</img><br />
<br>The iOS SDK v3.0 allows tracking installations, displaying mobile ads, mobile editorials and mobile interstitials inside iOS applications. <br />
<br>The current version of the iOS SDK is compatible with iOS 4.3 and above.<br />
<br><img>http://developer.ad4game.com/images/Unity-Logo.jpg</img><br />
<br>the Android Unity Plugin v3.0 allows tracking, displaying mobile ads, Editorials and Interstitials inside android and iOS applications developed by Unity.<br />
<br>The current version of the Unity Plugin is compatible with Android 2.3, iOS 4.3 and above.</div>MediaWiki default