Hello,
We’ve got a Flutter app that requires user register / login and we’re providing the SDK with an App User ID tied to those credentials to allow our users to share the same subscription among multiple devices.
This is working fine and we recover the same Entitlements no mater the device the user Logs In.
What we’re having problems is with subscription management since many actions (Upgrade, Downgrade, etc...) will only work from the device that did the original purchase as stated in the docs:
Managing Subscriptions
A user can only manage their subscription on the platform it was purchased from.
Having the same App Account logged in in two devices with different Google Play accounts and calling Purchases.purchasePackage() generates the following error:
PlatformException(4, One or more of the arguments provided are invalid., {code: 4, message: One or more of the arguments provided are invalid., readableErrorCode: PurchaseInvalidError, readable_error_code: PurchaseInvalidError, underlyingErrorMessage: Couldn't find existing purchase for SKU: <sku>, userCancelled: false}, null)
And on a second try:
PlatformException(15, The operation is already in progress., {code: 15, message: The operation is already in progress., readableErrorCode: OperationAlreadyInProgressError, readable_error_code: OperationAlreadyInProgressError, underlyingErrorMessage: , userCancelled: false}, null)
After enough time has passed we’ll get a PlatformException 4 once again.
This is indeed the expected behaviour but we need a way to tell which devices are using the same Store Account that did the original purchase from those that don’t so we can disable unavailable options there.
We’ve checked the PurchaserInfo and EntilementInfo objects but found no way to tell.
We were actually expecting this to be available under ownerShipType but it shows as OwnershipType.unknown for everyone.
Is there any way from within the SDK to handle this?
Thanks in advance,
Roger