GeoSpark iOS SDK enables you to track your user location in both online and offline states. The SDK enables you to track location in foreground, background and terminated app state. Our SDK tracks location with minimal battery drain with optimal location hits.
Here are the steps involved in integrating GeoSpark's iOS SDK with your app:
Open Xcode , click on create a new Xcode project -> Select the Single View App.
Open terminal, go to project folder and run pod init.
Open podfile, add pod GeoSpark and run pod install in your terminal.
Once pod installed, import GeoSpark into your AppDelegate file.
To configure the location services, add following entries to the Info.plist file.
Then, in your project settings, go to Capabilities > Background Modes and turn on background fetch, location updates and remote-notifications.
Register for remote notification and get the device token from the following method didRegisterForRemoteNotificationsWithDeviceToken.
Sign up here to create an account with GeoSpark. Post signup, you can create your first project from the dashboard screen.
Once you have created your project, you can add applications with required details.
You can get the publishable key from your project settings page which has to be used while integrating the SDK with your application.
Initialize SDK in didFinishLaunchingWithOptions method of your Application class.
The SDK needs a UserID object to identify the device. The SDK has a convenience method, createUser to create a user which returns User ID.
Start Location Tracking
To enable motion and location, call requestMotion and requestLocation methods. Calling this method will show alert asking for location permission and motion permission.
StartTracking the user location and start viewing your user's location data on the dashboard.
Your Application is successfully integrated with GeoSpark iOS SDK.
Ready to take the next steps?
Thank you for reading! If you're interested in seeing our product in action, click here to get in contact with our team. Or, if you're ready to get started, you can sign up here to start using our SDK and APIs today.