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

Release/2.0.0 beta.1 #194

Merged
merged 4 commits into from
Mar 29, 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
2 changes: 2 additions & 0 deletions KuringApp/KuringApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = KuringApp/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "쿠링";
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities";
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
Expand Down Expand Up @@ -447,6 +448,7 @@
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = KuringApp/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "쿠링";
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities";
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
Expand Down
2 changes: 2 additions & 0 deletions KuringApp/KuringApp/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
</dict>
</dict>
</dict>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
Expand Down
18 changes: 15 additions & 3 deletions package-kuring/Sources/UIKit/CommonUI/View.onFetchAllData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,24 @@ struct KuringLinkFetcher: ViewModifier {
@State private var showsNetworkError: Bool = false
@Dependency(\.kuringLink) private var kuringLink

@AppStorage("com.kuring.sdk.token.fcm")
var fcmToken: String = ""

let onRequest: () -> Void
let onCompletion: (Result<Void, Error>) -> Void

func body(content: Content) -> some View {
content
.task { await request() }
.task {
guard !fcmToken.isEmpty else { return }
await request()
}
.onChange(of: fcmToken) { oldValue, newValue in
// 앱 설치 초기에 뒤늦게 FCM 토큰을 발급 받는 경우
guard oldValue.isEmpty else { return }
guard !newValue.isEmpty else { return }
Task { await request() }
}
.alert("앗! 인터넷 연결이 좋지 않아요!", isPresented: $showsNetworkError) {
// 무시
Button(role: .cancel) {
Expand All @@ -39,11 +51,11 @@ struct KuringLinkFetcher: ViewModifier {

async let subscribedDepartments = try kuringLink.getSubscribedDepartments()
async let subscribedUnivNotices = try kuringLink.getSubscribedUnivNotices()
let _ = try await [subscribedDepartments, subscribedUnivNotices]
let _ = try? await [subscribedDepartments, subscribedUnivNotices]
onCompletion(.success(()))
} catch {
showsNetworkError = true
onCompletion(.failure(error))
showsNetworkError = true
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public struct DepartmentRow: View {
.foregroundStyle(
isSelected
? Color.Kuring.primary
: Color.Kuring.gray400
: Color.Kuring.gray200
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ struct SubscriptionView: View {
Spacer()

Image(systemName: isSelected ? "checkmark.circle.fill" : "circle")
.foregroundStyle(isSelected ? Color.Kuring.primary : Color.black.opacity(0.1))
.foregroundStyle(isSelected ? Color.Kuring.primary : Color.Kuring.gray200)
.frame(width: 20, height: 20)
}
.padding(.horizontal, 21.5)
Expand Down