summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLNetworkConfiguration.h
diff options
context:
space:
mode:
authorFabian Guerra Soto <fabian.guerra@mapbox.com>2019-02-18 13:16:20 -0800
committerGitHub <noreply@github.com>2019-02-18 13:16:20 -0800
commit1fc7a9b82ea0c064c20247f0902b3854fff1942f (patch)
tree7f518f198ec241c55666fb6c9baa7b3179945c80 /platform/darwin/src/MGLNetworkConfiguration.h
parent1c99b199c62f239ef2a9e1f2f23b0d10533b381a (diff)
downloadqtlocation-mapboxgl-1fc7a9b82ea0c064c20247f0902b3854fff1942f.tar.gz
[ios, macos] Expose the url session configuration object. (#13886)
The `MGLNetworkConfiguration` class was make public, and added `sessionConfiguration` property to let developers customize the `NSURLSessionConfiguration` object that is used to make HTTP requests in the SDK.
Diffstat (limited to 'platform/darwin/src/MGLNetworkConfiguration.h')
-rw-r--r--platform/darwin/src/MGLNetworkConfiguration.h29
1 files changed, 24 insertions, 5 deletions
diff --git a/platform/darwin/src/MGLNetworkConfiguration.h b/platform/darwin/src/MGLNetworkConfiguration.h
index aaac5a330c..6c56050aae 100644
--- a/platform/darwin/src/MGLNetworkConfiguration.h
+++ b/platform/darwin/src/MGLNetworkConfiguration.h
@@ -1,18 +1,37 @@
#import <Foundation/Foundation.h>
+#import "MGLFoundation.h"
+
NS_ASSUME_NONNULL_BEGIN
/**
- The MGLNetworkConfiguration object provides a global way to set a base API URL for
- retrieval of map data, styles, and other resources.
-
- Currently, MGLNetworkConfiguration is a private API.
+ The `MGLNetworkConfiguration` object provides a global way to set a base
+ `NSURLSessionConfiguration`, and other resources.
*/
+MGL_EXPORT
@interface MGLNetworkConfiguration : NSObject
-/// Returns the shared instance of the `MGLNetworkConfiguration` class.
+/**
+ Returns the shared instance of the `MGLNetworkConfiguration` class.
+ */
@property (class, nonatomic, readonly) MGLNetworkConfiguration *sharedManager;
+/**
+ The session configuration object that is used by the `NSURLSession` objects
+ in this SDK.
+
+ If this property is set to nil or if no session configuration is provided this property
+ is set to the default session configuration.
+
+ Assign this object before instantiating any `MGLMapView` object.
+
+ @note: `NSURLSession` objects store a copy of this configuration. Any further changes
+ to mutable properties on this configuration object passed to a session’s initializer
+ will not affect the behavior of that session.
+
+ */
+@property (atomic, strong, null_resettable) NSURLSessionConfiguration *sessionConfiguration;
+
@end
NS_ASSUME_NONNULL_END