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

Feat/#302 FirebaseAnalytics 작업 #307

Merged
merged 17 commits into from
May 17, 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
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,6 @@ download-env:

download-googleinfo:
$(call download_file, Projects/App/Resources, $(token),GoogleService-Info.plist)
$(call download_file, Projects/App/Resources, $(token),GoogleService-Info-debugging.plist)


Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public extension String {
static let organizationName = "Pepsi-Club"
static let teamId = "T4W7695R5C"
/// 앱스토어에 게시할 때마다 증가해줘야 하는 버전
static let marketingVersion: Self = "1.2.2"
static let marketingVersion: Self = "1.2.3"
/// 개발자가 내부적으로 확인하기 위한 용도 (날짜를 사용하기도 함 - 2023.12.8.1 )
static var buildVersion: Self {
let date = Date()
Expand Down
28 changes: 9 additions & 19 deletions Plugins/EnvironmentPlugin/ProjectDescriptionHelpers/Scheme.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,15 @@ public extension Scheme {
codeCoverageTargets: ["\(name)"]
)
),
runAction: .runAction(configuration: .debug),
runAction: .runAction(
configuration: .debug,
arguments: .init(launchArguments: [
.init(
name: "-FIRDebugEnabled",
isEnabled: true
)
])
),
archiveAction: .archiveAction(configuration: .release)
)
}
Expand All @@ -43,22 +51,4 @@ public extension Scheme {
archiveAction: .archiveAction(configuration: .release)
)
}

static func appDebugScheme(name: String) -> Self {
Scheme(
name: "\(name)-FirebaseDebug",
shared: true,
buildAction: .buildAction(targets: ["\(name)-FirebaseDebug"]),
runAction: .runAction(
configuration: .debug,
arguments: Arguments(
launchArguments: [
.init(name: "-FIRDebugEnabled", isEnabled: true)
]
)
),
// TODO: 검토필요
archiveAction: .archiveAction(configuration: .debug)
)
}
}
3 changes: 1 addition & 2 deletions Projects/App/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ let project = Project.makeProject(
dependencies: [
.mainFeature,
.data,
.package(product: "FirebaseMessaging"),
.package(product: "FirebaseAnalytics")
.package(product: "FirebaseMessaging")
]
)
8 changes: 4 additions & 4 deletions Projects/App/Resources/Base.lproj/LaunchScreen.storyboard
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="22505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22684"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22504"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
Expand All @@ -17,7 +17,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="appLogo2.png" translatesAutoresizingMaskIntoConstraints="NO" id="SN6-pt-WKY">
<rect key="frame" x="116.66666666666669" y="276" width="170" height="300"/>
<rect key="frame" x="111.66666666666669" y="276" width="170" height="300"/>
<constraints>
<constraint firstAttribute="width" constant="170" id="asc-3z-qNR"/>
<constraint firstAttribute="height" constant="300" id="zZi-DE-9nG"/>
Expand All @@ -28,7 +28,7 @@
<color key="backgroundColor" red="0.37647058823529411" green="0.47058823529411764" blue="0.81960784313725488" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="SN6-pt-WKY" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="FsO-Z9-kQF"/>
<constraint firstItem="SN6-pt-WKY" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" constant="5" id="cME-92-iZn"/>
<constraint firstItem="SN6-pt-WKY" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="cME-92-iZn"/>
</constraints>
</view>
</viewController>
Expand Down
26 changes: 9 additions & 17 deletions Projects/App/Sources/AppDelegate+Firebase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,21 @@ import UIKit

import Firebase
import FirebaseMessaging
import FirebaseAnalytics

extension AppDelegate {
func configureFirebase(application: UIApplication) {
var googleInfoName: String
#if DEBUG
googleInfoName = "GoogleService-Info-debugging"
#else
googleInfoName = "GoogleService-Info"
#endif
guard let filePath = Bundle.main.path(
forResource: "GoogleService-Info",
forResource: googleInfoName,
ofType: "plist"
),
let options = FirebaseOptions(contentsOfFile: filePath)
else { return }
let options = FirebaseOptions(contentsOfFile: filePath)
else { return }
FirebaseApp.configure(options: options)
application.registerForRemoteNotifications()
}
Expand Down Expand Up @@ -47,16 +52,3 @@ extension AppDelegate: MessagingDelegate {
)
}
}

