Once stopped, the device will need to move more than 100 meters to wake up and start moving again.Īssuming the user has authorized background permissions, background tracking will work even if the app has been backgrounded or killed, as iOS location services will wake up the app to deliver events. When stopped, it tells the SDK to shut down to save battery. When moving, it tells the SDK to send location updates to the server every 2-3 minutes. This preset detects whether the device is stopped or moving. The SDK supports custom tracking options as well as three presets.įor geofencing, we recommend using RadarTrackingOptions.presetResponsive. Once you have initialized the SDK and the user has authorized background permissions, you can start tracking the user's location in the background. Not seeing your user on the Users page? Check status in the completionHandler to see what went wrong. AppDelegate.h # import # import AppDelegate : UIResponder // AppDelegate.m # import "AppDelegate.h" import RadarSDK AppDelegate ( ) ( strong, nonatomic ) CLLocationManager * locationManager AppDelegate - ( BOOL ) application : ( UIApplication * ) application didFinishLaunchingWithOptions : ( NSDictionary * ) launchOptions Copyīuild and run the app, then find your user on the Users page! To trigger an event, you'll need to create a geofence if you haven't already. Use your Live Publishable key for production environments. Use your Test Publishable key for testing and non-production environments. When your app starts, initialize the SDK with your publishable API key, found on the Settings page. The SDK currently supports iOS 10 and higher. In your target settings, go to General > Frameworks, Libraries, and Embedded Content and add CoreLocation if you haven't already. The SDK depends on Apple's CoreLocation framework. It will automatically appear in the Frameworks, Libraries, and Embedded Content section of your target settings. Download the current release, unzip the package, and drag RadarSDK.xcframework into your Xcode project. You can also add the SDK to your project manually. Do not add the framework as an input to your copy-frameworks run script. Then, run carthage update and drag Build/iOS/amework into the Linked Frameworks and Libraries section of your target.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |