bizz84/SwiftyStoreKit

Documentation on how to handle deferred purchases correctly

Open

#358 opened on Mar 31, 2018

View on GitHub
 (0 comments) (7 reactions) (0 assignees)Swift (6,419 stars) (792 forks)batch import
area: purchase flowsdifficulty: advancedhelp wantedtype: enhancement

Description

Platform

  • iOS
  • macOS
  • tvOS

In app purchase type

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

Environment

  • Sandbox
  • Production

Version

0.13.1

Related issues

Report

Issue summary

It would be helpful to have guidelines on how to handle purchases that are returned in a deferred state. This can happen when parental permission is required to make an in-app purchase. From what I can tell from the code, the CompleteTransactionsController calls the callback on the completeTransactions which is only instantiated once on app launch (per the recommendations). Since that callback isn't made in the ViewController that makes the purchase, I don't know exactly when/how to update the UI to show that the purchase is waiting.

The reason this is so difficult is that there's no way to test this at all. So, having some sample code would be very helpful!

What did you expect to happen

The UI should be updated to show that the transaction is waiting for permission

What happened instead

The View Controller that is making the purchase never gets called back when the purchase is returned in a deferred state.

Contributor guide