diff options
author | M.Stephen <truestyle2005@163.com> | 2019-12-12 18:08:09 +0800 |
---|---|---|
committer | M.Stephen <truestyle2005@163.com> | 2019-12-12 18:08:09 +0800 |
commit | 29397ff602d1c35873c9a577882fd34307290aaf (patch) | |
tree | 3d53af8d5260f88c4aeef82f9ac49cc870898297 | |
parent | 1c4c436fcd174d6413e2f9b8564b49ee407d1da4 (diff) | |
download | qtlocation-mapboxgl-29397ff602d1c35873c9a577882fd34307290aaf.tar.gz |
update
-rw-r--r-- | platform/darwin/src/MGLNetworkIntegrationManager.h | 8 | ||||
-rw-r--r-- | platform/darwin/src/MGLNetworkIntegrationManager.m (renamed from platform/ios/src/MGLNativeInterfaceReceiver.m) | 22 |
2 files changed, 19 insertions, 11 deletions
diff --git a/platform/darwin/src/MGLNetworkIntegrationManager.h b/platform/darwin/src/MGLNetworkIntegrationManager.h new file mode 100644 index 0000000000..3381f21a09 --- /dev/null +++ b/platform/darwin/src/MGLNetworkIntegrationManager.h @@ -0,0 +1,8 @@ +#import <Foundation/Foundation.h> +#include <mbgl/interface/native_apple_interface.h> + +@interface MGLNetworkIntegrationManager : NSObject <MGLNativeAppleInterfaceDelegate> + ++ (MGLNetworkIntegrationManager *)shared; + +@end diff --git a/platform/ios/src/MGLNativeInterfaceReceiver.m b/platform/darwin/src/MGLNetworkIntegrationManager.m index a703c55d38..249d8fc433 100644 --- a/platform/ios/src/MGLNativeInterfaceReceiver.m +++ b/platform/darwin/src/MGLNetworkIntegrationManager.m @@ -1,4 +1,4 @@ -#import "MGLNativeInterfaceReceiver.h" +#import "MGLNetworkIntegrationManager.h" #import "MGLLoggingConfiguration_Private.h" #import "MGLNetworkConfiguration_Private.h" @@ -7,43 +7,43 @@ #import "MGLAccountManager_Private.h" #endif -@implementation MGLNativeInterfaceReceiver +@implementation MGLNetworkIntegrationManager -static MGLNativeInterfaceReceiver *instance = nil; +static MGLNetworkIntegrationManager *instance = nil; -+ (MGLNativeInterfaceReceiver *)shared { ++ (MGLNetworkIntegrationManager *)shared { static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ - instance = [[MGLNativeInterfaceReceiver alloc] init]; + instance = [[MGLNetworkIntegrationManager alloc] init]; }); return instance; } #pragma mark - MGLNativeAppleInterfaceManager delegate - -- (NSURLSessionConfiguration *)nai_sessionConfiguration { +- (NSURLSessionConfiguration *)sessionConfiguration { return [MGLNetworkConfiguration sharedManager].sessionConfiguration; } #if TARGET_OS_IPHONE || TARGET_OS_SIMULATOR -- (NSString *)nai_accountTypeKey { +- (NSString *)accountTypeKey { return MGLMapboxAccountTypeKey; } -- (NSString *)nai_skuToken { +- (NSString *)skuToken { return MGLAccountManager.skuToken; } #endif -- (void)nai_startDownloadEvent:(NSString *)event type:(NSString *)type { +- (void)startDownloadEvent:(NSString *)event type:(NSString *)type { [[MGLNetworkConfiguration sharedManager] startDownloadEvent:event type:@"tile"]; } -- (void)nai_cancelDownloadEventForResponse:(NSURLResponse *)response { +- (void)cancelDownloadEventForResponse:(NSURLResponse *)response { [[MGLNetworkConfiguration sharedManager] cancelDownloadEventForResponse:response]; } -- (void)nai_stopDownloadEventForResponse:(NSURLResponse *)response { +- (void)stopDownloadEventForResponse:(NSURLResponse *)response { [[MGLNetworkConfiguration sharedManager] stopDownloadEventForResponse:response]; } |