[ios] Flush telemetry cache when data collection is paused This flushes the cache just before pausing so that data collected before the pause is not thrown away. It also refactors event creation to avoid possible nil value inserts into dictionaries and adds a small optimization to avoid creating immutable dictionaries to help create mutable ones. Also: - Remove cancel API in API client The cancelAll API is not used. The array of data tasks it maintains has proven problematic. This removes the API and the problematic implementation. As safer version of it can be brought back if cancel task functionality is required in the future. - Remove unused battery method
16 lines
485 B
Objective-C
16 lines
485 B
Objective-C
#import <Foundation/Foundation.h>
|
|
|
|
#import "MGLMapboxEvents.h"
|
|
#import "MGLTypes.h"
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
@interface MGLAPIClient : NSObject <NSURLSessionDelegate>
|
|
|
|
- (void)postEvents:(NS_ARRAY_OF(MGLMapboxEventAttributes *) *)events completionHandler:(nullable void (^)(NSError * _Nullable error))completionHandler;
|
|
- (void)postEvent:(MGLMapboxEventAttributes *)event completionHandler:(nullable void (^)(NSError * _Nullable error))completionHandler;
|
|
|
|
@end
|
|
|
|
NS_ASSUME_NONNULL_END
|