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

[Feature/#277] 웹뷰 os type, 버전 파라미터 추가 #279

Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@

import Foundation

import DomainApplicationInterface
import DomainApplication

import CoreWebViewInterface
import CoreKeyChainStoreInterface
import CoreKeyChainStore

import Dependencies

public enum BottleWebViewType {
private var baseURL: String {
(Bundle.main.infoDictionary?["WEB_VIEW_BASE_URL"] as? String) ?? ""
Expand Down Expand Up @@ -67,11 +72,15 @@ public enum BottleWebViewType {
// MARK: - private methods
private extension BottleWebViewType {
func makeUrlWithToken(_ path: String) -> URL {
@Dependency(\.applicationClient) var applicationClient

var components = URLComponents(string: baseURL)
components?.path = "/\(path)"
components?.queryItems = [
URLQueryItem(name: "accessToken", value: KeyChainTokenStore.shared.load(property: .accessToken)),
URLQueryItem(name: "refreshToken", value: KeyChainTokenStore.shared.load(property: .refreshToken))
URLQueryItem(name: "refreshToken", value: KeyChainTokenStore.shared.load(property: .refreshToken)),
URLQueryItem(name: "device", value: "ios"),
URLQueryItem(name: "version", value: applicationClient.fetchCurrentAppVersion())
]

return (components?.url)!
Expand Down