From c8231e7d6a569613083d88cf561c9999d293bb05 Mon Sep 17 00:00:00 2001 From: Maxim Makhun Date: Fri, 5 Mar 2021 17:45:41 -0800 Subject: [PATCH] Use MBXAccessToken as default access token. (#212) --- Cartfile.private | 1 + Cartfile.resolved | 1 + MapboxGeocoder.xcodeproj/project.pbxproj | 3 +++ Sources/MapboxGeocoder/MBGeocoder.swift | 4 +++- 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Cartfile.private b/Cartfile.private index 99bd785..9be7f4f 100644 --- a/Cartfile.private +++ b/Cartfile.private @@ -1,2 +1,3 @@ binary "https://www.mapbox.com/ios-sdk/Mapbox-iOS-SDK.json" ~> 5.5 github "AliSoftware/OHHTTPStubs" ~> 9.0 +github "mapbox/mapbox-events-ios" ~> 0.10.2 diff --git a/Cartfile.resolved b/Cartfile.resolved index 59efb76..9151e4f 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,2 +1,3 @@ binary "https://www.mapbox.com/ios-sdk/Mapbox-iOS-SDK.json" "5.9.0" github "AliSoftware/OHHTTPStubs" "9.0.0" +github "mapbox/mapbox-events-ios" "v0.10.8" diff --git a/MapboxGeocoder.xcodeproj/project.pbxproj b/MapboxGeocoder.xcodeproj/project.pbxproj index cc7ed71..1181b46 100644 --- a/MapboxGeocoder.xcodeproj/project.pbxproj +++ b/MapboxGeocoder.xcodeproj/project.pbxproj @@ -931,10 +931,12 @@ ); inputPaths = ( "$(SRCROOT)/Carthage/Build/iOS/Mapbox.framework", + "$(SRCROOT)/Carthage/Build/iOS/MapboxMobileEvents.framework", ); name = "Copy Frameworks"; outputPaths = ( "$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/Mapbox.framework", + "$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/MapboxMobileEvents.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; @@ -947,6 +949,7 @@ ); inputPaths = ( "$(SRCROOT)/Carthage/Build/iOS/Mapbox.framework", + "$(SRCROOT)/Carthage/Build/iOS/MapboxMobileEvents.framework", ); name = "Copy Frameworks"; outputPaths = ( diff --git a/Sources/MapboxGeocoder/MBGeocoder.swift b/Sources/MapboxGeocoder/MBGeocoder.swift index f931df2..8adbc0a 100644 --- a/Sources/MapboxGeocoder/MBGeocoder.swift +++ b/Sources/MapboxGeocoder/MBGeocoder.swift @@ -7,7 +7,9 @@ typealias JSONDictionary = [String: Any] public let MBGeocoderErrorDomain = "MBGeocoderErrorDomain" /// The Mapbox access token specified in the main application bundle’s Info.plist. -let defaultAccessToken = Bundle.main.infoDictionary?["MGLMapboxAccessToken"] as? String +let defaultAccessToken = + Bundle.main.object(forInfoDictionaryKey: "MBXAccessToken") as? String ?? + Bundle.main.object(forInfoDictionaryKey: "MGLMapboxAccessToken") as? String /// The user agent string for any HTTP requests performed directly within this library. let userAgent: String = {