SDK Ads iOS

From wiki.taptica.com
(Difference between revisions)
Jump to: navigation, search
(Calling the TapticaAd™ iOS SDK)
Line 98: Line 98:
 
It is possible to request full screen ad while banner ad are displaying.
 
It is possible to request full screen ad while banner ad are displaying.
 
When requesting full screen while banner ad displaying the banner ad will be paused and not refreshed.
 
When requesting full screen while banner ad displaying the banner ad will be paused and not refreshed.
 +
 +
 +
 +
== Common Classes ==
 +
The API in the SDK is composed of 2 basic classes:
 +
 +
1.'''TapticaAdView'''– an ad view that simply shows an ad. This view only shows an ad after you have requested an ad. It is implemented using requestAd or requestFullScreenAd
 +
 +
2.'''TapticaAdManager'''– a module class that manages all TapticaAdView class instances and the extra data that can be transferred to the server for each ad request.
 +
 +
'''TapticaAdManager Mandatory Methods'''
 +
    - (BOOL)setTapticaAdApplicationID:(NSString*)appID;
 +
Sets the application ID (appID) as generated in the TapticaDevelopment Site.

Revision as of 15:46, 21 August 2012

Contents

Steps to Integration

To integrate with TapticaAd™ SDK, follow these steps: 1. Application/Site Id – Retrieve your app/site Id from Taptica’s account manager. 2. Download TapticaAd™ iOS SDK – download the iOS SDK from the Tapticadeveloper’s website. 3. Implement TapticaAd™ iOS SDK – implement the iOS SDK in your app so that it can be used. 4. Call TapticaAd™ iOS SDK – perform ad requests.


Application/Site ID Taptica Ad

Retrieve your Application Id from Taptica’s account manager or register to the TapticaAd™ service via Taptica’s website – http://taptica.com. At the end of the process you will acquire an Application ID. Save it for future use, it will be needed when identifying your application/site while using the TapticaAd™ iOS SDK.


Downloading TapticaAd™ iOS SDK

Following download, you can extract the downloaded file which contains the following items:

1.Static Library: libTapticaAd.a

2.Header file: TapticaAd.h

3.Sample project

Implementing TapticaAd™ iOS SDK

To implement the TapticaAd™ iOS SDK:

1. Use the system Finder to drag the unzipped SDK folder into your project.

2. Drag and drop the folder to your project xcode group tree.

3. Update your application delegate header file with:


    #import "TapticaAd.h"
        TapticaAdManager *TapticaAdManager;

For example:

    #import <UIKit/UIKit.h>
    #import "TapticaAd.h"
    @class TapticaAdTestViewController;
    @interface TapticaAdTestAppDelegate : NSObject <UIApplicationDelegate> {
      UIWindow *window;
      TapticaAdTestViewController *viewController;
      TapticaAdManager *TapticaAdManager;
    }
    @property (nonatomic, retain) TapticaAdManager *TapticaAdManager;
    @property (nonatomic, retain) IBOutlet UIWindow *window;
    @property (nonatomic, retain) IBOutlet TapticaAdTestViewController *viewController;
    @end

4. Inside “"applicationDidFinishLaunching:" in your delegate m file add:

TapticaAdManager = [TapticaAdManager instance];

[TapticaAdManager setTapticaAdApplicationID:@"YOUR_APPLICATION_ID"];


For example:

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Override point for customization after application launch.
    TapticaAdManager = [TapticaAdManager instance];
    [TapticaAdManager setTapticaAdApplicationID:@"YOUR_APPLICATION_ID"];
    // Add the view controller's view to the window and display.
    [self.window addSubview:viewController.view];
    [self.window makeKeyAndVisible];
    return YES;
    }


Calling the TapticaAd™ iOS SDK

To call the TapticaAd™ iOS SDK:

1.In your view controller header add:

    #import "TapticaAd.h"
    TapticaAdView *TapticaAdView;


2.In your view controller m file inside viewDidLoad add:

    TapticaAdView = [[TapticaAdView alloc] init];
    CGRect frame = [[TapticaAdView view] frame];
    frame.origin.y = 412.0;//the frame.origin.y can be customized.
    [[TapticaAdView view] setFrame:frame];
    [self.view addSubview:[TapticaAdView view]];
    [TapticaAdView requestAdd];


For banner ad use:

    [TapticaAdView requestAd];

For full screen ad use:

    [TapticaAdView requestFullScreenAd];

When requesting banner ad, it will appear & refreshed until removed from super view. It is possible to request full screen ad while banner ad are displaying. When requesting full screen while banner ad displaying the banner ad will be paused and not refreshed.


Common Classes

The API in the SDK is composed of 2 basic classes:

1.TapticaAdView– an ad view that simply shows an ad. This view only shows an ad after you have requested an ad. It is implemented using requestAd or requestFullScreenAd

2.TapticaAdManager– a module class that manages all TapticaAdView class instances and the extra data that can be transferred to the server for each ad request.

TapticaAdManager Mandatory Methods

    - (BOOL)setTapticaAdApplicationID:(NSString*)appID;

Sets the application ID (appID) as generated in the TapticaDevelopment Site.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox