Wiki

Clone wiki

mngads-demo-ios / upgrading

upgrading SDK

See Wiki, Design Guidelines and Best practices and Help Center for more detailed informations. you must check Change Log .

Upgrading to 3.1.6

Upgrading to 3.1.5

Upgrading to 3.1.3

Upgrading to 3.1.2

Upgrading to 3.1.1

Upgrading to 3.1.0

To display the App Tracking Transparency authorization request for accessing the IDFA, update your Info.plist to add the NSUserTrackingUsageDescription key with a custom message describing your usage. Below is an example description text:

<key>NSUserTrackingUsageDescription</key>
<string>This identifier will be used to deliver personalized ads to you.</string>

Enable SKAdNetwork to track conversions

The BlueStack-SDK supports conversion tracking using [Apple's SKAdNetwork], which means BlueStack is able to attribute an app install even when IDFA is unavailable.

To enable this functionality, you will need to update the SKAdNetworkItems key with an additional dictionary in your Info.plist.

    <key>SKAdNetworkItems</key>
  <array>
    <dict>
      <key>SKAdNetworkIdentifier</key>
      <string>cstr6suwn9.skadnetwork</string>
    </dict>
    <dict>
      <key>SKAdNetworkIdentifier</key>
      <string>PD25VRRWZN.skadnetwork</string>
    </dict>
  </array>

Upgrading to 3.0.5

Upgrading to 3.0.4

  • Use new BlueStack-SDK + *Adapter.a
  • Use new MAdvertiseLocation-v1.9.
  • Support for GDPR TCF v1
  • implemented new Function setLocationPreferences

    * case consentFlag =  0  // user do not allow  
    * case consentFlag =  1 // user provide consent
    * case consentFlag =  2 // SDK must check consent IAB consent
    * case consentFlag =  3  //SDK must check Madvertise consent
    
    preferences.location = [preferences setLocationPreferences:[APP_DELEGATE sharedLocationManager].location WithConsentFlag: consentFlag] ;

Upgrading to 3.0.3

  • Use new BlueStack-SDK + *Adapter.a
  • Use new CriteoPublisherSdk 3.7.0
  • Use new Smart-Display-SDK 7.6.2

Upgrading to 3.0.2

Upgrading to 3.0.1

  • Use new BlueStack-SDK + *Adapter.a
  • Use new Smart-Display-SDK 7.6.0
  • Use new DFP 7.60.0 version GoogleMobileAds.framework
  • Use new adColony 4.1.5 version, AdColony.framework
  • Use new appLovinSDK 6.12.4
  • Use new AmazonPublisherServicesSDK 3.3.1
  • Use new CriteoPublisherSdk 3.5.0
  • Use new OguryAds 1.4.1

  • nativeAd Collection new callback Click, now you must check any nativeAd is clicked :

 -(void)adsAdapterNativeAdWasClicked:(MNGAdsAdapter *)adsAdapter nativeObjectClicked:(MNGNAtiveObject *)clickedAdView{

}

Check Carrousel Page in demo

Upgrading to 3.0.0

  • New pod name (BlueStack-SDK)
New instalation Cocoapods

The BlueStack-SDK is available through cocoaPods To download and incorporate the BlueStack-SDK into your project using Cocoapods, add the following line to your project's podfile:

  • delete the ligne from Podfile :
pod "MNGAds/MNGAdsFull"

or

pod "MNGAds",:subspecs => ["Facebook","DFP","SmartAdServer","MAdvertiseLocation"]
  • and replace with :
pod "BlueStack-SDK/Full"

or

pod "BlueStack-SDK",:subspecs => ["FBAudienceNetwork","Google-Mobile-Ads-SDK","Smart-Display-SDK","In-App-Bidding","FlurryAds","MAdvertiseLocation"]
  • Update name of subspecs :

  • MNGAdsFull -> Full

  • Facebook -> FBAudienceNetwork
  • DFP -> Google-Mobile-Ads-SDK
  • Flurry -> FlurryAds
  • SmartAdServer -> Smart-Display-SDK

Check Using CocoaPods

  • Use new BlueStack-SDK + *Adapter.a
  • Use new Smart-Display-SDK 7.4.2
  • Use new DFP 7.58.0 version
  • Use new MoPub 5.12.1 version
  • Use new adColony 4.1.4 version
  • Use new appLovinSDK 6.12.4
  • Use new [MAdvertiseLocation-v1.8].
  • Use new FacebookAudience 5.9.0
  • Use new Flurry 10.3.1 version

Upgrading to 2.16.3

Upgrading to 2.16.2

Upgrading to 2.16.1

  • Use new MngAdsSDK + *Adapter.a
  • nativeAd Collection new implementation, now you must new Boolean withCover :
Native Ad AdChoice Without Cover Image

if you like to execute the request without cover Image you can set the option withCover to NO :

 [nativeCollectionAdsFactory createNativeCollection:5 WithPreferences:preferences WithCover:cover];

Check Carrousel Page in demo

Upgrading to 2.16

Native Ad AdChoice Without Cover Image

if you like to execute the request without cover Image you can set the option withCover to NO :

MNGPreference *preferences = MNGPreference *preferences = [[MNGPreference alloc]init];
preferences.preferredAdChoicesPosition = MAdvertiseAdChoiceTopLeft;
[nativeAdsFactory loadNativeWithPreferences:preferences withCover:NO];
nativeAd callBack nativeObjectDidFailWithError implementation change , now you must new Boolean withCover :
-(void)adsAdapter:(MNGAdsAdapter *)adsAdapter nativeObjectDidFailWithError:(NSError *)error withCover:(BOOL)cover;
}

