Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add is_trial_period, original_purchase_date to VerifySubscriptionResult and VerifyPurchaseResult #192

Closed
9 tasks done
bizz84 opened this issue Apr 24, 2017 · 1 comment
Closed
9 tasks done

Comments

@bizz84
Copy link
Owner

bizz84 commented Apr 24, 2017

Platform

  • iOS
  • macOS
  • tvOS

In app purchase type

  • Consumable
  • Non-consumable
  • Auto-Renewable Subscription
  • Non-Renewing Subscription

Environment

  • Sandbox
  • Production

Version

0.8.5

Report

The app receipt contains is_trial_period and original_purchase_date fields for each receipt field.

These should be made available by SwiftyStoreKit as follows:

// Result for Consumable and NonConsumable
public enum VerifyPurchaseResult {
    case purchased(originalPurchaseDate: Date)
    case notPurchased
}

// Verify subscription result
public enum VerifySubscriptionResult {
    case purchased(expiryDate: Date, originalPurchaseDate: Date, isTrialPeriod: Bool)
    case expired(expiryDate: Date, originalPurchaseDate: Date, isTrialPeriod: Bool)
    case notPurchased
}

In order to simplify parsing of the original_purchase_date and for consistency with the current implementation in InAppReceipt.swift, the original_purchase_date_ms field should be used and converted to Date in the same fashion of the InAppReceipt.getReceiptRequestDate(:) method.

This is a beginner task well suited for first time contributors. Pull requests are welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant