Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove legacy SwiftSDK sample app #311

Merged
merged 2 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading