lib_unity_purchase/Samples~/Apple App Store - 09 Presen...
刘涛 3b87d20391 全部提交 2024-01-29 18:49:33 +08:00
..
.sample.json 全部提交 2024-01-29 18:49:33 +08:00
PresentCodeRedemptionSheet.cs 全部提交 2024-01-29 18:49:33 +08:00
PresentCodeRedemptionSheet.cs.meta 全部提交 2024-01-29 18:49:33 +08:00
PresentCodeRedemptionSheet.unity 全部提交 2024-01-29 18:49:33 +08:00
PresentCodeRedemptionSheet.unity.meta 全部提交 2024-01-29 18:49:33 +08:00
README.md 全部提交 2024-01-29 18:49:33 +08:00
README.md.meta 全部提交 2024-01-29 18:49:33 +08:00
UserWarningAppleAppStore.cs 全部提交 2024-01-29 18:49:33 +08:00
UserWarningAppleAppStore.cs.meta 全部提交 2024-01-29 18:49:33 +08:00

README.md

README - In-App Purchasing Sample Scenes - App Store - Present Code Redemption Sheet

This sample showcases how to use the Apple App Store extensions for users to redeem subscription offer codes. This allows developers to re-engage with their users by the distribution of out-of-app subscription offers.

Instructions to test this sample:

  1. Have in-app purchasing correctly configured with the Apple App Store.
  2. Configure a subscription product.
    1. Configure an Offer Code on Apple App Store for this subscription.
  3. Set your own product's id in the InAppPurchasing game object > Refreshing App Receipt script > Normal Subscription Id field or change the normalSubscriptionId field in the PresentCodeRedemptionSheet.cs script.
  4. Build your project for iOS.
    1. Testing on the Unity Editor will not display the offer code sheet.
    2. Testing on the Apple simulator will not display the offer code sheet, by Apple's StoreKit v1 design.
    3. Testing on the Apple SANDBOX can display the offer code sheet UI. The SANDBOX Apple App Store server does not support end-to-end fulfillment of the code, however.
    4. Testing on the PRODUCTION Apple App Store server allows end-to-end testing. See below for more information.

Present Code Redemption Sheet

Using PresentRedemptionSheet on a device, including on the Sandbox, will prompt the user to enter an offer code.

See the documentation for the Unity IAP extension to present the code redemption sheet. Also see the relevant Apple API documentation for more context on this feature. And see the iOS & Mac App Stores document for setting up an Apple project with Unity IAP.

See this tip for testing offer codes end-to-end, using the PRODUCTION Apple App Store server.