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

[QA] v2.1.0 을 테스트 플라이트에 올립니다. #100

Merged
merged 42 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
6b52c24
[#66] priceLabel 정렬 기준 수정
CJiu01 Sep 18, 2024
7ab9ab4
[#66] Int -> formattedWithCommas를 통한 String 반환 extension 추가
CJiu01 Sep 18, 2024
785f99b
[#66] formattedWithCommas description 추가
CJiu01 Sep 18, 2024
5e12a5d
[#83] BaseView & BaseViewController 코드 내 문서 작성 및 추상화 강화
jayn2u Sep 19, 2024
9ad45c6
[#66] formattedWithCommas description 수정
CJiu01 Sep 19, 2024
6411317
Merge pull request #82 from EAT-SSU/fix/#66
CJiu01 Sep 19, 2024
9e64f53
[#85] BaseView & BaseViewController 추상화 강화에 따른 누락된 오버라이딩 메소드 보수
jayn2u Sep 19, 2024
6e4c998
Merge pull request #84 from EAT-SSU/refactor/#83
jayn2u Sep 19, 2024
b6d047f
[#28] unsupported version 이슈로 인한 Realm v15.2.1 upgrade
CJiu01 Sep 19, 2024
2bb6c2e
[#28] Realm UserInfo 관리를 위한 UserInfoManager 추가
CJiu01 Sep 19, 2024
7daf575
[#28] Realm v20.0.0 update
CJiu01 Sep 19, 2024
dfbe15d
[#28] 로컬DB에서 사용자 nickname/accountType 관리를 위한 UserInfo 객체 생성
CJiu01 Sep 19, 2024
fc1a482
[#28] Realm의 특정 Object 요소 전체삭제를 위한 메소드 추가
CJiu01 Sep 19, 2024
88f8d8a
[#28] 로그인 시, 사용자 정보 로컬DB에 저장
CJiu01 Sep 19, 2024
ca47b64
[#28] realm에서 사용자 정보 불러오는 로직으로 수정
CJiu01 Sep 19, 2024
9e23e22
[#28] 닉네임 설정/변경 시 realm의 정보 업데이트
CJiu01 Sep 19, 2024
9f61345
[#78] 푸시 알림 토글 스위치 + 재설계된 UI 구현
jayn2u Sep 19, 2024
d2d9a69
Merge pull request #86 from EAT-SSU/fix/#85
jayn2u Sep 20, 2024
81c1a1d
Merge pull request #87 from EAT-SSU/fix/#28
CJiu01 Sep 20, 2024
b094263
[#88] 폴더링 개편
jayn2u Sep 21, 2024
b2f442e
Merge pull request #89 from EAT-SSU/refactor/#88
jayn2u Sep 21, 2024
2760e72
Merge branch 'temp' into feat/#78
jayn2u Sep 22, 2024
a2814ae
Merge branch 'temp' into feat/#78
jayn2u Sep 22, 2024
9b24e17
[#28] unsupported version 이슈로 인한 Realm v15.2.1 upgrade
CJiu01 Sep 19, 2024
45e3741
[#28] Realm UserInfo 관리를 위한 UserInfoManager 추가
CJiu01 Sep 19, 2024
80f7b44
[#28] 로컬DB에서 사용자 nickname/accountType 관리를 위한 UserInfo 객체 생성
CJiu01 Sep 19, 2024
466d6d9
[#28] Realm의 특정 Object 요소 전체삭제를 위한 메소드 추가
CJiu01 Sep 19, 2024
a8c8250
[#28] 로그인 시, 사용자 정보 로컬DB에 저장
CJiu01 Sep 19, 2024
5b195b7
[#28] Realm에서 사용자 정보 불러오는 로직으로 수정
jayn2u Sep 22, 2024
7b458d7
[#28] 닉네임 설정/변경 시 realm의 정보 업데이트
CJiu01 Sep 19, 2024
89a32be
[#88] 폴더링 개편
jayn2u Sep 22, 2024
0d55dbd
Merge branch 'develop' into feat/#78-trying-to-merge
jayn2u Sep 22, 2024
0b755bb
[#91] ImageLiteral에서 사용 중인 이미지 파일 경로 재참조
jayn2u Sep 22, 2024
ffc378e
Merge branch 'fix/#91' into feat/#78-trying-to-merge
jayn2u Sep 22, 2024
71e57d2
[#78] 푸시 알림 토글 스위치 생성
jayn2u Sep 22, 2024
f9151f0
Merge pull request #92 from EAT-SSU/fix/#91
jayn2u Sep 22, 2024
a1cab32
[#78] 탈퇴하기 버튼 비즈니스 로직 연결
jayn2u Sep 22, 2024
90c9f99
[#94] 푸시 알림 토글 스위치 토스트 메시지 연결
jayn2u Sep 22, 2024
4dd417c
[#96] 앱을 처음 설치하고 푸시 알림 동의를 받았을 때, 푸시 알림 스위치가 켜져있도록 조치
jayn2u Sep 23, 2024
1b027e0
Merge pull request #93 from EAT-SSU/feat/#78
jayn2u Sep 23, 2024
289238f
Merge pull request #95 from EAT-SSU/feat/#94
jayn2u Sep 23, 2024
becb3a2
Merge pull request #99 from EAT-SSU/feat/#96
jayn2u Sep 23, 2024
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 @@ -2,5 +2,8 @@
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"provides-namespace" : true
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "KakaoLoginButton.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "LookAroundButton.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "Unsubscribe.png",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

This file was deleted.

This file was deleted.

Binary file removed EATSSU_MVC/EATSSU_MVC/Resources/SplashEvent.png
Diff not rendered.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import UIKit

import SnapKit

class NoticeViewController:BaseViewController {
/// FirebaseRemoteConfig 관련 ViewController
class NoticeViewController: BaseViewController {

// MARK: - Properties
var noticeMessage: String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ class RealmService{
static let shared = RealmService()

let realm = try! Realm()

init() {
print("Realm Location: ", realm.configuration.fileURL ?? "cannot find location.")
}

func addToken(accessToken:String,refreshToken:String) {
let token = Token(accessToken: accessToken,refreshToken: refreshToken)
Expand Down Expand Up @@ -40,20 +44,19 @@ class RealmService{
try! realm.write {
realm.deleteAll()
}

}

func addUser(accessToken: String, nickName: String) {
let nickName = NickName(accessToken: accessToken, nickName: nickName)
try! realm.write {
realm.add(nickName)

func deleteAll<T: Object>(_ objectType: T.Type) {
do {
let objects = realm.objects(objectType)
try realm.write {
realm.delete(objects)
print("Successfully deleted all objects of type \(objectType)")
}
} catch let error {
print(error)
}
}

init() {
print("Realm Location: ", realm.configuration.fileURL ?? "cannot find location.")
}

}


40 changes: 40 additions & 0 deletions EATSSU_MVC/EATSSU_MVC/Sources/Data/LocalDB/UserInfo.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
//
// UserInfo.swift
// EatSSU-iOS
//
// Created by 박윤빈 on 2023/08/02.
//

import RealmSwift
import Realm

class UserInfo: Object {

@Persisted(primaryKey: true) var id: String = UUID().uuidString
@Persisted var nickname: String = ""
@Persisted private var accountTypeRaw: String?

var accountType: AccountType? {
get {
guard let rawValue = accountTypeRaw else { return nil }
return AccountType(rawValue: rawValue)
}
set {
accountTypeRaw = newValue?.rawValue
}
}

convenience init(accountType: AccountType) {
self.init()
self.accountType = accountType
}

func updateNickname(_ nickname: String) {
self.nickname = nickname
}

enum AccountType: String {
case apple = "Apple"
case kakao = "Kakao"
}
}
48 changes: 48 additions & 0 deletions EATSSU_MVC/EATSSU_MVC/Sources/Data/LocalDB/UserInfoManager.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
//
// UserInfoManager.swift
// EATSSU
//
// Created by 최지우 on 9/19/24.
//

import RealmSwift

class UserInfoManager {
static let shared = UserInfoManager()
private init() {}

private var realm: Realm {
do {
return try Realm()
} catch {
fatalError("Realm을 초기화하는데 실패했습니다: \(error)")
}
}

func createUserInfo(accountType: UserInfo.AccountType) -> UserInfo {
let userInfo = UserInfo(accountType: accountType)
do {
try realm.write {
realm.add(userInfo)
}
return userInfo
} catch {
print("UserInfo 생성 중 오류 발생: \(error)")
return userInfo
}
}

func updateNickname(for userInfo: UserInfo, nickname: String) {
do {
try realm.write {
userInfo.updateNickname(nickname)
}
} catch {
print("닉네임 업데이트 중 오류 발생: \(error)")
}
}

func getCurrentUserInfo() -> UserInfo? {
return realm.objects(UserInfo.self).first
}
}
21 changes: 0 additions & 21 deletions EATSSU_MVC/EATSSU_MVC/Sources/Network/LocalDB/NickName.swift

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,63 +9,65 @@ import Foundation
import UserNotifications

class NotificationManager {

// MARK: - Properties

static let shared = NotificationManager()
// MARK: - Properties

// MARK: - Methods
static let shared = NotificationManager()

/// 평일 11시에 앱의 유입을 유도하는 알림을 발송하는 메소드
///
/// - Title : 🤔 오늘 밥 뭐 먹지…
/// - Body : 오늘의 학식을 확인해보세요!
func scheduleWeekday11AMNotification() {
let center = UNUserNotificationCenter.current()
// MARK: - Methods

// 알림 콘텐츠 설정
let content = UNMutableNotificationContent()
/// 평일 11시에 앱의 유입을 유도하는 푸시 알림을 발송하는 메소드
///
/// - Title : 🤔 오늘 밥 뭐 먹지…
/// - Body : 오늘의 학식을 확인해보세요!
func scheduleWeekday11AMNotification() {
let center = UNUserNotificationCenter.current()

content.title = TextLiteral.Notification.dailyWeekdayNotificationTitle
content.body = TextLiteral.Notification.dailyWeekdayNotificationBody
content.sound = .default
// 알림 콘텐츠 설정
let content = UNMutableNotificationContent()

// 반복할 요일 및 시간 설정 (평일 오전 11시)
let calendar = Calendar.current
let weekdays = [2, 3, 4, 5, 6] // 월, 화, 수, 목, 금 (Calendar에서 1이 일요일)
content.title = TextLiteral.Notification.dailyWeekdayNotificationTitle
content.body = TextLiteral.Notification.dailyWeekdayNotificationBody
content.sound = .default

for weekday in weekdays {
var dateComponents = DateComponents()
dateComponents.hour = 11
dateComponents.minute = 0
dateComponents.weekday = weekday
// 반복할 요일 및 시간 설정 (평일 오전 11시)
let weekdays = [2, 3, 4, 5, 6] // 월, 화, 수, 목, 금 (Calendar에서 1이 일요일)

let trigger = UNCalendarNotificationTrigger(dateMatching: dateComponents, repeats: true)
for weekday in weekdays {
var dateComponents = DateComponents()
dateComponents.hour = 11
dateComponents.minute = 0
dateComponents.weekday = weekday

// 고유한 식별자를 위해 weekday를 사용
let identifier = "weekdayNotification-\(weekday)"
let request = UNNotificationRequest(
identifier: identifier, content: content, trigger: trigger)
let trigger = UNCalendarNotificationTrigger(dateMatching: dateComponents, repeats: true)

// 알림 등록
center.add(request) { error in
if let error = error {
print("알림 등록 간 에러 메시지: \(error.localizedDescription)")
}
}
}
}
// 고유한 식별자를 위해 weekday를 사용
let identifier = "weekdayNotification-\(weekday)"
let request = UNNotificationRequest(
identifier: identifier, content: content, trigger: trigger)

/// 앱 실행 시 알림 발송 권한을 요청하는 팝업 호출 메소드
func requestNotificationPermission() {
UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .badge]) {
granted, error in
if granted {
print("알림 권한 승인됨")
} else {
print("알림 권한 거부됨")
}
}
}
// 알림 등록
center.add(request) { error in
if let error = error {
print("알림 등록 간 에러 메시지: \(error.localizedDescription)")
}
}
}
}

/// 평일 11시에 앱의 유입을 유도하는 푸시 알림을 취소하는 메소드
func cancelWeekday11AMNotification() {
let weekday = [2, 3, 4, 5, 6]
let identifier = "weekdayNotification-\(weekday)"

let center = UNUserNotificationCenter.current()
center.removePendingNotificationRequests(withIdentifiers: [identifier])
}

/// 앱 실행 시 알림 발송 권한을 요청하는 팝업 호출 메소드
func requestNotificationPermission(completion: @escaping (_ granted : Bool) -> Void) {
UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .badge]) {
granted, _ in
completion(granted)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ final class LoginViewController: BaseViewController {
case nil:
self.pushToNicknameVC()
default:
if let currentUserInfo = UserInfoManager.shared.getCurrentUserInfo() {
UserInfoManager.shared.updateNickname(for: currentUserInfo, nickname: info.nickname ?? "")
}
self.changeIntoHomeViewController()
}
}
Expand Down Expand Up @@ -194,6 +197,7 @@ extension LoginViewController {
let responseData = try moyaResponse.map(BaseResponse<SignResponse>.self)
self.addTokenInRealm(accessToken: responseData.result.accessToken,
refreshToken: responseData.result.refreshToken)
let userInfo = UserInfoManager.shared.createUserInfo(accountType: .kakao)
self.getMyInfo()
} catch(let err) {
self.presentBottomAlert(err.localizedDescription)
Expand Down Expand Up @@ -231,6 +235,7 @@ extension LoginViewController {
let responseData = try JSONDecoder().decode(BaseResponse<SignResponse>.self, from: moyaResponse.data)
self.addTokenInRealm(accessToken: responseData.result.accessToken,
refreshToken: responseData.result.refreshToken)
let userInfo = UserInfoManager.shared.createUserInfo(accountType: .apple)
self.getMyInfo()
} catch(let err) {
self.presentBottomAlert(err.localizedDescription)
Expand Down
Loading
Loading