Upgrading to 2.15.1

Upgrading to 2.15

MAdvertiseInfeedFrame * frameinfeed = [[MAdvertiseInfeedFrame alloc] initWithWidthDP:self.view.frame.size.width andInfeedRatio:INFEED_RATIO_4_3];
[infeedAdsFactory loadInfeedInFrame:frameinfeed withPreferences:preferences];

Upgrading to 2.14.2

Upgrading to 2.14

  • nativeAd implementation change, Now cover image is downloaded directly by SDK. therefore you must replace
[nativeObject downloadAssetWithType:MAdvertiseAssetTypeAppIcon completition:^(UIImage *image) {
     dispatch_async(dispatch_get_main_queue(), ^{
         if (!weakSelf) {
             return;
         }
         __strong NativeAdViewController *strongSelf = weakSelf;
         strongSelf.iconeImage.image = image;
         strongSelf.nativeView.hidden = NO;
     });
 }];

By:

[_nativeObject registerViewForInteraction:self.nativeView withMediaView:self.backgroundImage withIconImageView:self.iconeImage withViewController:[APP_DELEGATE drawerViewController] withClickableView:self.callToActionButton];

Upgrading to 2.13.3

Important :You should note that it is mandatory that you add to your .plist file:

<key>GADIsAdManagerApp</key> 
<true/>

Also you need to add the -ObjC linker flag to Other Linker Flags in your project's build settings , for more on this checkout : https://developers.google.com/ad-manager/mobile-ads-sdk/ios/quick-start#update_your_infoplist

Upgrading to 2.13.2

Upgrading to 2.13.2

Upgrading to 2.13.1

Upgrading to 2.13

Upgrading to 2.12.3

To check if the interstitial is reday to be showen, you have to call [isInterstitialReady].

if ([interstitialAdsFactory isInterstitialReady]) {
    [interstitialAdsFactory displayInterstitial];
}

// OR
if ([interstitialAdsFactory isInterstitialReady]) {
    [interstitialAdsFactory showAdFromRootViewController:rootViewController animated:YES];
}

info: in some cases the difference between displayInterstitial and showAdFromRootViewController is a little bigger, for example in the case of smart adserver using displayInterstitial will add the the interstitial as a subview in the view of the viewController assigned to the factory, however when using showAdFromRootViewController it will present the interstitial as a viewController which is the case for most other adservers.

info: To test auto-displayin disabled on demo, you have to go to the page interstitial. others interstitials (return background, when change from page to page...) are with auto-displaying.

