summaryrefslogtreecommitdiff
path: root/platform/darwin/include/mbgl/interface/native_apple_interface.h
diff options
context:
space:
mode:
Diffstat (limited to 'platform/darwin/include/mbgl/interface/native_apple_interface.h')
-rw-r--r--platform/darwin/include/mbgl/interface/native_apple_interface.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/platform/darwin/include/mbgl/interface/native_apple_interface.h b/platform/darwin/include/mbgl/interface/native_apple_interface.h
new file mode 100644
index 0000000000..d4d207462d
--- /dev/null
+++ b/platform/darwin/include/mbgl/interface/native_apple_interface.h
@@ -0,0 +1,51 @@
+#import <Foundation/Foundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@protocol MGLNativeNetworkDelegate <NSObject>
+
+@optional
+
+- (NSString *)skuToken;
+
+@required
+
+- (NSURLSessionConfiguration *)sessionConfiguration;
+
+- (void)startDownloadEvent:(NSString *)event type:(NSString *)type;
+
+- (void)cancelDownloadEventForResponse:(NSURLResponse *)response;
+
+- (void)stopDownloadEventForResponse:(NSURLResponse *)response;
+
+- (void)debugLog:(NSString *)format, ...;
+
+- (void)errorLog:(NSString *)format, ...;
+
+@end
+
+#define MGL_APPLE_EXPORT __attribute__((visibility ("default")))
+
+@interface MGLNativeNetworkManager: NSObject
+
++ (MGLNativeNetworkManager *)sharedManager;
+
+@property (nonatomic, weak) id<MGLNativeNetworkDelegate> delegate;
+
+@property (nonatomic, readonly) NSString *skuToken;
+
+@property (nonatomic, readonly) NSURLSessionConfiguration *sessionConfiguration;
+
+- (void)startDownloadEvent:(NSString *)event type:(NSString *)type;
+
+- (void)cancelDownloadEventForResponse:(NSURLResponse *)response;
+
+- (void)stopDownloadEventForResponse:(NSURLResponse *)response;
+
+- (void)debugLog:(NSString *)format, ...;
+
+- (void)errorLog:(NSString *)format, ...;
+
+@end
+
+NS_ASSUME_NONNULL_END