user2244871
user2244871

Reputation: 61

Android In-app Subscription expiry check and testing

I have an android app that have subscriptions. I want to do some ui change when subscription expires.

if( subscription expires )
   //do something

Q1) how do i handle the above in code? I'm using TrivialDrive Sample app classes for In-app. And where should i handle this check in code?

Q2) reserved key words are not working for subscription testing. Do I have to use actual credit card for testing subscriptions? My app is unpublished, product activated and apk signed.

Upvotes: 3

Views: 2890

Answers (2)

Daniel Smith
Daniel Smith

Reputation: 8579

If a user or your app has a subscription that ends, you will not get a notification. Rather, the subscription purchase will no longer be returned in the list of owned products from the getPurchases request to Google. As stated in the documentation under the "User Billing" section:

With In-app Billing Version 3, the failed or expired subscription is no longer returned when you call getPurchases.

If you are using the IabHelper from the TrivialDrive example, this means that the mPurchaseMap in the Inventory object returned in your IabHelper.QueryInventoryFinishedListener will not contain a product for the expired subscription.

Upvotes: 4

user2252750
user2252750

Reputation: 9

I've got the answer to my 1st question. I'm using Transaction.java of AndroidBillingLibrary to get expired state of product.

Upvotes: 0

Related Questions