Upgrading to 2.12.1

  • remove any previous code related to MNGAds managing user's consent (everything related to MAdvertiseConsent class needs to be removed), since MNGAds will be handling the user's consent automatically according to IAB's guidelines.
  • use new MAdvertiseLocation-v1.0.
  • use new MngAdsSDK

Upgrading to 2.12

Upgrading to 2.11.1

Upgrading to 2.11

All *Adapter.a available on https://bitbucket.org/mngcorp/mngads-demo-ios/downloads/MNGAds-v2.11.zip

Upgrading to 2.10

  • GDPR: a new class has been introduced to facilitate complying with GDPR MAdvertiseConsent, you will need to create an instance of this new class and pass it to the sdk using the class method setConsentInformation , eg :
MAdvertiseConsent *consent = [[MAdvertiseConsent alloc]initWithGDPRScope:true.on andConsentStrings:@{@"IAB":"BOyrFHBOyrFHBAGABBENDH-AAAAvSAbAAqACAAFQALQAdgBFACSAFIALYAXgAxAB3AEAAIQATIAnABQgDAAGgAOIAgwBCACJgIAgQeBCACQAFhg"}];
[MAdvertiseConsent setConsentInformation:consent];

for more details check out the header of the new class it s fully documented and GDPR doc.

Upgrading to 2.9.1

Upgrading to 2.9

  • new delegate method to notify the publisher if the sdk fails its initialization :
-(void)MNGAdsSDKFactoryDidFailInitializationWithError:(NSError *)error {
    NSLog(@"MNGAds failed initialization");
}
  • nativead format, using MNGPreference you can set the preferred adchoices position , although you need to keep in mind that in some cases it might not position it where mentioned since some of the adnetworks won't take this parameter into consideration , so preferably set the preferred position here as well in the didLoad once the request succeeds.

Finally to execute the request you have to call '[loadNativeWithPreferences]'.

MNGPreference *preferences = MNGPreference *preferences = [[MNGPreference alloc]init];
preferences.preferredAdChoicesPosition = MAdvertiseAdChoiceTopLeft;
[nativeAdsFactory loadNativeWithPreferences:preferences];

Upgrading to 2.8.1

Upgrading to 2.8

Upgrading to 2.7.2

Upgrading to 2.7.1

Upgrading to 2.7

  • Since BeaconForStoreSDK isnt available by default while using cocoapods, you will need to change mngads's pod line to this:
pod "MNGAds",:subspecs => ["MNGAdsFull", "B4S"]
  • Recently some ads have caused some audio issues: where after the ad is dismissed the entire app becomes muted, and after a thorough investigation we discovered that the issue comes from an adnetwork we currently use and until they fix the issue on their end here s a workaround : what causes the issue is that when a video ad loads it may change the category of AVAudioSession's shared instance, so to avoid this issue you only need to revert (after the ad is dismissed) to the category you initially set, for example :
-(void)adsAdapterInterstitialDisappear:(MNGAdsAdapter *)adsAdapter{

  [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];
  [[AVAudioSession sharedInstance] setActive: YES error: nil];

}
if you are not using cocoapods to install MNGAds then you should consider upgrading these libraries/frameworks:
  • use new FacebookAudience 4.25.0 version
  • use new GoogleMobileAds 7.22.0 version
  • use new SmartAdServer 6.7.1 version
  • use new BeaconForStoreSDK 2.2.9 version

Upgrading to 2.6

  • Implemented new eyes tracking feature in MAdveriseAdserver (MAS) that tracks the user's face to determine if he is really watching an ad (all formats except for native ad) or not , and for how long; this feature is optional, however to enable it, you need to include umoove.framework in your project , also you should notice that umoove is a dynamic library so you need to make sure that it s included in "Embedded Binaries" as well as "Linked Frameworks and Librairies". Keep in mind that in order to track the user's face, the app will require the use of the device's camera , so dont forget to include NSCameraUsageDescription in your info.plist.
if you are not using cocoapods to install MNGAds then you should consider upgrading these libraries/frameworks:

Upgrading to 2.5.3

Upgrading to 2.5

Dont forget to change your implementation, don't use deprecated methods.

