How To‎ > ‎

iOS Manual Integration

COPY SDK FILES

1. Copy  “SVGMediaAd.framework” 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) libsqlite3.0.dylib

  B) libz.1.2.5.dylib

OTHER LINKER FLAGS

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

   -ObjC

ADD A KEY IN Info.Plist 

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

    NSLocationAlwaysUsageDescription

4.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>

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


IMPORT FILE

5. Import following module in your class file wherever you have implemented Seventynine SDK code.

    Objective-C

        @import SVGMediaAd;

    Swift

        import SVGMediaAd

ADDING PUBLISHER ID FOR ADS

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

Objective-C

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

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

    // Your app code ......

    return YES

}


Swift

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {

        SNADViewManager.setRunTimeConfigration([SNpublisherId : "PUBLISHER_ID"])

        // Your app code ......

        return true

}


ADDING HEADER & FOOTER ADS

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

Objective-C

- (void)viewDidLoad {

    [super viewDidLoad];

    // For footer Ads and its optional for footer as it is default value

    NSMutableDictionary *options = [NSMutableDictionary dictionary];

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

    // For header set value @(SmallViewTypeHeader)

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

    // YOUR EXISTING CODE HERE …

 }

    

Swift

override func viewDidLoad() {

    super.viewDidLoad()

    // For footer Ads and its optional for footer as it is default value

    var options: [String : Any] = [kSNADVariable_BannerType : SmallViewTypeFooter]
    // For header set value SmallViewTypeHeader

    SNADViewManager.showNativeOrBannerAd(in: self.view, isBanner: true, 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

Objective-C

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

adView.frame = CGRectMake(0, 100, 320, 50);

[self.view addSubView:adView];

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

Swift

let adView = UIView()

adView.frame = CGRect(x: 0, y: 100, width: 320, height: 50)

view.addSubview(adView)

SNADViewManager.showNativeOrBannerAd(in: adView, isBanner: true, priority: nil, viewController: self, options: nil, targetCondition: nil)


DISPLAY FULL SCREEN  ADS WITHIN APPLICATION

8. 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.

Objective-C

- (void)showAd {

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

    if (showAd) {

      //call points 1 or 2 here

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

    showAd = NO;

   }

}

 
Swift

func showAdd() {

    var showAd = true  // You can handle this variable in your viewcontroller making a static var

    if (showAd) {

        //call points 1 or 2 here

        SNADViewManager.showFullScreenAd(in: self, priority: nil, options: nil, targetCondition: nil)

        showAd = false

    }

}


and call this in viewDidAppear method

1. For Simple Ads 

For ads only call this method: 

Objective-C

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


Swift

SNADViewManager.showFullScreenAd(in: 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 :

Objective-C


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

// For OPTIONS_NSDICTIONARY_OBJECT and CONDITIONS_NSDICTIONARY_OBJECT see below 


Swift

SNADViewManager.showFullScreenAd(in: self, priority: nil, options: (OPTIONS_DICTIONARY_TYPE), targetCondition: (CONDITIONS_DICTIONARY_TYPE))

// For OPTIONS_DICTIONARY_TYPE and CONDITIONS_DICTIONARY_TYPE see below 


NATIVE AD WITHIN APPLICATION

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

1. For Simple Ads 

For ads only call this method: 

Objective-C


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

adView.frame = CGRectMake(0, 100, 320, 250);

[self.view addSubView:adView];

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


Swift

let adView = UIView()

adView.frame = CGRect(x: 0, y: 100, width: 320, height: 250)

view.addSubview(adView)

SNADViewManager.showNativeOrBannerAd(in: adView, isBanner: false, 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 :

Objective-C


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

// For OPTIONS_NSDICTIONARY_OBJECT and CONDITIONS_NSDICTIONARY_OBJECT see below 


Swift

SNADViewManager.showNativeOrBannerAd(in: adView, isBanner: false, priority: nil, viewController: self, options: (OPTIONS_DICTIONARY_TYPE)  targetCondition: (CONDITIONS_DICTIONARY_TYPE))

// For OPTIONS_DICTIONARY_TYPE and CONDITIONS_DICTIONARY_TYPE see below


TARGETTING IN ADS

Objective-C

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

Swift

SNADViewManager.showFullScreenAd(in: self, priority: nil, options: nil, targetCondition:(CONDITIONS_DICTIONARY_TYPE))


CONDITIONS_NSDICTIONARY_OBJECT (or CONDITIONS_DICTIONARY_TYPE) 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 (or OPTIONS_DICTIONARY_TYPE) 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. 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"

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

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

P. 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.

Objective-C

[SNADViewManager playAudioWithZoneId:nil adId:nil delegate:nil targetCondition: nil];


Swift

SNADViewManager.playAudio(withZoneId: nil, adId: nil, delegate: nil, targetCondition: nil)

Subpages (1): FAQ
ċ
iOS Seventynine Ad SDK Version 1.2.6.zip
(7912k)
Ankush Mishraa,
May 5, 2016, 6:23 AM
Comments