Skip to content

Commit 43b69d4

Browse files
authored
Merge pull request #310 from teamterning/#309-앰플심기
[Fix] #309 - 푸시 알림 관련 이벤트 심기 및 1.7.0 앱스토어 배포 완료 했습니다~
2 parents 7d08911 + 99bab74 commit 43b69d4

6 files changed

Lines changed: 42 additions & 12 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ fastlane/screenshots/**/*.png
8585
fastlane/test_output
8686

8787
Config.swift
88+
**/SharedConfig.swift
8889

8990
# Code Injection
9091
#

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# 👔 terning 터닝 - 대학생 인턴, 공고 관리 캘린더
55

6-
## 앱스토어 링크 : [앱스토어](https://apps.apple.com/kr/app/terning-%ED%84%B0%EB%8B%9D-%EB%8C%80%ED%95%99%EC%83%9D-%EC%9D%B8%ED%84%B4-%EA%B3%B5%EA%B3%A0-%EA%B4%80%EB%A6%AC-%EC%BA%98%EB%A6%B0%EB%8D%94/id6547866420) v1.6.0
6+
## 앱스토어 링크 : [앱스토어](https://apps.apple.com/kr/app/terning-%ED%84%B0%EB%8B%9D-%EB%8C%80%ED%95%99%EC%83%9D-%EC%9D%B8%ED%84%B4-%EA%B3%B5%EA%B3%A0-%EA%B4%80%EB%A6%AC-%EC%BA%98%EB%A6%B0%EB%8D%94/id6547866420) v1.7.0
77
<p align="left"><img width="900" src="https://github.com/user-attachments/assets/984e7795-3746-4e7a-ad6c-cb1cb376c481"></p>
88

99
**내 계획에 딱 맞는 대학생 인턴의 시작, 터닝**

Terning-iOS/NotificationServiceExtension/NotificationService.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ final class NotificationService: UNNotificationServiceExtension {
1212
private var contentHandler: ((UNNotificationContent) -> Void)?
1313
private var bestAttemptContent: UNMutableNotificationContent?
1414

15+
1516
override func didReceive(
1617
_ request: UNNotificationRequest,
1718
withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void
@@ -57,7 +58,7 @@ final class NotificationService: UNNotificationServiceExtension {
5758

5859
do {
5960
try fileManager.moveItem(at: tempURL, to: uniqueURL)
60-
let attachment = try UNNotificationAttachment(identifier: "image", url: uniqueURL, options: nil)
61+
let attachment = try UNNotificationAttachment(identifier: "image", url: uniqueURL, options: [:])
6162
completion(attachment)
6263
} catch {
6364
print("❌ 이미지 첨부 실패: \(error)")

Terning-iOS/Terning-iOS.xcodeproj/project.pbxproj

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@
112112
7121A1572C3EA4C10056DB8B /* LoadingIndicator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7121A1562C3EA4C10056DB8B /* LoadingIndicator.swift */; };
113113
713C5A742CC1578600321E15 /* AmplitudeSwift in Frameworks */ = {isa = PBXBuildFile; productRef = 713C5A732CC1578600321E15 /* AmplitudeSwift */; };
114114
71412D122DBB79A600EA7ED5 /* PushNavigator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 71412D112DBB79A600EA7ED5 /* PushNavigator.swift */; };
115+
7145B3042E5491F80029E281 /* AmplitudeSwift in Frameworks */ = {isa = PBXBuildFile; productRef = 7145B3032E5491F80029E281 /* AmplitudeSwift */; };
115116
71461EB52C37043A002A6999 /* Pretendard-Light.otf in Resources */ = {isa = PBXBuildFile; fileRef = 71461EAC2C370439002A6999 /* Pretendard-Light.otf */; };
116117
71461EB72C37043A002A6999 /* Pretendard-Medium.otf in Resources */ = {isa = PBXBuildFile; fileRef = 71461EAE2C370439002A6999 /* Pretendard-Medium.otf */; };
117118
71461EB92C37043A002A6999 /* Pretendard-SemiBold.otf in Resources */ = {isa = PBXBuildFile; fileRef = 71461EB02C37043A002A6999 /* Pretendard-SemiBold.otf */; };
@@ -457,10 +458,17 @@
457458
);
458459
target = 71F64BC42DCA42D2006DE3D6 /* NotificationServiceExtension */;
459460
};
461+
71FD8FFF2E4AD24A00F7058F /* PBXFileSystemSynchronizedBuildFileExceptionSet */ = {
462+
isa = PBXFileSystemSynchronizedBuildFileExceptionSet;
463+
membershipExceptions = (
464+
AmplitudeEventType.swift,
465+
);
466+
target = 71F64BC42DCA42D2006DE3D6 /* NotificationServiceExtension */;
467+
};
460468
/* End PBXFileSystemSynchronizedBuildFileExceptionSet section */
461469