Depecated method New method
createBanner loadBanner
createBannerInFrame: loadBannerInFrame:
createBannerInFrame: withPreferences: loadBannerInFrame: withPreferences:
createInterstitial loadInterstitial
createInterstitialAutoDisplayed: loadInterstitialAutoDisplayed:
createInterstitialWithPreferences: loadInterstitialWithPreferences:
createInterstitialWithPreferences: autoDisplayed: loadInterstitialWithPreferences: autoDisplayed:
createNative loadNative
createNativeWithPreferences: loadNativeWithPreferences:
createInfeedInFrame: loadInfeedInFrame:
createInfeedInFrame: withPreferences: loadInfeedInFrame:(CGRect)frame withPreferences:

Upgrading to 2.4

Upgrading to 2.3.4

Upgrading to 2.3.3

Upgrading to 2.3.2

This version is ATS-compliant (App Transport Security), If you push you submit an app after 1th January 2017, you must use this version.

MNGAds SDK (with Mediation) are now ATS-compliant, but a small percentage of creatives (near to zero) not directly hosted on our platform are not.

If you must make an exception for a reason, we recommend that you minimize it by only setting the NSAllowsArbitraryLoadsInWebContent and NSAllowsArbitraryLoadsForMedia keys,

<key>NSAppTransportSecurity</key>
    <dict>
        <key>NSAllowsArbitraryLoadsForMedia</key>
            <true/>
        <key>NSAllowsArbitraryLoadsInWebContent</key>
            <true/>
    </dict>
  • add pod dependency for B4S (If you are using cocoapods, you must remove BeaconForStoreSDK.framework/BeaconForStoreSDK, it will be auto-downloaded by cocoapods)

Don't forget to update following libraries :

Upgrading to 2.3

Now you can get assets from MNGNativeObject

__weak NativeAdViewController *weakSelf = self;
    [nativeObject downloadAssetWithType:MAdvertiseAssetTypeAppIcon completition:^(UIImage *image) {
        dispatch_async(dispatch_get_main_queue(), ^{
            if (!weakSelf) {
                return;
            }
            __strong NativeAdViewController *strongSelf = weakSelf;
            strongSelf.iconeImage.image = image;
            strongSelf.nativeView.hidden = NO;
        });
    }];

Now you can add beacon for store:

  • Get Ebeacon technology to propose to the advertisers to target the users inside the point of sale.
  • An installation base of 12,500 ebeacons ready to track the users.
  • An exclusive format in Push notification to the users inside a tabacco shop, press shop, pharmay or mall.

Initializing Beacons

You have to add libMAdvertiseB4SAdapter.a, BeaconForStoreSDK.framework and BeaconForStoreStorage.bundle to your project.

To access to beacon you have to use the MAdvertiseBeacon singleton. To initialise it you have to call the method initBeacon at application:didFinishLaunchingWithOptions:

#import <MAdvertiseBeacon.h>
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [MNGAdsSDKFactory initWithAppId:MNG_ADS_APP_ID];
    [[MAdvertiseBeacon singleton]initBeacon];
    //
}

handleNotificationWithUserInfo

To handle beacon local notification, firstable you have to cheack if it is a beacon notification and let MAdvertiseBeacon handle it.

