참고: 이제 Samsung Galaxy 스토어는 더 이상 사용되지 않고 Unity 인앱 구매 패키지 4.0.0 이상에서 지원되지 않습니다. Samsung Galaxy 스토어 설정에 대한 이 가이드는 IAP 패키지 3.1.0 이하 버전에만 적용됩니다. Unity IAP 패키지 4.0.0 이상을 사용 중이고 Samsung Galaxy 스토어를 구현하고 싶은 경우 대신에 Unity 배포 플랫폼을 사용하십시오.
개발자 모드를 사용하여 실제 제품 구매 비용을 발생시키지 않고도 IAP 테스트를 진행할 수 있습니다. 이 모드를 시작하려면 ISamsungAppsConfiguration
인스턴스를 사용하는 설정을 생성한 후, SamsungAppsMode.AlwaysSucceed
모드로 설정해야 합니다.
var builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance());
// Enable "developer mode" for purchases, not requiring real-world money
// SamsungAppsMode has: Production (developer mode "off"), AlwaysSucceed, AlwaysFail
builder.Configure<ISamsungAppsConfiguration>().SetMode(SamsungAppsMode.AlwaysSucceed);
사용자는 이미 구매한 콘텐츠에 대한 액세스를 유지하기 위해 거래를 복원합니다. 예를 들어, 기기 변경을 하더라도 사용하던 기기에서 구매한 아이템이 손실되지 않습니다. Samsung Galaxy 앱 스토어에서는 이전 거래를 복원할 필요가 없습니다. 하지만 구매를 복원할 수 있는 버튼을 제공하면 앱을 다른 장치에 설치하게 되는 경우, 다시 복원하면서 사용자에게 편리한 사용을 제공합니다.
이 동안 IStoreListener
의 ProcessPurchase
함수가 사용자가 이미 소유하고 있는 각 아이템에 대해 호출됩니다. 아래는 그러한 호출의 예시이며, Restore Purchases 버튼을 누르면 호출되는 방식입니다.
/// <summary>
/// Your IStoreListener implementation of OnInitialized.
/// </summary>
public void OnInitialized(IStoreController controller, IExtensionProvider extensions)
{
// The ProcessPurchase function is invoked for any items the user already owns
extensions.GetExtension<ISamsungAppsExtensions>().RestoreTransactions(result => {
if (result) {
// This does not mean anything has been restored,
// just that the restoration process succeeded.
} else {
// Restoration failed.
}
});
}
Samsung Galaxy 플랫폼에서는 이전 거래를 검색해서 가져오려면 사용자가 Samsung Galaxy 스토어 비밀번호를 입력해야 할 수도 있습니다.
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.