Skip to content

Commit

Permalink
[Release] v2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
chaentopia committed Feb 28, 2024
2 parents 4858eb2 + dd7401a commit 81281c1
Show file tree
Hide file tree
Showing 315 changed files with 6,770 additions and 1,337 deletions.
1 change: 1 addition & 0 deletions YELLO-iOS/.swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ opt_in_rules:

excluded:
- YELLO-iOS/Application
- YELLO-iOS/Global
550 changes: 536 additions & 14 deletions YELLO-iOS/YELLO-iOS.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,24 @@
"version" : "5.6.0"
}
},
{
"identity" : "swift-package-manager-google-mobile-ads",
"kind" : "remoteSourceControl",
"location" : "https://github.com/googleads/swift-package-manager-google-mobile-ads.git",
"state" : {
"revision" : "4668daa078c7e104df9f5b8a80a7638cab19bb4e",
"version" : "11.0.1"
}
},
{
"identity" : "swift-package-manager-google-user-messaging-platform",
"kind" : "remoteSourceControl",
"location" : "https://github.com/googleads/swift-package-manager-google-user-messaging-platform.git",
"state" : {
"revision" : "129fa838520cd02174f890ae0cfe0242e60714ae",
"version" : "2.1.0"
}
},
{
"identity" : "swift-protobuf",
"kind" : "remoteSourceControl",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@
ReferencedContainer = "container:YELLO-iOS.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<EnvironmentVariables>
<EnvironmentVariable
key = "OS_ACTIVITY_MODE"
value = "disable"
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
32 changes: 18 additions & 14 deletions YELLO-iOS/YELLO-iOS/Application/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ import Amplitude
import Firebase
import FirebaseCore
import FirebaseMessaging
import GoogleMobileAds
import KakaoSDKCommon
import KakaoSDKAuth


@main
class AppDelegate: UIResponder, UIApplicationDelegate {

Expand Down Expand Up @@ -52,6 +54,22 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
.setOnce("user_revenue", value: NSNumber(value: 0))
guard let identify = identify else { return true }
Amplitude.instance().identify(identify)

/// Mobile Ads SDK
AppTracking.requestTrackingAuthorization()
let ads = GADMobileAds.sharedInstance()
ads.start { status in
// Optional: Log each adapter's initialization latency.
let adapterStatuses = status.adapterStatusesByClassName
for adapter in adapterStatuses {
let adapterStatus = adapter.value
NSLog("Adapter Name: %@, Description: %@, Latency: %f", adapter.key,
adapterStatus.description, adapterStatus.latency)
print("\(adapterStatus.description)")
}
}


return true
}

Expand Down Expand Up @@ -116,20 +134,6 @@ extension AppDelegate: MessagingDelegate {
print("FirebaseMessaging")
guard let fcmToken = fcmToken else { return }
let deviceToken:[String: String] = ["token": fcmToken]
if UserManager.shared.deviceToken.isEmpty {
let requestDTO = DeviceTokenRefreshRequestDTO(deviceToken: fcmToken)
NetworkService.shared.onboardingService.putRefreshDeviceToken(requsetDTO: requestDTO) { result in
switch result {
case .success(let data):
if data.status == 200 || data.status == 201 {
UserManager.shared.deviceToken = fcmToken
print("Device token 재발급 완료:", deviceToken)
}
default:
print("deviceToken 재발급 오류")
}
}
}
UserManager.shared.deviceToken = fcmToken
print("Device token:", deviceToken)
}
Expand Down
38 changes: 38 additions & 0 deletions YELLO-iOS/YELLO-iOS/Application/AppTracking.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
//
// AppTracking.swift
// YELLO-iOS
//
// Created by 지희의 MAC on 2/18/24.
//

import AdSupport
import AppTrackingTransparency
import Foundation

final class AppTracking {
static var idfa: UUID {
return ASIdentifierManager.shared().advertisingIdentifier
}

static func requestTrackingAuthorization() {
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
if #available(iOS 14, *) {
ATTrackingManager.requestTrackingAuthorization { (status) in
switch status {
case .notDetermined:
print("notDetermined") // 결정되지 않음
case .restricted:
print("restricted") // 제한됨
case .denied:
print("denied") // 거부됨
case .authorized:
print("authorized") // 허용됨
debugPrint("사용자의IDFA: \(idfa)")
@unknown default:
print("error") // 알려지지 않음
}
}
}
}
}
}
79 changes: 6 additions & 73 deletions YELLO-iOS/YELLO-iOS/Application/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -109,72 +109,8 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
selectedIndex = 3
rootViewController.selectedIndex = selectedIndex
let myYelloDetailViewController = MyYelloDetailViewController()
NetworkService.shared.myYelloService.myYelloDetail(voteId: Int(messageNumber) ?? 0) { response in
switch response {
case .success(let data):
guard let data = data.data else { return }

myYelloDetailViewController.myYelloDetailView.voteIdNumber = Int(messageNumber) ?? 0
myYelloDetailViewController.colorIndex = data.colorIndex
myYelloDetailViewController.myYelloDetailView.currentPoint = data.currentPoint
myYelloDetailViewController.myYelloDetailView.detailSenderView.isHidden = false
myYelloDetailViewController.myYelloDetailView.detailKeywordView.isHidden = false
myYelloDetailViewController.myYelloDetailView.genderLabel.isHidden = false
myYelloDetailViewController.myYelloDetailView.instagramView.isHidden = false
myYelloDetailViewController.myYelloDetailView.keywordButton.isHidden = false
myYelloDetailViewController.myYelloDetailView.senderButton.isHidden = false
myYelloDetailViewController.setBackgroundView()

if data.senderGender == "MALE" {
myYelloDetailViewController.myYelloDetailView.genderLabel.text = StringLiterals.MyYello.Detail.male
} else {
myYelloDetailViewController.myYelloDetailView.genderLabel.text = StringLiterals.MyYello.Detail.female
}

if data.vote.nameHead == nil {
myYelloDetailViewController.myYelloDetailView.detailKeywordView.nameKeywordLabel.text = "" + (data.vote.nameFoot ?? "")
} else {
myYelloDetailViewController.myYelloDetailView.detailKeywordView.nameKeywordLabel.text = (data.vote.nameHead ?? "") + "" + (data.vote.nameFoot ?? "")
}

myYelloDetailViewController.myYelloDetailView.detailKeywordView.keywordHeadLabel.text = (data.vote.keywordHead ?? "")
myYelloDetailViewController.myYelloDetailView.detailKeywordView.keywordLabel.text = data.vote.keyword
myYelloDetailViewController.myYelloDetailView.detailKeywordView.keywordFootLabel.text = (data.vote.keywordFoot ?? "")

myYelloDetailViewController.myYelloDetailView.isKeywordUsed = data.isAnswerRevealed

if data.nameHint == 0 {
myYelloDetailViewController.myYelloDetailView.isSenderUsed = true
if let initial = myYelloDetailViewController.getFirstInitial(data.senderName as NSString, index: 0) {
myYelloDetailViewController.myYelloDetailView.detailSenderView.senderLabel.text = initial
}
} else if data.nameHint == 1 {
myYelloDetailViewController.myYelloDetailView.isSenderUsed = true
if let initial = myYelloDetailViewController.getSecondInitial(data.senderName as NSString, index: 1) {
myYelloDetailViewController.myYelloDetailView.detailSenderView.senderLabel.text = initial
}
} else if data.nameHint == -3 {
myYelloDetailViewController.myYelloDetailView.isSenderUsed = true
myYelloDetailViewController.myYelloDetailView.detailSenderView.senderLabel.text = data.senderName
myYelloDetailViewController.myYelloDetailView.isKeywordUsed = true
myYelloDetailViewController.myYelloDetailView.senderButton.setButtonState(state: .noTicket)
myYelloDetailViewController.myYelloDetailView.keywordButton.isHidden = true
myYelloDetailViewController.myYelloDetailView.haveTicket = false
myYelloDetailViewController.myYelloDetailView.senderButton.snp.makeConstraints {
$0.top.equalTo(myYelloDetailViewController.myYelloDetailView.instagramView.snp.bottom).offset(77.adjustedHeight)
}
}
if data.isSubscribe {
myYelloDetailViewController.myYelloDetailView.isPlus = true
}
myYelloDetailViewController.myYelloDetailView.ticketCount = data.ticketCount

navigationController.pushViewController(myYelloDetailViewController, animated: true)
default:
print("network fail")
return
}
}
myYelloDetailViewController.myYelloDetail(voteId: Int(messageNumber) ?? 0)
navigationController.pushViewController(myYelloDetailViewController, animated: true)
}
}
}
Expand Down Expand Up @@ -241,15 +177,12 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
print(splitCurrentProjectVersion)

