bizz84 / bizz84/SwiftyStoreKit

Test implementation of simulatesAskToBuyInSandbox

Open
#453 5 comments 0 reactions 0 assignees View on GitHub
help wanted type: question
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

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

### Environment

- [x] Sandbox
- [ ] Production

### Version
ℹ 0.14.2

### Related issues
ℹ I didn't find any

## Report

### Issue summary

I don't know how to test the simulatesAskToBuyInSandbox feature.
I'm initiating a purchase with this code:

```
SwiftyStoreKit.purchaseProduct(self.product!, atomically: true, simulatesAskToBuyInSandbox: true) { result in
.. code here ..
}
```

And I'm handling the .deferred status on AppDelegate with the suggested function `SwiftyStoreKit.completeTransactions(atomically: false)`

So, the purchase is initiated correctly, the ask to buy is simulated correctly and the purchase is reported as .deferred.
However I don't know how to test the flow when a "parent" approve or deny the purchase because, as expected, I didn't receive any ask to buy notification as there is not a family group defined anywhere.

Is there a way to test this case? How can I test it?

### What did you expect to happen
Some way to simulate the ask to buy approval/denial.

### What happened instead
Nothing.

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.