Skip to content

mobfox/iOS-Analytics-SDK-Dist

Repository files navigation

What’s in this documentation

This documentation covers installation and usage of the iOS-Analytics-SDK.

Where to get support

For any problems or questions not covered by the instructions below, contact EMAIL: [email protected] or open an issue.

Table of Contents

Prerequisites

  • The SDK supports iOS 9.0 and later.
  • You will need a MobFox account.

Installation

Before you start

Set 'Always Embed Swift Standard Libraries' in your 'build settings' to Yes.

CocoaPods

If you do not have Podfile yet:

    1. Close your Xcode project
    2. In terminal, go to your project location and type pod init to create Podfile
    3. Use open -a Xcode Podfile to edit Podfile
    4. Add to your Podfile:

   pod 'MobFoxAnalyticsSDK', '3.7.0'

       or for dynamic framework add:

   pod 'MobFoxAnalyticsSDKDynamic', '3.7.0'

    5. Save your pod file and type pod install

Manual Installation

To do a manual installation:

    1. Download and unzip MobFox-Analytics-SDK or clone this repository
    2. For integrating static framework, drag MobFoxAnalyticsSDK.embeddedframework
       from the Finder into your project
    3. For integrating dynamic framework, drag MobFoxAnalyticsSDKDynamic.embeddedframework
       from the Finder into your project
       (Note: MobFoxSDKCoreDynamic.framework must be under 'Embedded Binaries' and 'Linked Frameworks and Libraries')

ATS

One of the changes in iOS9 is a default setting that requires apps to make network connections only over SSL. This is known as App Transport Security.

Mobfox is facilitating the transition to support this change for each of our demand partners to ensure they are compliant.

In the meantime, developers who want to release apps that support iOS9, will need to disable ATS in order to ensure Mobfox continues to work as expected, and in iOS10 and later only disable ATS for Media and Web content.

To do so, developers should add the following to their plist:

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

Developers can also edit the plist directly by adding NSAppTransportSecurity key of dictionary type with the parameters:

NSAllowsArbitraryLoads, NSAllowsArbitraryLoadsForMedia, and NSAllowsArbitraryLoadsInWebContent set to true.

In the future, Mobfox will provide an additional parameter for requesting only secure ads. We will inform our publishers through the Control Panel.

More information about this change can be found on Apple's website.

For further questions about iOS9 and ATS, please create a ticket at MobFox.

If your app already relies on NSAllowsArbitraryLoads for some http request/s please do not modify your plist

Usage

First add the following import:

	#import <MobFoxAnalyticsSDK/MFAnalyticsManager.h>

or for dynamic framework:

	#import <MobFoxAnalyticsSDKDynamic/MFAnalyticsManager.h>

To initialize the SDK, and get it working, call:

	[MFAnalyticsManager sharedManager];

To get the current state of the SDK, call:

	BOOL res = [MFAnalyticsManager isAnalyticesDisabled];

To set the SDK state, call:

	[MFAnalyticsManager setAnalyticsDisabled:(BOOL)bDisabled];

Thank you for using MobFox iOS-Analytics-SDK !