Skip to content

Commit

Permalink
Merge pull request #311 from mohssenfathi/remove-swift-sdk
Browse files Browse the repository at this point in the history
Remove legacy SwiftSDK sample app
  • Loading branch information
mohssenfathi authored Aug 20, 2024
2 parents bb61e42 + 221a8fd commit d91ca25
Show file tree
Hide file tree
Showing 83 changed files with 337 additions and 2,785 deletions.
16 changes: 10 additions & 6 deletions Sources/UberCore/ConfigurationProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,22 @@ public protocol ConfigurationProviding {
}

public struct ConfigurationProvider: ConfigurationProviding {


// MARK: Public Properties

public static var plistName: String = "Info"

// MARK: Private Properties

private let parser: PlistParser

// MARK: Initializers

public init() {
let parser = PlistParser(plistName: "Info")
let parser = PlistParser(plistName: Self.plistName)
self.parser = parser

guard let contents: [String: String] = parser[ConfigurationKey.base] else {
guard let contents: [String: Any] = parser[ConfigurationKey.base] else {
preconditionFailure("Configuration item not found: \(ConfigurationKey.base)")
}

Expand All @@ -44,8 +48,8 @@ public struct ConfigurationProvider: ConfigurationProviding {

self.clientID = clientID
self.redirectURI = redirectURI
Self.isSandbox = Bool(contents[ConfigurationKey.sandbox] ?? "") ?? false
self.serverToken = contents[ConfigurationKey.serverToken]
Self.isSandbox = (contents[ConfigurationKey.sandbox] as? Bool) ?? false
self.serverToken = contents[ConfigurationKey.serverToken] as? String
}

// MARK: ConfigurationProviding
Expand Down Expand Up @@ -90,7 +94,7 @@ public struct ConfigurationProvider: ConfigurationProviding {
static let base = "Uber"
static let clientID = "ClientID"
static let redirectURI = "RedirectURI"
static let serverToken = "RedirectURI"
static let serverToken = "ServerToken"
static let sandbox = "Sandbox"
}
}
3 changes: 1 addition & 2 deletions Sources/UberRides/RidesCore/Utilities/RidesUtil.swift
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ class RequestURLUtil {
case Dropoff = "dropoff"
}

private static let configurationProvider = ConfigurationProvider()
static let actionKey = "action"
static let setPickupValue = "setPickup"
static let clientIDKey = "client_id"
Expand All @@ -110,7 +109,7 @@ class RequestURLUtil {
static let formattedAddressKey = "[formatted_address]"
static let userAgentKey = "user-agent"

static func buildRequestQueryParameters(_ rideParameters: RideParameters) -> [URLQueryItem] {
static func buildRequestQueryParameters(_ rideParameters: RideParameters, configurationProvider: ConfigurationProviding = ConfigurationProvider()) -> [URLQueryItem] {

var queryItems = [URLQueryItem]()
queryItems.append(URLQueryItem(name: RequestURLUtil.actionKey, value: RequestURLUtil.setPickupValue))
Expand Down
926 changes: 0 additions & 926 deletions examples/Swift SDK/Swift SDK.xcodeproj/project.pbxproj

This file was deleted.

76 changes: 0 additions & 76 deletions examples/Swift SDK/Swift SDK/AppDelegate.swift

This file was deleted.

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
60 changes: 0 additions & 60 deletions examples/Swift SDK/Swift SDK/AuthorizationBaseViewController.swift

This file was deleted.

Loading

0 comments on commit d91ca25

Please sign in to comment.