QuickStart
Before you start
Create projects and apps in your console and get your mobile key
Step 1: SDK integration
CocoaPods
Add pod 'c4w-location-sdk'
to your Podfile and run pod install
. More details CocoaPods here.
For other integration methods see here
Step 2: Project initialization
Mobile key
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>
Location usage keys
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>
Step 3: SDK enable
Inizialize
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
/* ------ AppDelegate.swift ------ */
//importing the framework
import GeoUniq
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
let _ = GeoUniq.sharedInstance()
return true
}
Start
To start the tracking engine call enable method.
Example:
//Swift
/* ------ AppDelegate.swift ------ */
//importing the framework
import GeoUniq
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
GeoUniq.sharedInstance().enable()
return true
}
Last updated
Was this helpful?