QuickStart
Add the following key to Info.plist file (String value) with the corresponding value (that you obtained when added your app to your project)
<key>GUMobileKey</key>
<string>'your-mobile-key'</string>
- 1.Add the following keys to Info.plist file (String value), the corresponding values will be shown to the user by iOS
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>We would like to access your locations</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>We would like to access your locations</string>
To initialize the framework and allow it to collect data in the background it is necessary to add this call in the
didFinishLaunchingWithOptions
method (this method don't start the tracking engine)Swift
Object-C
//Swift
/* ------ AppDelegate.swift ------ */
//importing the framework
import GeoUniq
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
let _ = GeoUniq.sharedInstance()
return true
}
//Objective C
/* ------ AppDelegate.m ------ */
//importing the framework
#import "GeoUniq/GeoUniq-Swift.h"
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[GeoUniq sharedInstance];
return YES;
}
To start the tracking engine call enable method.
Example:
Swift
Object-C
//Swift
/* ------ AppDelegate.swift ------ */
//importing the framework
import GeoUniq
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
GeoUniq.sharedInstance().enable()
return true
}
//Objective C
/* ------ AppDelegate.m ------ */
//importing the framework
#import "GeoUniq/GeoUniq-Swift.h"
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[[GeoUniq sharedInstance] enable];
return YES;
}
Last modified 1yr ago