if splitCurrentProjectVersion.count > 0 && splitMarketingVersion.count > 0 {
if splitCurrentProjectVersion[0] < splitMarketingVersion[0] {
self.showUpdateAlert(version: marketingVersion)
} else if splitCurrentProjectVersion[1] < splitMarketingVersion[1] {

if splitCurrentProjectVersion[0] > splitMarketingVersion[0] {
print("현재 최신 버전입니다.")
} else if splitCurrentProjectVersion[0] < splitMarketingVersion[0] || splitCurrentProjectVersion[1] < splitMarketingVersion[1] {
self.showUpdateAlert(version: marketingVersion)
} else {
// print(marketingVersion)
// print(currentProjectVersion)
// print(splitMarketingVersion)
// print(splitCurrentProjectVersion)
print("현재 최신 버전입니다.")
}
}
Expand Down
20 changes: 20 additions & 0 deletions YELLO-iOS/YELLO-iOS/Global/Extensions/Array+.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// Array+.swift
// YELLO-iOS
//
// Created by 지희의 MAC on 2/10/24.
//

import Foundation

extension Array {
subscript (safe index: Array.Index) -> Element? {
get {
return indices ~= index ? self[index] : nil
}
set {
guard let element = newValue else { return }
self[index] = element
}
}
}
10 changes: 10 additions & 0 deletions YELLO-iOS/YELLO-iOS/Global/Literals/Image.swift
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ enum ImageLiterals {
enum Around {
static var imgAround: UIImage { .load(named: "imgAround") }
static var icPolygon: UIImage { .load(named: "icPolygon") }
static var icInformation: UIImage { .load(named: "icInformation") }
static var icChevronDownGray: UIImage { .load(named: "icChevronDownGray") }
}

enum MyYello {
Expand All @@ -143,15 +145,21 @@ enum ImageLiterals {
static var icKeyWhite: UIImage { .load(named: "icKeyWhite") }
static var icShop: UIImage { .load(named: "icShop") }
static var icSalePolygon: UIImage { .load(named: "icSalePolygon") }
static var icMegaphone: UIImage { .load(named: "icMegaphone") }
}

enum Profile {
static var imgDefaultProfile: UIImage { .load(named: "imgDefaultProfile") }
static var icPlus: UIImage { .load(named: "icPlus") }
static var icArrowUp: UIImage { .load(named: "icArrowUp") }
static var icArrowLeftWhite: UIImage { .load(named: "icArrowLeftWhite") }
static var icRight: UIImage { .load(named: "icRight")}
static var icRightSmall: UIImage { .load(named: "chevron-right-small")}
static var btnDelete: UIImage { .load(named: "btnDelete") }
static var icProfileStar: UIImage { .load(named: "icProfileStar") }
static var icEdit: UIImage { .load(named: "ic_Edit") }
static var icRotate: UIImage { .load(named: "rotate-ccw") }
static var icAlert: UIImage { .load(named: "alert-circle") }
}

enum Recommending {
Expand All @@ -162,6 +170,7 @@ enum ImageLiterals {
static var icSearchWhite: UIImage { .load(named: "icSearchWhite")}
static var imgFriendSearch: UIImage { .load(named: "imgFriendSearch")}
static var imgSearchNoResult: UIImage { .load(named: "imgSearchNoResult")}
static var btnAddFriend: UIImage { .load(named: "btnAddFriend")}
}

enum Payment {
Expand All @@ -181,6 +190,7 @@ enum ImageLiterals {
static var imgNameKeyOneCheck: UIImage { .load(named: "imgNameKeyOneCheck")}
static var imgNameKeyTwoCheck: UIImage { .load(named: "imgNameKeyTwoCheck")}
static var imgNameKeyFiveCheck: UIImage { .load(named: "imgNameKeyFiveCheck")}
static var imgCoin: UIImage { .load(named: "coin")}
}

enum Withdrawal {
Expand Down
Loading

0 comments on commit 81281c1

Please sign in to comment.