-
Notifications
You must be signed in to change notification settings - Fork 0
Offline hits 6d9bc4
The AT Internet SDK enables you to store, on the user’s device, any hits that couldn’t be sent due to loss of Internet connection. For this, the SDK uses Apple’s CoreData technology.
Use of this feature is subject to the subscription to an option. This feature may increase the disk space that your application occupies on a user’s device.
You can set up the storage management mode directly within the Tag Composer interface, or via the Tracker’s setConfig method.
Three modes are available:
- required : Hits are only stored when a loss of connection is detected.
- always : Hits are never sent. They are directly stored on the device.
- never (by default) : Hits are never stored. If a loss of connection is detected at the same time as an attempt to send the hit, the hit will be lost.
To edit the hit storage mode, add the following code to the desired area:
Store hits during loss of connection:
tracker.setOfflineMode(OfflineModeKey.required, completionHandler: nil) // Notice that the function is async[self.tracker setConfig:@"storage" value:@"required" completionHandler:nil];This method sends all stored hits in an asynchronous manner, and deletes them if the send was successful. If the send failed, two new attempts will be made during the next hit send. If all attempts fail, the hit will be deleted from storage.
Thanks to this method, you may decide at which moment you want hits to be sent. By setting the storage mode to always, you can simply call the send method to trigger sending at the desired moment.
You may trigger the sending of saved hits during time your application runs in the background. To do this, add the following code in your application delegate:
func applicationDidEnterBackground(_ application: UIApplication) {
self.tracker.offline.dispatch()
}- (void)applicationDidEnterBackground:(UIApplication *)application {
[self.tracker.offline dispatch];
}-
Data API
- Data flow
- Advice optimizations data flow
- Error codes data flow
- Faq data flow
- General information data flow
- Technical information data flow
- Reporting API v3
- Getting started
- Methods
- Parameters
- Technical information
- REST API
- Campaigns
- Custom variables
- Getting started rest
- Methods rest
- Response structure parameters rest
- Fixed periods
- Parameters compatibility
- Relative periods
- Structure of the response
- “code” parameter
- “columns” parameter
- “evo” parameter
- “filter” parameter
- “include” parameter
- “lng” parameter
- “max-results” parameter
- “page-num” parameter
- “period” parameter
- “period” parameter: “H” v. “He” & “MN” v. “MNe”
- “retention” parameter
- “segmentdesc” parameter
- “segment” parameter
- “sep” parameter
- “sort” parameter
- “space” parameter
- Technical specifications rest
- Data flow
-
Data collection
- Android
- Advanced features
- Campaigns
- Changelog
- Content
- Ecommerce
- Getting started
- Users
- Apple
- Advanced features
- Campaigns
- Changelog
- Content
- Ecommerce
- Getting started
- Users
- General
- Cddc renew staging process
- Changelog
- Craft your hit
- Encoded parameters
- Server side cookie management
- Supported taggings
- Tagging deletion
- Utilisation of dispatch sdks
- JavaScript
- Advanced features
- Campaigns
- Changelog
- Content
- Ecommerce
- Getting started
- Partners javascript
- Users
- Piano Analytics
- Event tagging piano analytics
- Getting started piano analytics
- Piano analytics tagging
- Feeding piano analytics with as2 tagging
- Tagging custom properties sdk
- Android