Solved

Better understanding for "unsubscribeDetectedAtMillis" and "isActive" values

  • 6 March 2024
  • 4 replies
  • 32 views

Badge

We have implemented the simple subscription process and as a part of that process. The following is the process:
User gets passed PayWall ==> receives the “premium” entitlement AND 10 points within the app.

But the issue is, that we would like to deduct those 10 points in cases where user has subscribed and then fully canceled the subscription i.e. requested a refund within the first week. As if we won’t implement that logic, you can imagine that this process can be abused.

So we are a bit baffled with the customerInfo data, specifically what field is responsible for cancelation/refund ? As we assume “unsubscribeDetectedAtMillis” filed is only linked to the renewals.

icon

Best answer by wes_clark 8 March 2024, 22:35

View original

This post has been closed for comments

4 replies

Userlevel 3
Badge +5

Hi! I apologize, but there is not currently a field that holds the data regarding a refund in the SDK, but I have raised it internally and we are looking into getting it added.

A few current options for ways you can access that data:

  1. you can use webhooks, which send an event when a refund is detected
  2. you can make a call to the Get Customer endpoint with a public API key (so you can use it in your app itself and not a backend) and check the field, refunded_at, for the subscription to see if it was refunded
  3. With StoreKit 1, add a listener to the SKPaymentQueue and watch for didRevoke
  4. With StoreKit 2, you could check the Transaction revocationDate
Badge

Thanks for you reply and stating the alternative options. Much appreciated!

Badge

@wes_clark - sorry for raising this again, but I am struggling to see where could i get access the “refunded_at” filed from in “Customer_Info”. It doesn’t seem to exist in “entitlement” object :( 

And is there a way to test the “refunding” in sandBox?

Userlevel 3
Badge +5

Sorry about that! I should have been more clear. The “refunded_at” field is under the “subscriptions” object for that call. In terms of testing refunds in sandbox, you can test refunding Google play purchases from the RevenueCat Dashboard. Unfortunately, Apple does not allow for the same functionality, but it appears that, based on this documentation, they allow you to test refunds from their end in sandbox.