This documentation covers installation and usage of the iOS-Analytics-SDK.
For any problems or questions not covered by the instructions below, contact EMAIL: [email protected] or open an issue.
- The SDK supports iOS 9.0 and later.
- You will need a MobFox account.
Set 'Always Embed Swift Standard Libraries' in your 'build settings' to Yes.
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
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')
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
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];