Skip to content

Add SubscriptionType to differentiate between auto-renewable and non-renewing subscriptions

Compare
Choose a tag to compare
@bizz84 bizz84 released this 09 Mar 16:40
· 503 commits to master since this release

This is a bug-fix release to address #161.

API Changes

Auto-Renewable

The verifySubscription() method API has changed:

let purchaseResult = SwiftyStoreKit.verifySubscription(
            type: .autoRenewable,
            productId: "com.musevisions.SwiftyStoreKit.Subscription",
            inReceipt: receipt)

Non-Renewing

let purchaseResult = SwiftyStoreKit.verifySubscription(
            type: .nonRenewing(validDuration: 3600 * 24 * 30),
            productId: "com.musevisions.SwiftyStoreKit.Subscription",
            inReceipt: receipt)

See the README file for more details.

Changes

For auto-renewable, receipt["latest_receipt_info"] is used.
For non-renewing, receipt["receipt"]?["in_app"] is used.

This fixes a bug where receipt verification fails for non-renewing subscriptions (which were previously using "latest_receipt_info".