-(void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification{
    if ([[MAdvertiseBeacon singleton]userInfoIsBeaconNotification:notification.userInfo]) {
        [[MAdvertiseBeacon singleton]handleNotificationWithUserInfo:notification.userInfo];
    }else{
        //
    }
}


Don't forget to update following libraries :

- [MngAdsSDK]
- [FBAudienceNetwork.framework]
- [libFlurry], [libFlurryAds]
- [libSmartAdServer.a]
- [GoogleMobileAds.framework]

## Upgrading to 2.1.1
### New features
Now you can use new predifined sizes 

```objc
extern MNGAdSize const kMNGAdSizeDynamicBanner; //Small Banner Screen width x 50
extern MNGAdSize const kMNGAdSizeDynamicLeaderboard; //Landscape Banner ipad Screen width x 90

libraries

If you are using cocoapods, you must remove AmazonAd.framework, it will be auto-downloaded by cocoapods

Don't forget to update following libraries :

Upgrading to 2.1

New features

Now you can create an In-Feed Ad format

-(BOOL)createInfeedInFrame:(CGRect)frame withPreferences:(MNGPreference*)preferences;
-(BOOL)createInfeedInFrame:(CGRect)frame ;

libraries

Upgrading to v2.x

adNetworks

Removed:

Added:

Integration

MNGAds v2.0 allow you to choose which adNetworks you will use, the integration process has changed. By default you must add all adapters in order to increase fillrate/revenues

Manual integration:

libMNGAds.a is always required and with it you have only Mng Perf and Appsfire works.

To add another adNetwork, you have to add to your project the lib[adNetworkAdapter].a and the adNetwork SDK.

Example: To use Smart Ad Server you have to add:

  • libMNGAdsSASAdapter.a
  • libSmartAdServer.a

Important : If you add just lib[adNetworkAdapter].a, the dispatcher will not use it and if you just add the adNetwork SDK, you will have a compilation error: References not found

CocoaPods integration

see Using CocoaPods

MediaContainer

With MNGAds v2.0 you can integrate video ads into your Native Ad experience by calling [MNGNAtiveObject setMediaContainer:(UIView *)mediaContainer] and the SDK will add the video or the cover image to your container

-(void)adsAdapter:(MNGAdsAdapter *)adsAdapter nativeObjectDidLoad:(MNGNAtiveObject *)nativeObject{
    ...
    [nativeObject setMediaContainer:self.container];
    ...
}

coverImageUrl still available but it can be nil.

Upgrading to v1.4.1 (Building Against iOS9)

iOS 9 introduces changes that are likely to impact your app and its MngAds integration.

  • Learn what's new in iOS 9 from Apple
  • One of the changes in iOS9 is a default setting that requires apps to make network connections only over SSL (App Transport Security). Therefore Whitelist Ads Servers for Network Requests, mngAds works under https but not all adNetworks on mediation (smartAdserver, appNexus, facebook, ...). if you want to release apps that build against iOS9, you will need to disable ATS in order to ensure all mediation works too.
<key>NSAppTransportSecurity</key>
    <dict>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
    </dict>

You can also edit the plist by adding NSAppTransportSecurity key of dictionary type with a dictionary element of NSAllowsArbitraryLoads of boolean type set to “Yes”.

ats.png

  • v1.4.1 of the SDK supports bitcode. If you are using earlier versions, you must disable bitcode. But for now GoogleMobileAds.framework do not support bitcode, therefore you must disable bitcode for your app

GoogleMobileAdsSdkiOS-7.4.1/GoogleMobileAds.framework/GoogleMobileAds(GADGestureIdUtil.o)' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target.

  • FBAudienceNetwork.framework and libSmartAdServer.a do not work with Xcode 6.4. Therefore, MngAds needs Xcode 7.

Upgrading to v1.4

Now appNexus is available on Cocoapods and pod generate libAppNexusSDK.a, you must remove libANSDK.a old librairy in order to avoid duplicate symbol.

Upgrading to v1.3.2

The call to the following methods

-(BOOL)createInterstitialWithPreferences:(MNGPreference*)preferences autoDisplayed:(BOOL)autoDisplyed;  
-(BOOL)createInterstitialAutoDisplayed:(BOOL)autoDisplyed;

should be replaced by

-(BOOL)createInterstitialWithPreferences:(MNGPreference*)preferences;
-(BOOL)createInterstitial;

Upgrading to v1.2.1

Bug preference.keyword, now allow empty value if location is setted.

Upgrading to v1.2

You must add Appnexus library. You must setpreference.keyword,if location is setted.(bug fix in v1.2.1)

Upgrading from v1.0 to v1.1

The following methods have been changed. preferredHeight:(CGFloat)preferredHeight is now available to more easily resize banners.

(void)adsAdapter:(MNGAdsAdapter *)adsAdapter bannerDidLoad:(UIView *)bannerView preferredHeight:(CGFloat)preferredHeight{

instead of

(void)adsAdapter:(MNGAdsAdapter *)adsAdapter bannerDidLoad:(UIView *)bannerView{

Updated