When a product is pending and not completed, IAP will invoke “ProcessPurchase” when next initialize the store .
But if user enter a different account , it will add the product to this new account , that’s not what I want .
Is there some method to distinguish different game-account’s purchasing ?
Thanks:)
@youxue ,
Just for clarification, you mean a new account in your game or a new Google / Apple account? Purchases should be per store account, but that is determined by the platform.
If you are referring to in-game accounts, there isn’t anything built into Unity IAP to accomplish this.
You could track your purchases via a server and assign the products to the appropriate users that way.
Yes, the trouble is distinguish in-game accounts .
Sadly, maybe I can only solve this problem by my app server.
@youxue ,
For Google Play, there is a possible work around using Google’s developerPayload.
You can add a string payload parameter to the InitiatePurchase()method:
https://docs.unity3d.com/ScriptReference/Purchasing.IStoreController.InitiatePurchase.html
And that string is returned in the JSON receipt received after the purchase:
However, there is no equivalent for iOS or other app stores.