462470
/* Begin PBXFileSystemSynchronizedRootGroup section */
463-
713C5A772CC15B7E00321E15 /* Amplitude */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = Amplitude; sourceTree = "<group>"; };
471+
713C5A772CC15B7E00321E15 /* Amplitude */ = {isa = PBXFileSystemSynchronizedRootGroup; exceptions = (71FD8FFF2E4AD24A00F7058F /* PBXFileSystemSynchronizedBuildFileExceptionSet */, ); explicitFileTypes = {}; explicitFolders = (); path = Amplitude; sourceTree = "<group>"; };
464472
71CDCF742D33C5350087BF6B /* Home */ = {isa = PBXFileSystemSynchronizedRootGroup; exceptions = (71CDCF782D33C5430087BF6B /* PBXFileSystemSynchronizedBuildFileExceptionSet */, ); explicitFileTypes = {}; explicitFolders = (); path = Home; sourceTree = "<group>"; };
465473
71DA88DA2CFDC81D0003078C /* SwiftUI+ */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = "SwiftUI+"; sourceTree = "<group>"; };
466474
71DA89952CFDFA460003078C /* SwiftUI */ = {isa = PBXFileSystemSynchronizedRootGroup; exceptions = (71DA89982CFDFA960003078C /* PBXFileSystemSynchronizedBuildFileExceptionSet */, ); explicitFileTypes = {}; explicitFolders = (); path = SwiftUI; sourceTree = "<group>"; };
@@ -499,6 +507,7 @@
499507
isa = PBXFrameworksBuildPhase;
500508
buildActionMask = 2147483647;
501509
files = (
510+
7145B3042E5491F80029E281 /* AmplitudeSwift in Frameworks */,
502511
);
503512
runOnlyForDeploymentPostprocessing = 0;
504513
};
@@ -1581,6 +1590,7 @@
15811590
);
15821591
name = NotificationServiceExtension;
15831592
packageProductDependencies = (
1593+
7145B3032E5491F80029E281 /* AmplitudeSwift */,
15841594
);
15851595
productName = NotificationServiceExtension;
15861596
productReference = 71F64BC52DCA42D2006DE3D6 /* NotificationServiceExtension.appex */;
@@ -2024,7 +2034,7 @@
20242034
CODE_SIGN_ENTITLEMENTS = "Terning-iOS/Terning-iOS.entitlements";
20252035
CODE_SIGN_IDENTITY = "Apple Development";
20262036
CODE_SIGN_STYLE = Automatic;
2027-
CURRENT_PROJECT_VERSION = 2025.0622.0331;
2037+
CURRENT_PROJECT_VERSION = 2025.0820.1510;
20282038
DEVELOPMENT_TEAM = 8Q4H7X3Q58;
20292039
ENABLE_USER_SCRIPT_SANDBOXING = NO;
20302040
GENERATE_INFOPLIST_FILE = YES;
@@ -2041,7 +2051,7 @@
20412051
"$(inherited)",
20422052
"@executable_path/Frameworks",
20432053
);
2044-
MARKETING_VERSION = 1.6.0;
2054+
MARKETING_VERSION = 1.7.0;
20452055
OTHER_LDFLAGS = (
20462056
"-Xlinker",
20472057
"-interposable",
@@ -2068,7 +2078,7 @@
20682078
CODE_SIGN_ENTITLEMENTS = "Terning-iOS/Terning-iOS.entitlements";
20692079
CODE_SIGN_IDENTITY = "Apple Development";
20702080
CODE_SIGN_STYLE = Automatic;
2071-
CURRENT_PROJECT_VERSION = 2025.0622.0331;
2081+
CURRENT_PROJECT_VERSION = 2025.0820.1510;
20722082
DEVELOPMENT_TEAM = 8Q4H7X3Q58;
20732083
ENABLE_USER_SCRIPT_SANDBOXING = NO;
20742084
GENERATE_INFOPLIST_FILE = YES;
@@ -2085,7 +2095,7 @@
20852095
"$(inherited)",
20862096
"@executable_path/Frameworks",
20872097
);
2088-
MARKETING_VERSION = 1.6.0;
2098+
MARKETING_VERSION = 1.7.0;
20892099
PRODUCT_BUNDLE_IDENTIFIER = "com.terning.Terning-iOS";
20902100
PRODUCT_NAME = "$(TARGET_NAME)";
20912101
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -2104,7 +2114,7 @@
21042114
buildSettings = {
21052115
CODE_SIGN_IDENTITY = "Apple Development";
21062116
CODE_SIGN_STYLE = Automatic;
2107-
CURRENT_PROJECT_VERSION = 2025.0603.1653;
2117+
CURRENT_PROJECT_VERSION = 2025.0820.1510;
21082118
DEVELOPMENT_TEAM = 8Q4H7X3Q58;
21092119
ENABLE_USER_SCRIPT_SANDBOXING = YES;
21102120
GENERATE_INFOPLIST_FILE = YES;
@@ -2132,7 +2142,7 @@
21322142
buildSettings = {
21332143
CODE_SIGN_IDENTITY = "Apple Development";
21342144
CODE_SIGN_STYLE = Automatic;
2135-
CURRENT_PROJECT_VERSION = 2025.0603.1653;
2145+
CURRENT_PROJECT_VERSION = 2025.0820.1510;
21362146
DEVELOPMENT_TEAM = 8Q4H7X3Q58;
21372147
ENABLE_USER_SCRIPT_SANDBOXING = YES;
21382148
GENERATE_INFOPLIST_FILE = YES;
@@ -2319,6 +2329,11 @@
23192329
package = 713C5A722CC1578600321E15 /* XCRemoteSwiftPackageReference "Amplitude-Swift" */;
23202330
productName = AmplitudeSwift;
23212331
};
2332+
7145B3032E5491F80029E281 /* AmplitudeSwift */ = {
2333+
isa = XCSwiftPackageProductDependency;
2334+
package = 713C5A722CC1578600321E15 /* XCRemoteSwiftPackageReference "Amplitude-Swift" */;
2335+
productName = AmplitudeSwift;
2336+
};
23222337
717D37E92C32FA2F00A857DB /* SnapKit */ = {
23232338
isa = XCSwiftPackageProductDependency;
23242339
package = 717D37E82C32FA2F00A857DB /* XCRemoteSwiftPackageReference "SnapKit" */;

Terning-iOS/Terning-iOS/Application/AppDelegate.swift

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
2626

2727
setupFCM(application)
2828

29+
// 푸시 알림 이벤트 추적: 앱 종료 상태에서 푸시 클릭으로 앱 실행
30+
// 앱이 완전히 종료된 상태에서 사용자가 푸시 알림을 탭하여 앱이 실행될 때 호출
31+
// push_notification_opened 이벤트가 Amplitude에 정상적으로 로깅됨
32+
if let notificationUserInfo = launchOptions?[.remoteNotification] as? [String: Any] {
33+
track(eventName: .pushNotificationOpened)
34+
print("🔔 앱 종료 상태에서 푸시 알림 클릭으로 실행됨")
35+
}
36+
2937
return true
3038
}
3139

@@ -64,7 +72,9 @@ extension AppDelegate: UNUserNotificationCenterDelegate {
6472
Messaging.messaging().apnsToken = deviceToken
6573
}
6674

67-
/// 푸시 클릭시
75+
/// 푸시 알림 이벤트 추적: 백그라운드/포그라운드에서 푸시 클릭
76+
/// 앱이 백그라운드 또는 포그라운드 상태에서 사용자가 푸시 알림을 탭했을 때 호출
77+
/// push_notification_opened 이벤트가 Amplitude에 정상적으로 로깅됨
6878
func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse) async {
6979

7080
track(eventName: .pushNotificationOpened)
@@ -75,7 +85,9 @@ extension AppDelegate: UNUserNotificationCenterDelegate {
7585
}
7686
}
7787

