I have both subscriptions and in-app purchases (lifetime unlock). All use the same entitlement (unlock).
I would like to differentiate between sandbox and non-sandbox purchases. Specifically, if someone buys in production, that should overrule anything bought in the sandbox, and Sandbox purchases should not be used in Production.
The entitlement info provides that information but because it’s a dictionary, it only stores one purchase for the unlock entitlement.
Problem 1: If someone buys something in production and later buys something in the sandbox, I believe the entitlement could be “inSandbox” because it’s the most recent transaction, even though there is also a production one (and I prioritize production purchases over sandbox)
Problem 2: Non-subscription purchases have a sandbox flag, but TransactionsFactory.nonSubscriptionTransactions() discards that information, so that it is not possible to determine if a non-subscription transaction was purchased in the sandbox (even though that data is present in the subscriber data via CustomerInfoResponse.Transaction).
Question 1: am I correct about the ordering problem with the entitlements dictionary?
Question 2: is there a way to get the inSandbox property for a non subscription transaction?