Skip to content


커스텀 App Store 리뷰 프롬프트

사용자에게 App Store 리뷰를 요청하는 Campaign을 생성하는 것은 인앱 메시지의 인기 있는 활용 방법입니다.

먼저 앱에서 인앱 메시지 델리게이트를 설정합니다. 그런 다음, 기본 App Store 리뷰 메시지를 비활성화하기 위해 다음 델리게이트 메서드를 구현합니다.

1
2
3
4
5
6
7
8
- (ABKInAppMessageDisplayChoice)beforeInAppMessageDisplayed:(ABKInAppMessage *)inAppMessage {
  if (inAppMessage.extras != nil && inAppMessage.extras[@"Appstore Review"] != nil) {
    [[UIApplication sharedApplication] openURL:inAppMessage.uri options:@{} completionHandler:nil];
    return ABKDiscardInAppMessage;
  } else {
    return ABKDisplayInAppMessageNow;
  }
}
1
2
3
4
5
6
7
8
func before(inAppMessageDisplayed inAppMessage: ABKInAppMessage) -> ABKInAppMessageDisplayChoice {
  if inAppMessage.extras?["Appstore Review"] != nil && inAppMessage.uri != nil {
    UIApplication.shared.open(inAppMessage.uri!, options: [:], completionHandler: nil)
    return ABKInAppMessageDisplayChoice.discardInAppMessage
  } else {
    return ABKInAppMessageDisplayChoice.displayInAppMessageNow
  }
}

딥링크 처리 코드에서 {YOUR-APP-SCHEME}:appstore-review 딥링크를 처리하기 위해 다음 코드를 추가합니다. SKStoreReviewController를 사용하려면 StoreKit를 가져와야 합니다.

1
2
3
4
5
6
7
8
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey, id> *)options {
  NSString *urlString = url.absoluteString.stringByRemovingPercentEncoding;
  if ([urlString isEqualToString:@"{YOUR-APP-SCHEME}:appstore-review"]) {
    [SKStoreReviewController requestReview];
    return YES;
  }
  // Other deep link handling code…
}
1
2
3
4
5
6
7
8
func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
  let urlString = url.absoluteString.removingPercentEncoding
  if (urlString == "{YOUR-APP-SCHEME}:appstore-review") {
    SKStoreReviewController.requestReview()
    return true;
  }
  // Other deep link handling code…
}

다음으로 아래 내용을 포함하여 인앱 메시징 Campaign을 생성합니다.

  • 키-값 페어 "Appstore Review" : "true"
  • 클릭 시 동작을 “앱으로 딥링크”로 설정하고, 딥링크 {YOUR-APP-SCHEME}:appstore-review를 사용합니다.
New Stuff!