extension AppDelegate {
func configureDebuggingFB(application: UIApplication) {
guard let filePath = Bundle.main.path(
forResource: "GoogleService-debugging-Info",
ofType: "plist"
),
let options = FirebaseOptions(contentsOfFile: filePath)
else { return }
FirebaseApp.configure(options: options)
application.registerForRemoteNotifications()
}
}
10 changes: 2 additions & 8 deletions Projects/App/Sources/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,8 @@ final class AppDelegate: UIResponder, UIApplicationDelegate {
setupAppearance()
registerDependencies()
configureNotification(application: application)
#if DEBUG
configureDebuggingFB(application: application)
var newArguments = ProcessInfo.processInfo.arguments
newArguments.append("-FIRDebugEnabled")
ProcessInfo.processInfo.setValue(newArguments, forKey: "arguments")
#else
configureFirebase(application: application)
#endif


return true
}

Expand All @@ -52,3 +45,4 @@ final class AppDelegate: UIResponder, UIApplicationDelegate {
) {
}
}

6 changes: 3 additions & 3 deletions Projects/Core/Sources/Extension/UIColor+.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ public extension UIColor {
return UIColor { traitCollection in
if traitCollection.userInterfaceStyle == .dark {
return UIColor(
red: 20/255,
green: 20/255,
blue: 23/255,
red: 25/255,
green: 25/255,
blue: 25/255,
alpha: 1.0
)
} else {
Expand Down
3 changes: 2 additions & 1 deletion Projects/Data/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ let project = Project.makeProject(
moduleType: .dynamicFramework,
dependencies: [
.networkService,
.coreDataService
.coreDataService,
.package(product: "FirebaseAnalytics"),
],
coreDataModel: [
.init(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import Domain
import NetworkService

import RxSwift
import FirebaseAnalytics

public final class DefaultBusStopArrivalInfoRepository:
NSObject, BusStopArrivalInfoRepository {
Expand All @@ -23,10 +24,10 @@ public final class DefaultBusStopArrivalInfoRepository:
self.networkService = networkService
}

public func fetchArrivalList(
busStopId: String
) -> Observable<BusStopArrivalInfoResponse> {
networkService.request(
public func fetchArrivalList(busStopId: String) ->
Observable<BusStopArrivalInfoResponse> {
Analytics.logEvent("fetchArrivalEvent", parameters: nil)
return networkService.request(
endPoint: BusStopArrivalInfoEndPoint(arsId: busStopId)
)
.decode(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "0.980",
"alpha" : "1.000",
"blue" : "0x12",
"green" : "0x0F",
"red" : "0x0F"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
//

import UIKit
import Lottie

import DesignSystem

import Lottie

final class EmptyFavoritesView: UIView {
private let listLottieView: LottieAnimationView = {
let imgView = LottieAnimationView(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ public final class BusStopInformationView: UIView {
equalTo: leadingAnchor,
constant: 15
),
busStopNameLabel.trailingAnchor.constraint(
equalTo: trailingAnchor,
constant: -15
),

busStopDescription.leadingAnchor.constraint(
equalTo: busStopNameLabel.leadingAnchor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public final class SearchTextFieldView: UITextField {
private func configureUI() {
self.backgroundColor = .adaptiveWhite
self.font =
DesignSystemFontFamily.NanumSquareNeoOTF.regular.font(size: 15)
DesignSystemFontFamily.NanumSquareNeoOTF.regular.font(size: 14)
self.layer.cornerRadius = 15
self.clipsToBounds = true
self.contentVerticalAlignment = .center
Expand Down
1 change: 0 additions & 1 deletion Tuist/ProjectDescriptionHelpers/Project+Templates.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ extension Project {
}
schemes.append(.moduleScheme(name: name))
schemes.append(.uiTestsScheme(name: name))
schemes.append(.appDebugScheme(name: name))
case .dynamicFramework, .staticFramework:
targetModule = frameworkTarget(
name: name,
Expand Down
Loading