This repository has been archived by the owner on Jun 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Preparations for ios-v5.7.0-alpha.1 (#139)
* Podspec & changelog updates for 5.7.0-alpha.1 * Bump to mapbox-gl-native/d3a5ed * Add files from #16031 (#140) * [ios] Add changed files * [ios] Add files to project * [ios] Bumped submodule * Bump vendor/mapbox-gl-native to master again Co-authored-by: Jordan Kiley <jmkiley@users.noreply.github.com>
- Loading branch information
1 parent
309e226
commit 87ada1e
Showing
10 changed files
with
148 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#import <Foundation/Foundation.h> | ||
#include <mbgl/interface/native_apple_interface.h> | ||
|
||
@interface MGLNetworkIntegrationManager : NSObject <MGLNativeNetworkDelegate> | ||
|
||
+ (MGLNetworkIntegrationManager *)sharedManager; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
#import <Foundation/Foundation.h> | ||
#import <mbgl/interface/native_apple_interface.h> | ||
|
||
@implementation MGLNativeNetworkManager | ||
|
||
static MGLNativeNetworkManager *instance = nil; | ||
|
||
+ (MGLNativeNetworkManager *)sharedManager { | ||
static dispatch_once_t onceToken; | ||
dispatch_once(&onceToken, ^{ | ||
instance = [[MGLNativeNetworkManager alloc] init]; | ||
}); | ||
return instance; | ||
} | ||
|
||
- (NSURLSessionConfiguration *)sessionConfiguration { | ||
if (_delegate && [_delegate respondsToSelector:@selector(sessionConfiguration)]) { | ||
return [_delegate sessionConfiguration]; | ||
} | ||
// For testing. Since we get a `nil` return when SDK is modualar, we use this for testing requests. | ||
// Same as `[MGLNetworkConfiguration defaultSessionConfiguration]` in `MGLNetworkConfiguration.m`. | ||
return [self testSessionConfiguration]; | ||
} | ||
|
||
- (NSURLSessionConfiguration *)testSessionConfiguration { | ||
NSURLSessionConfiguration* sessionConfiguration = [NSURLSessionConfiguration defaultSessionConfiguration]; | ||
|
||
sessionConfiguration.timeoutIntervalForResource = 30; | ||
sessionConfiguration.HTTPMaximumConnectionsPerHost = 8; | ||
sessionConfiguration.requestCachePolicy = NSURLRequestReloadIgnoringLocalCacheData; | ||
sessionConfiguration.URLCache = nil; | ||
|
||
return sessionConfiguration; | ||
} | ||
|
||
- (NSString *)skuToken { | ||
if(_delegate && [_delegate respondsToSelector:@selector(skuToken)]) { | ||
return [_delegate skuToken]; | ||
} | ||
return nil; | ||
} | ||
|
||
- (void)startDownloadEvent:(NSString *)event type:(NSString *)type { | ||
if (_delegate && [_delegate respondsToSelector:@selector(startDownloadEvent:type:)]) { | ||
[_delegate startDownloadEvent:event type:type]; | ||
} | ||
} | ||
|
||
- (void)cancelDownloadEventForResponse:(NSURLResponse *)response { | ||
if (_delegate && [_delegate respondsToSelector:@selector(cancelDownloadEventForResponse:)]) { | ||
return [_delegate cancelDownloadEventForResponse:response]; | ||
} | ||
} | ||
|
||
- (void)stopDownloadEventForResponse:(NSURLResponse *)response { | ||
if (_delegate && [_delegate respondsToSelector:@selector(stopDownloadEventForResponse:)]) { | ||
return [_delegate stopDownloadEventForResponse:response]; | ||
} | ||
} | ||
|
||
- (void)debugLog:(NSString *)format, ...{ | ||
if (_delegate && [_delegate respondsToSelector:@selector(debugLog:)]) { | ||
return [_delegate debugLog:format]; | ||
} | ||
} | ||
|
||
- (void)errorLog:(NSString *)format, ...{ | ||
if (_delegate && [_delegate respondsToSelector:@selector(errorLog:)]) { | ||
return [_delegate errorLog:format]; | ||
} | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Pod::Spec.new do |m| | ||
|
||
version = '5.6.0' | ||
version = '5.7.0-alpha.1' | ||
|
||
m.name = 'Mapbox-iOS-SDK' | ||
m.version = version | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule mapbox-gl-native
updated
5901 files