iOS Uninstall Tracking Setting
앱 삭제 추적은 Airbridge iOS SDK
v1.13.0
이후 버전 부터 사용 가능합니다.
설정
에어브릿지 SDK 의 Uninstall tracking 기능은 Silent push notification 을 활용하여 구현됩니다. 그래서 이 기능을 사용하기 위해 앱에서 Silent push notification 이 동작되도록 App Identifier 설정 및 Capabilities 추가, 그리고 Silent push notification 이 앱에 전달되었을 때 Uninstall tracking 을 위한 것이라면 무시하는 코드 추가가 필요합니다.
프로젝트 설정
App Identifier 에서 Push Notification 켜기
- https://developer.apple.com/account/resources 의 Identifiers 로 이동해 주세요.
- Uninstall Tracking 하고자하는 앱의 Identifier 를 클릭하여 Push Notifications 를 체크해 주세요.

Key 에서 Push Notification 켜기
- https://developer.apple.com/account/resources 의 Keys 로 이동해 주세요.
- 사용하는 Key 를 edit 하여 Apple Push Notification service 를 체크해 주세요.

사용하는 Key 가 없는 경우 + 버튼을 눌러 새로 생성하고 p8 을 다운로드 해주세요.
App 정보 등록
App ID Prefix 및 Bundle ID 등록

- https://developer.apple.com/account/resources 의 Identifiers 로 이동해 주세요.
- Uninstall Tracking 하고자하는 App 의 Identifier 를 클릭해 주세요.
- 해당 App 의 App ID Prefix 와 Bundle ID 를 확인할 수 있습니다.
Key 의 p8 업로드

- https://developer.apple.com/account/resources 의 Keys 로 이동해 주세요.
- 사용하는 Key 를 클릭해 주세요.
- 해당 Key 의 Key ID 와 p8 을 확인할 수 있습니다.
p8 은 해당 Key 최초 생성시에만 다운로드 가능합니다.
App 설정
Capabilities 추가
- Xcode > Project 파일 > Signing & Capabilities 로 이동해주세요.
+ Capability
버튼을 클릭해주세요.Background Modes
와Push Notifications
를 추가해주세요.Background Modes
의Remote notifications
를 체크해주세요.
Slient Push Notification 설정
앱이 실행될 때, 기존에 Push Notification 을 사용하고 있지 않았다면 registerForRemoteNotifications
함수를 호출해 주세요.
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool
{
...
UIApplication.shared.registerForRemoteNotifications()
...
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[UIApplication.sharedApplication registerForRemoteNotifications];
return YES;
}
APNS Push Token 전송
APNS Push Token 이 생성되었을 때, 해당 토큰을 registerPushToken
함수를 호출하여 SDK 에 전달해주세요.
func application(_ application: UIApplication,
didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data)
{
AirBridge.registerPushToken(deviceToken)
}
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
[AirBridge registerPushToken:deviceToken];
}
삭제 추적 용 Silent push notification 무시
삭제 추적 용 Silent push notification 이 전달되었을 때, 아래 코드와 같이 무시해주세요.
func application(_ application: UIApplication,
didReceiveRemoteNotification userInfo: [AnyHashable : Any],
fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void)
{
if userInfo["airbridge-uninstall-tracking"] as? Bool == true {
return;
}
...
}
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {
if ([userInfo[@"airbridge-uninstall-tracking"] boolValue] == YES) {
return;
}
...
}
Updated 6 months ago