Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isCancelled() is returning false for Android Subscription #328

Open
sabinayakc opened this issue Sep 19, 2020 · 1 comment
Open

isCancelled() is returning false for Android Subscription #328

sabinayakc opened this issue Sep 19, 2020 · 1 comment

Comments

@sabinayakc
Copy link

Cancellation Issue:

Platform: Android

Description:

When an android subscription is cancelled, iap.isCancelled() returns false. Looking at the PurchaseItem response, there is no field called cancellationDate for android. Shouldn't the code below be checking for userCancellationTimeMillis for Android instead of cancellationDate? Same goes for isExpired() function.

I haven't checked for IOS.

if (purchasedItem.cancellationDate) {

An example subscriptionResponse:

{

service: 'google',
status: 0,
packageName: 'XXX',
productId: 'XXX',
purchaseToken: 'XXX',
startTimeMillis: '1600461854942',
expiryTimeMillis: '1600462273216',
autoRenewing: false,
priceCurrencyCode: 'USD',
priceAmountMicros: '9990000',
countryCode: 'US',
developerPayload: '',
cancelReason: 0,
userCancellationTimeMillis: '1600461907018',
orderId: 'XXXXX,
purchaseType: 0,
acknowledgementState: 1,
kind: 'androidpublisher#subscriptionPurchase'
}

@KochMario
Copy link

You're absolutely right. I was wondering the same thing while validating my Android subscriptions.
Possibly the Google API changed and @voltrue2 hasn't noticed or hasn't had the time to update.

For the time being, I added an additional validator for android.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants