Files
MapLibreParticleLab/platform/darwin/src/MGLNetworkIntegrationManager.m
m-stephen f9b7284276 [ios, macos]Remove iOS/macOS codes from native codes (#16031)
* add source/header

* add ios files

* add configs

* modify name

* http_file_source

* add interface delegate when map init

* fix name

* fix delegate name

* support mac os

* add mac os support

* make optional delegate when mac os

* mac/ios difference

* add ios change log

* cancel iOS/mac OS judgement

* cancel iOS/mac OS judgement

* cancel judgement in .m

* update

* update

* update http_file_source

* update ios

* update mac os

* add mac os file

* add mac os file to `.cmake`

* change names

* add log & fix format

* reset changelog commit

* update changelog

* rename iOS network manager

* Add a test configuration(same as default configuration) when mac os run tests

* re-add account type into `http_file_source`

* refactor
2019-12-14 13:38:46 +08:00

55 lines
1.4 KiB
Objective-C

#import "MGLNetworkIntegrationManager.h"
#import "MGLLoggingConfiguration_Private.h"
#import "MGLNetworkConfiguration_Private.h"
#if TARGET_OS_IPHONE || TARGET_OS_SIMULATOR
#import "MGLAccountManager_Private.h"
#endif
@implementation MGLNetworkIntegrationManager
static MGLNetworkIntegrationManager *instance = nil;
+ (MGLNetworkIntegrationManager *)sharedManager {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
instance = [[MGLNetworkIntegrationManager alloc] init];
});
return instance;
}
#pragma mark - MGLNativeAppleInterfaceManager delegate -
- (NSURLSessionConfiguration *)sessionConfiguration {
return [MGLNetworkConfiguration sharedManager].sessionConfiguration;
}
#if TARGET_OS_IPHONE || TARGET_OS_SIMULATOR
- (NSString *)skuToken {
return MGLAccountManager.skuToken;
}
#endif
- (void)startDownloadEvent:(NSString *)event type:(NSString *)type {
[[MGLNetworkConfiguration sharedManager] startDownloadEvent:event type:@"tile"];
}
- (void)cancelDownloadEventForResponse:(NSURLResponse *)response {
[[MGLNetworkConfiguration sharedManager] cancelDownloadEventForResponse:response];
}
- (void)stopDownloadEventForResponse:(NSURLResponse *)response {
[[MGLNetworkConfiguration sharedManager] stopDownloadEventForResponse:response];
}
- (void)debugLog:(NSString *)format, ... {
MGLLogDebug(format);
}
- (void)errorLog:(NSString *)format, ... {
MGLLogError(format);
}
@end