MobPartneriOSPublisherSDK 2.1.1

MobPartneriOSPublisherSDK 2.1.1

TestsTested
LangLanguage Obj-CObjective C
License Commercial
ReleasedLast Release Dec 2014

Maintained by Unclaimed.



 
Depends on:
MKNetworkKit~> 0.87
SDWebImage~> 3.5
 

  • By
  • Fabien Leroi

Introduction

MobSDK includes a software development kit (SDK) that enables you to promote other applications inside your app. This framework runs from iOS 5 onwards and supports the retina and non-retina iPhone/iPod resolutions.

Three distinct components are available in this SDK:

  • A banner that is presented as part of an app. It can appear once the app has been launched.

  • An interstitial that present an app. It can be launched when the app start or at any point during the app experience.

  • A MobWall a component that will present applications grouped by categories with a detail mode. This can be used as a modal view or include it in a tabbar.

Installation

Pod Installation

The preferred way of installation is via CocoaPods. Just add

platform :ios, '5.0'
pod 'MobPartneriOSPublisherSDK'

and run pod install. It will install the most recent version of Mobpartner iOS Publisher SDK.

You will find a demo project with pod installation: SDKPublisherDemoWithPod

Normal Installation

  • Add MobPartneriOSPublisherSDK.framework and MobPartneriOSPublisherSDK.bundle to your project.

  • In Build Phases, make sure its listed in Link Binary With Libraries, along with:

    • UIKit.framework
    • CoreFoundation.framework
    • Foundation.framework
  • In Build Settings:

    • Under Framework Search Paths make sure the (parent) directory to MobPartneriOSPublisherSDK.framework is listed.
    • Under Other Linker Flags in your target, add -ObjC and -all_load

Dependencies:

You just need to import the files coming from the following projects:

  • MKNetworkKit ~> 0.87 here

  • SDWebImage ~> 3.5 here

    You will find a demo project with normal installation: SDKPublisherDemoNoPod

Usage

  • Import the header in your .h:
#import <MobPartneriOSPublisherSDK/MobPartner.h>
  • Call the singleton to set your poolID:
[[MobPartner sharedManager] setPoolID:@"12345"];

MobPartner Banner

[[MobPartner sharedManager] createBannerWithCompletion:^(UIView *bannerView) {
        // add the bannerView where you want

    } error:^(NSError *error) {
        // No network or server unavailable, we do not display the banner
    }];

MobPartner Interstitial

First way: with an UIView

[[MobPartner sharedManager] createInterstitialViewWithDelegate:self
              completion:^(UIView *interstitialView) {
                     // add the interstitialView where you want
              }
              error:^(NSError *error) {
                    // No network or server unavailable, we do not display the interstitial
              }];

By using UIView you will need to import

#import <MobPartneriOSPublisherSDK/MobPartnerInterstitialViewDelegate.h>

and call the delegate method

- (void)closeInterstitialView {
  // call when user click on the interstitial close button.
}

Second way: with an UIViewController

[[MobPartner sharedManager] createInterstitialViewControllerWithCompletion:^(UIViewController *interstitialViewController) {
        // Present the interstitial when you are ready in our case with a presentViewController:
        [self presentViewController:interstitialViewController animated:YES completion:nil];
    } error:^(NSError *error) {
        // No network or server unavailable, we do not display the interstitial
    }];

You need to use presentViewController: animated: completion: because when the user taps on the interstitial close button dismissViewControllerAnimated: completion: is called.

MobPartner MobWall

To implement the MobWall call this method.

[[MobPartner sharedManager] createMobwallViewWithDelegate:self
                              completion:^(UIView *mobwallView) {
                                  // add the mobwallView where you want 

                              } error:^(NSError *error) {
                                   // No network or server unavailable, we do not display the mobwall
                              }];

You can import

#import <MobPartneriOSPublisherSDK/MobPartnerMobwallViewDelegate.h>

and call the delegate method to know why the webview doesn't load.

- (void)mobwall:(MobPartnerMobwallView *)mobwall didFailLoadWithError:(NSError *)error {
    // do something
}

Debug

To display log you need to have the flag DEBUG=1 in your Preprocessor Macros in your Build settings.

Demo project

An iOS demo project is available to test the different usages and check the configuration.

Code documentation

The framework's headers are documented and self explanatory.