Difference between revisions of "IOS"

From Ad4Game Developers
Jump to: navigation, search
(Display Mobile Ads)
(Display Android Editorials)
Line 22: Line 22:
 
<br>Go to '''Build Phases → Link Binary With Libraries''', then click on the '''+''' sign to add the QuartzCore.framework.
 
<br>Go to '''Build Phases → Link Binary With Libraries''', then click on the '''+''' sign to add the QuartzCore.framework.
  
== <font color='#2D95DB'>Display Android Editorials</font> ==
+
== <font color='#2D95DB'>Display Mobile Ads</font> ==
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>You need to use one of the three methods (you can use all of them) bellow:
+
<br>'''1­- showA4GEdito :''' If you want to display the editorials once the activity's started.
+
<br>'''2­- showA4GEditoWithStartTime :''' If you want to display the editorials after certain time.
+
<br>'''3­- showA4GEditoWithStartAndEndTime :''' If you want to display the editorials after certain time and close them automatically after certain time.   
+
<br>'''4­- showA4GEditoOnClick :''' If you want to display the editorials when the user click on a button.
+
          <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>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:
+
          <dd><font color='magenta'>'''protected void'''</font> onCreate(Bundle savedInstanceState) {
+
              <font color='magenta'>'''super'''</font>.onCreate(savedInstanceState);
+
              setContentView(<font color='blue'>R.layout.activity_main</font>);
+
              A4GEditorial <font color='blue'>a4gEdito</font> = <font color='magenta'>new</font> A4GEditorial(getApplicationContext());
+
              a4gEdito.setZoneid("<font color='blue'>zoneID</font>");
+
              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>
+
              <font color='blue'>a4gEdito</font>.setVue(v);
+
              <font color='blue'>a4gEdito</font>.showA4GEdito(getApplicationContext());
+
              <font color='blue'>a4gEdito</font>.showA4GEditoWithStartTime(getApplicationContext(), <font color='blue'>5000</font>);
+
              <font color='blue'>a4gEdito</font>.showA4GEditoWithStartAndEndTime(getApplicationContext(), <font color='blue'>3000</font>, <font color='blue'>10000</font>);
+
        }
+
<br>To use '''showA4GEditoOnClick''' function, you need to define a button and assign it to the A4GEditorial object like shown below:
+
        <dd>Button <font color='blue'>myButton</font> = (Button)findViewById(<font color='blue'>R.id.yourButton</font>);
+
        <font color='blue'>a4gEdito</font>.setButton(<font color='blue'>myButton</font>);
+
        <font color='blue'>a4gEdito</font>.showA4GEditoOnClick(getApplicationContext());
+

Revision as of 09:50, 13 August 2013

Contents

Publishers

Download iOS SDK

Download the [iOS SDK for publishers]. Decompress the zip file and extract the files to your development mac.
The Ad4game iOS SDK is provided as a single framework file (A4GPub.framework), making it easy to include in your iOS project.

Include the A4GPub.framework

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,
then click on the + sign → Add Other, and select the A4GPub.framework saved on your mac as shown below:

Include the AdSupport.framework

You need to include the AdSupport.framework to your project target to enable the Advertiser Identifier functionality. Go to Build Phases → Link Binary With Libraries, then click on the + sign to add the AdSupport.framework as shown below:

Then, change the value of AdSupport.framework from Required to Optional.

Include the SystemConfiguration.framework

You need to include the SystemConfiguration.framework to your project target to enable detection of the connection type. Go to Build Phases → Link Binary With Libraries, then click on the + sign to add the SystemConfiguration.framework.

Include the QuartzCore.framework

You need to include the QuartzCore.framework to your project target to customize the interface.
Go to Build Phases → Link Binary With Libraries, then click on the + sign to add the QuartzCore.framework.

Display Mobile Ads

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox