How To‎ > ‎

iOS Manual Integration


COPY SDK FILES

1. Copy the folder “libSeventynineAds” from the ZIP file in your project root directory and add reference to your project

ADD FRAMEWORKS

2. Add following frameworks to your project

  A) Audiotoolbox.framework

  B) SystemConfiguration.framework 

  C) CoreTelephony.framework
 

  D) CoreMedia.framework 

  E) AVFoundation.framework 

  F) libsqlite3.0.dylib

  G) CoreLocation.framework 

  H) AdSupport.framework

   I) MapKit.framework

   J) ImageIO.framework

  K) EventKit.framework

  L) EventKitUI.framework

  M) MediaPlayer.framework

  N) MessageUI.framework

  O) libz.1.2.5.dylib

LIBRARY SEARCH PATH

3. Include following path in your project settings under “Library Search Paths”

   $(SRCROOT)/libSeventynineAds

OTHER LINKER FLAGS

4. Include following flags in your project settings under “Other Linker Flags”

   -ObjC

ADD A KEY IN Info.Plist 

5. Add a key in your Project’s info.plist file for location access.

    NSLocationAlwaysUsageDescription

5.1 Add following in your Project's info.plist to allow not secure url from app

<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>

5.2 Add following in your Project's info.plist to allow permission for Camera, Calendar, Contact, Photo.


IMPORT FILE

6. Import following files in your class file wherever you have implemented Seventynine SDK code.

    #import “SNADViewManager.h” 

ADDING PUBLISHER ID FOR ADS

7. In order to register Ad SDK, you need to add following code in your AppDelegate 

 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:                (NSDictionary *)launchOptions {

        [SNADViewManager setRunTimeConfigration:@{SNpublisherId:@"PUBLISHER_ID"}];

         //  Above line of code call be the first line in this method 

        /* If you want tyroo ad please add two more key-value pair in configuration along with publisher id key SNAD_TyrooHashKey and value hash key given by Tyroo and key SNAD_TyrooWallAdEnable with value @"true"

please see below line of code.

    [SNADViewManager setRunTimeConfigration:@{SNpublisherId : @"PUBLISHER_ID", SNAD_TyrooHashKey : @"TYROO_HASH_KEY"}];

*/

    return YES

}

ADDING HEADER & FOOTER ADS

8. To show Ads on Header/Footer you need to copy-paste following code in “viewDidLoad” method of your App.

 - (void)viewDidLoad {

        [super viewDidLoad];

         //For Ads in Header    

    NSMutableDictionary *options = [NSMutableDictionary dictionary];

    [options setValue:@(SmallViewTypeHeader) forKey:kSNADVariable_BannerType];

     [SNADViewManager showNativeOrBannerAdInView:self.view isBanner:YES priority:nil           viewController:self options:options targetCondition:nil];


         //For Ads in Footer 

    [SNADViewManager showNativeOrBannerAdInView:self.view isBanner:YES priority:nil viewController:self options:options targetCondition:nil];                  // YOUR EXISTING CODE HERE …

 }

    To show banner anywhere on the screen, you have to make a view and pass in banner creation method as             below given example

 UIView *adView = [[UIView alloc] init]; 

 adView.frame = CGRectMake(x, y, w, h);

 [self.view addSubView:adView];

[SNADViewManager showNativeOrBannerAdInView:adView isBanner:YES priority:nil viewController:self options:nil targetCondition:nil];

DISPLAY FULL SCREEN  ADS WITHIN APPLICATION

9. Call below points 1 and 2 to show full screen ads within the application. You can place this code snippet on any button.

 For call directly during switch between view controller, put below method in your view controller class.

- (void)showAd {

    static BOOL showAd = YES;// You can handle this variable in your viewcontroller making a property

    if (YES) {

        //call points 1 or 2 here

       [SNADViewManager showFullScreenAdInViewController:self priority:nil options:nil                     targetCondition:nil];

        showAd = NO;

    }

}

 
and call this in viewDidAppear method

1. For Simple Ads 

For ads only call this method: 

  [SNADViewManager showFullScreenAdInViewController:self priority:nil options:nil           targetCondition:nil];

2. For Advance Ads
You can manage appearance of ad, type of ad and UI of ads to some extent. For this you have
to give options parameter in following api :

Set ad Priority-

NSArray *array = [NSArray arrayWithObjects:kSNADVP_TyrooFullScreen, kSNADVP_Seventynine, nil]; 

Possible Values: kSNADVP_TyrooFullScreen, kSNADVP_Seventynine.
Default Value: kSNADVP_Seventynine. 

[SNADViewManager showFullScreenAdInViewController:self priority:array options:(OPTIONS_NSDICTIONARY_OBJECT) targetCondition:(CONDITIONS_NSDICTIONARY_OBJECT)];


NATIVE AD WITHIN APPLICATION

10. Code below line of code to show native ad in the application. 

1. For Simple Ads 

For ads only call this method: 

UIView *adView = [[UIView alloc] init]; 
adView.frame = CGRectMake(x, y, w, h);

[self.view addSubView:adView];

[SNADViewManager showNativeOrBannerAdInView:adview isBanner:NO priority:nil viewController:self options:nil targetCondition:nil];


2. For Advance AdsYou can manage appearance of ad, type of ad and UI of ads to some extent. For this you have
to give options parameter in following api :
Set Ad Priority-

NSArray *array = [NSArray arrayWithObjects:kSNADVP_TyrooNativeDefault, kSNADVP_Seventynine, nil]; 

Possible Values: kSNADVP_TyrooNativeDefault,  kSNADVP_TyrooNativeGrid, kSNADVP_Seventynine.
Default Value: kSNADVP_Seventynine. 

