bizz84 / bizz84/SwiftyStoreKit

Documentation on how to handle deferred purchases correctly

Open
#358 0 comments 7 reactions 0 assignees View on GitHub
area: purchase flows difficulty: advanced help wanted type: enhancement
Dominant language
Swift
Stars
6.7k
Forks
801
PR merge metrics
No merged PRs in 30d

Description

### Platform

- [x] iOS
- [ ] macOS
- [ ] tvOS

### In app purchase type

- [ ] Consumable
- [x] Non-consumable
- [ ] Auto-Renewable Subscription
- [ ] Non-Renewing Subscription

### Environment

- [x] 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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.