My app is a paid app, and I’m transitioning the pricing model to the same model as Due app (https://dueapp.zendesk.com/hc/en-us/articles/360053244591-What-is-the-Upgrade-Pass). The difference is instead of using a subscription, I use a consumable in-app purchase.
Each feature in the app has its own release date. To determine if a feature is unlocked, I compare its release date with the upgrade end date. If the release date is the same as or earlier than the upgrade end date, the feature is unlocked. I calculate the upgrade end date from the CustomerInfo
object returned from Purchases.shared.getCustomerInfo
:
Purchases.shared.getCustomerInfo(fetchPolicy: .notStaleCachedOrFetched) { customerInfo, error in
if let customerInfo {
let purchaseDate = customerInfo.purchaseDate(forProductIdentifier: productIdentifier) ?? customerInfo.originalPurchaseDate
let endDate = Calendar.current.date(byAdding: .month, value: 12, to: purchaseDate)
// Further logic here
} else if let error {
// Handle error
}
}
Is it the correct way to check the feature unlock status?
Regarding refunds, I haven't been able to test them yet. According to the article at https://www.revenuecat.com/docs/subscription-guidance/refunds, if an in-app purchase key is configured for the app in RevenueCat, consumable in-app purchase refunds will be detected. Does this mean I do not need to implement any additional handling for refunds? Will Purchases.shared.getCustomerInfo
automatically return an updated CustomerInfo
object when a refund is detected?
Thank you!