78-
/// Foreground(앱 켜진 상태)에서도 알림 오는 설정
88+
/// 푸시 알림 이벤트 추적: 앱 실행 중(포그라운드) 푸시 수신
89+
/// 앱이 포그라운드에서 실행 중일 때 푸시 알림을 받으면 호출
90+
/// push_notification_received 이벤트가 Amplitude에 정상적으로 로깅됨
7991
func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {
8092

8193
track(eventName: .pushNotificationReceived)
@@ -133,6 +145,7 @@ extension AppDelegate: MessagingDelegate {
133145
// TODO: If necessary send token to application server.
134146
// Note: This callback is fired at each app startup and whenever a new token is generated.
135147
}
148+
136149
}
137150

138151
extension AppDelegate {

Terning-iOS/Terning-iOS/Resource/Amplitude/AmplitudeManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ public extension Amplitude {
1818
func track(eventType: AmplitudeEventType, eventProperties: [String: Any]? = nil) {
1919
let eventType: String = eventType.rawValue
2020

21-
AmplitudeManager.shared.track(eventType: eventType, eventProperties: eventProperties, options: nil)
21+
AmplitudeManager.shared.track(eventType: eventType, eventProperties: eventProperties)
2222
}
2323
}

0 commit comments

Comments
 (0)