ios – Implementing Subscription in Unity App: Issues with Test Card in Apple’s Sandbox Environment


I’m integrating a subscription model into my Unity application and want to test its functionality using a test card in Apple’s sandbox environment.

I’m using the UnityPurchasing plugin. On startup, the following code is executed:

var builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance());
builder.AddProduct("vip", ProductType.Subscription);
UnityPurchasing.Initialize(this, builder);

However, I’m encountering an issue, indicated by this log:

Unavailable product vip-vip
UnityEngine.Purchasing.PurchasingManager:HasAvailableProductsToPurchase(Boolean)
UnityEngine.Purchasing.PurchasingManager:CheckForInitialization()
UnityEngine.Purchasing.PurchasingManager:OnProductsRetrieved(List`1)
UnityEngine.Purchasing.AppleStoreImpl:OnProductsRetrieved(String)
UnityEngine.Purchasing.Extension.UnityUtil:Update()

Purchasing failed to initialize. Reason: NoProductsAvailable.
Samples.Purchasing.Core.BuyingSubscription.BuyingSubscription:OnInitializeFailed(InitializationFailureReason, String)

My main concern is why the product ‘vip’ is being interpreted as ‘vip-vip’, and is this the root of the problem?

Here’s what I’ve done so far:

Created an Apple account with the email ‘admin’.
Note: I’m using two emails – ‘admin’ for the account with administrator rights and ‘inapptester’ for sandbox testing in App Store Connect. ‘admin’ cannot be added to the sandbox testers.

Set up an application and an in-app purchase (IAP) named ‘vip’, providing only basic information like price and regions at this stage. I didn’t add screenshots or other details yet.

Added the ‘inapptester’ email to sandbox users in App Store Connect.

Added the ‘admin’ email as an internal tester, sent an invitation to TestFlight, and accepted it.

Downloaded the build from TestFlight on the ‘admin’ device, launched it, and tried the IAPs, but they didn’t work.

Went to Settings -> App Store on the device, where I found a ‘Sandbox’ field with the ‘admin’ email.

Changed the Sandbox email to ‘inappTester’.

Entered the app again with this change. The IAPs not working.

Deleted the app and directly uploaded a new build via Xcode – The IAPs not working.

I haven’t registered anything additionally and haven’t sent it for approval (could this be the issue?). My goal is purely for internal testing. What am I doing wrong?

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img