j3k0 / cordova-plugin-purchase

In-App Purchase for Cordova on iOS, Android and Windows
https://purchase.cordova.fovea.cc
1.29k stars 529 forks source link

Upgrading/downgrading a subscription is showing owned for old subscription #1533

Open vanessag opened 2 months ago

vanessag commented 2 months ago

Observed behavior

I am using the group feature to group android subscriptions similar to this:

// For those 2 subscription products, the plugin will automatically replace
// the currently owned one (if any) when placing a new order.
store.register([{
  id: 'no_ads_yearly',
  type: ProductType.PAID_SUBSCRIPTION,
  platform: Platform.GOOGLE_PLAY,
  group: 'noAds'
}, {
  id: 'no_ads_monthly',
  type: ProductType.PAID_SUBSCRIPTION,
  platform: Platform.GOOGLE_PLAY,
  group: 'noAds'
}]);

The problem is that when I upgrade or downgrade the subscription in the app the old one is still marked as "owned" in addition to the new subscription. The owned status of the old subscription is not correctly updated until I re-open the application.

On iOS if I downgrade the subscription the new subscription is not marked as owned but the old one is. Re-opening the app doesn't seem to change this either. If I look at the subscriptions in the App Store settings I see that the new subscription is checked. Upgrading a subscription on iOS works as expected.

Also the canPurchase flag always seems to stay as true even if the product is owned (both iOS and Android).

Note: I am using the iaptic receipt validation service.