구매를 위한 Kotlin Multiplatform의 인앱 구매 구현하기
Adapty의 Kotlin Multiplatform (KMP) SDK를 사용해 iOS와 Android에서 인앱 결제를 통합하세요. 영수증 처리, 구독 상태 추적, 백엔드 구축 없이 모든 기능을 한 번에 제공합니다.
Adapty.activate(AdaptyConfig.Builder("YOUR_PUBLIC_SDK_KEY").build())
// Make a purchase, Adapty handles the rest
Adapty.makePurchase(product)
.onSuccess { purchaseResult ->
if (purchaseResult is AdaptyPurchaseResult.Success)
// successful purchase
}
.onError { error ->
// handle the error
}
Kotlin Multiplatform 인앱 결제를 위한 백엔드를 직접 구축할 필요가 없습니다
Adapty SDK는 서버에서 처리해야 할 모든 작업을 대신합니다: 영수증 검증, 구독 상태, 갱신, 체험, 환불까지 모두 처리합니다. 한 번 연결하면 Kotlin Multiplatform 인앱 결제 설정을 바로 사용할 수 있습니다.
데모 예약Adapty SDK를 선택해야 하는 이유
플랫폼 간 구독 상태 추적
iOS와 Android 전반에서 사용자의 구독 상태를 한눈에 확인할 수 있습니다.
백엔드에서 영수증 검증
Adapty가 자동으로 처리하므로 직접 검증 시스템을 구축할 필요가 없습니다.
모든 구독 상태 관리
무료 체험, 업그레이드, 프로모션, 가족 공유, 갱신 등 다양한 상태를 지원합니다.
엔터프라이즈급 코어로 확장
정기적인 업데이트, 안정적인 SDK, 99.99% 이상의 SLA로 운영됩니다.
플랫폼 구성
Adapty SDK 설치
await adapty.activate( 'PUBLIC_SDK_KEY', { customerUserId: 'YOUR_USER_ID', });
구매 이벤트 처리
Kotlin Multiplatform용 간편 통합
몇 시간 만에 Adapty SDK를 설정하고 iOS와 Android에서 인앱 결제를 바로 시작하세요. 도움이 필요하다면 전체 Kotlin Multiplatform IAP 튜토리얼을 참고하세요.
Kotlin Multiplatform IAP를 처리하는 5가지 SDK 메서드 사용
import com.adapty.kmp.Adapty
import com.adapty.kmp.models.AdaptyPurchaseResult
Adapty.makePurchase(product = product).onSuccess { purchaseResult ->
when (purchaseResult) {
is AdaptyPurchaseResult.Success -> {
val profile = purchaseResult.profile
if (profile.accessLevels["YOUR_ACCESS_LEVEL"]?.isActive == true) {
// Grant access to the paid features
}
}
is AdaptyPurchaseResult.UserCanceled -> {
// Handle the case where the user canceled the purchase
}
is AdaptyPurchaseResult.Pending -> {
// Handle deferred purchases (e.g., the user will pay offline with cash)
}
}
}.onError { error ->
// Handle the error
}import com.adapty.kmp.Adapty
Adapty.restorePurchases().onSuccess { profile ->
if (profile.accessLevels["YOUR_ACCESS_LEVEL"]?.isActive == true) {
// successful access restore
}
}.onError { error ->
// handle the error
}
import com.adapty.kmp.Adapty
Adapty.identify("YOUR_USER_ID") // Unique for each user
.onSuccess {
// successful identify
}
.onError { error ->
// handle the error
}
import com.adapty.kmp.Adapty
import com.adapty.kmp.models.AdaptyProfile
import com.adapty.kmp.models.AdaptyProfileParameters
val builder = AdaptyProfileParameters.Builder()
.withEmail("[email protected]")
.withPhoneNumber("+18888888888")
.withFirstName("John")
.withLastName("Appleseed")
.withGender(AdaptyProfile.Gender.FEMALE)
.withBirthday(AdaptyProfile.Date(1970, 1, 3))
Adapty.updateProfile(builder.build())
.onSuccess {
// profile updated successfully
}
.onError { error ->
// handle the error
}
import com.adapty.kmp.models.AdaptyProfileParameters
val builder = AdaptyProfileParameters.Builder()
// You can set your own custom attributes:
builder.withCustomAttribute("key1", "value1")
// To remove existing key, use .withRemovedCustomAttribute() method:
builder.withRemovedCustomAttribute("key2")
Adapty는 인디부터 대형 퍼블리셔까지 모든 규모의 앱을 지원합니다
앱 성장을 위한 모든 기능이 — 이미 Kotlin Multiplatform SDK에 포함되어 있습니다



노코드 페이월 빌더
개발팀 없이 iOS, Android, React Native, Flutter, FlutterFlow, KMP, Capacitor용 네이티브 페이월을 손쉽게 만드세요.
몇 분 만에 페이월 생성







