Closed mobile-appz closed 11 months ago
Hi @mobile-appz, thanks for bringing this up. Unfortunately, the library doesn't provide a single method for such a case. Nevertheless, you can still achieve this using this library. To determine whether a user has previously purchased an app or not, you simply need to read the local receipt and retrieve the original app version. If the version is lower than the latest one (with a subscription), then it means the user has purchased the app before:
do {
let receipt = try InAppReceipt.localReceipt()
let originalAppVersion = receipt.originalAppVersion
let currentVersion = ...
if originalAppVersion < currentVersion {
// User paid for the app
}
} catch {
print(error)
}
Thank you very much, that's good news and extremely helpful.
Hi I'm converting a paid app to a subscription app (which will be released as an update not as a new app) and need to verify which users have previously paid for the app. Can this library do this? There is nothing to say so in the documentation as far as I can see? Also, how can this be tested if so before release?