[SNADViewManager showNativeOrBannerAdInView:adview isBanner:NO priority:nil viewController:self options:(OPTIONS_NSDICTIONARY_OBJECT) targetCondition:(CONDITIONS_NSDICTIONARY_OBJECT)];

TARGETTING IN ADS

[SNADViewManager showFullScreenAdInViewController:self priority:nil options:nil targetCondition:(CONDITIONS_NSDICTIONARY_OBJECT)];

CONDITIONS_NSDICTIONARY_OBJECT is dictionary contains key-value pair for getting targeted ads.
The keys can be like: id, lang, age, location and their value only location have specific value format in string (lat, lon, radius).


OPTIONS_NSDICTIONARY_OBJECT is dictionary contains your options with following key 
and every key is optional.

A. kSNADVariable_DelegateKey: By giving this key-value pair you can enable the delegate 
methods.

B. kSNADVariable_InAppBrowser: By giving this key-value pair you can manage click on 
ads page open in InAppBrowser or in Safari.  

          Possible Values: @"YES", @"NO".
          Default Value:  @"NO". 

C. kSNADVariable_ZoneIdKey: By giving this key-value pair you can manage actually what 
kind of ad you want. Its also give access to some extent.

       Possible Values: @"Enter Zone Id Provided By Sevntynine".

D. kSNADVariable_BackgroundColorKey: By giving this key-value pair you can provide 
background color for ad using UIColor class object.

      Sample Value: [UIColor redColor]. 

E. kSNADVariable_ThemeKey: By giving this key-value pair you can give a theme i.e. default 
or custom. It’s recommended if you provide black color for key  kSNADVariable_BackgroundColorKey use theme SeventynineAdThemeCustom.

         Possible Values: @(SeventynineAdThemeCustom), @(SeventynineAdThemeDefault).
         Default Value: @( SeventynineAdThemeDefault). 

F. kSNADVariable_DrawBorderKey: By giving this key-value you can choose to show border 
on video ad or not.

       Possible Values: @"YES", @"NO".
       Default Value:  @" YES". 

G. kSNADVariable_BorderAlphaKey: If border is shown in video ads then this key-value pair is 
used to set border alpha. You have to provide value using NSNumber class object.

       Possible Values: Value lies between 0.0 to 1.0. 

H.  kSNADVariable_AdIdKey: By giving this key-value, you control the delegate method call for which Ad. Value for key is a string object.

I.  kSNADVariable_AdLocationKey: Its prefered when you show ad for the first screen after app launch provide value @(SeventynineMainStreamAdLocationPre)  and for other location  @(SeventynineMainStreamAdLocationMid).

       Possible Values: @(SeventynineMainStreamAdLocationPre)@(SeventynineMainStreamAdLocationMid).
       Default Value:  @(SeventynineMainStreamAdLocationMid).
 
J.  kSNADVariable_CrossButtonKey: By giving this key-value pair you manage close ad button availability  in native video ad. For close button appear provide value @"YES" otherwise provide @"NO".
       Possible Values: @"YES"@"NO".
       Default Value:  @"YES".

K.  kSNADVariable_FixedViewRemovedFromSuperViewBySDKKey: By giving this key-value pair you manage view which provide by you to show native ad is disposed by sdk or yourself. If you want as ad finished view dispose by sdk provide value @"YES" otherwise provide @"NO".
       Possible Values: @"YES"@"NO".
       Default Value:  @"NO".

L.  kSNADVariable_VideoAdInitialAudioStateMuteKey: This key value pair provide initial audio state of video ad. If you want video start in mute state provide value @"YES" otherwise provide value @"NO" .
       Possible Values: @"YES"@"NO".
       Default Value:  @"NO".

M.  kSNADWallAdVariable_tyrooAdViewIdKey: This key-value pair is mandatory for tyroo ad to show provide value for key given by Tyroo.

N.  kSNADTyrooAdVariable_tyrooAdWallIdKey : his key-value pair is mandatory for tyroo ad to show provide value for key given by Tyroo.

O.  kSNADTyrooAdVariable_SizeKey: This key-value pair is for tyroo which defines how many ads we have to display in list/grid.

P. kSNADVariable_CrossButtonKey : By giving this key-value pair you can provide cross button for native ads. For cross button appear provide value @"YES" otherwise provide @"NO".
      Possible Values: @"YES", @"NO"
      Default Value: @"YES"

QkSNADVariable_BrandContent: By giving this key-value pair you can manage Logo. It can be set in three ways : Logo Image, Text, None
       Possible Values: @(SeventynineBrandContentNone),
                                @(SeventynineBrandContentImage),
                                @(SeventynineBrandContentText)
       Default Value:  @(SeventynineBrandContentText)

R. kSNADVariable_BannerType :  Add this key to show header or footer.
 Possible Values: @( SmallViewTypeHeader), @( SmallViewTypeFooter).
 Default Value: @( SmallViewTypeFooter). 

S. kSNADVariable_ClosePosition : Add this key to provide cross position.
Possible values: @(Top), @(Bottom)
Default Value: @(Top)

T. kSNADVariable_BrandPosition :  Add this key to manage logo position.
Possible values: @(Top), @(Bottom)
Default Value:  @(Bottom)

U. kSNADVariable_CrossAppearTime : By providing this key you can manage cross appear time in app.
Possible Values : @"number(like 0,1,2....)"
Default Value : available in banner.

PLAY AUDIO AD WITHIN APPLICATION

10. Code below line of code to play audio in the application. You can also place this code snippet on any button or call directly during switch between UIViewControllers.

[SNADViewManager playAudioWithZoneId:nil adId:nil delegate:nil];
Subpages (1): FAQ
ċ
iOS Seventynine Ad SDK Version 1.2.6.zip
(7912k)
Ankush Mishraa,
May 5, 2016, 6:23 AM
Comments