bizz84 / bizz84/SwiftyStoreKit
ℹCannot Get the success PurchaseResult from SwiftyStoreKit only after several times in production environment
- Dominant language
- Swift
- Stars
- 6.7k
- Forks
- 801
- PR merge metrics
- No merged PRs in 30d
Description
### Platform
- iOS
### In app purchase type
- Auto-Renewable Subscription
### Environment
- Production
### Version
ℹ 0.14.2
## Report
### Issue summary
ℹIn production environment, I don't get the success PurchaseResult from SwiftyStoreKit after subscribe success. (But Apple alert subscribe success). Only after I try for several times can I get success result from SwiftyStoreKit. This error only happens in production environment. When in sandbox environment, everything works fine.
### What did you expect to happen
ℹGet the success PurchaseResult from SwiftyStoreKit.
### What happened instead
ℹCannot Get the success PurchaseResult from SwiftyStoreKit.
```
func alertForPurchaseResult(_ result: PurchaseResult) {
switch result {
case .success(let purchase):
// NEED HELP !!! I can't go here in production environment unless I try for several times !!!
print("Purchase Success: \(purchase.productId)")
dismiss(animated: true, completion: nil)
UserPreferences.monthlyPro.value = true
SVProgressHUD.show(withStatus: NSLocalizedString("ProSuccess",comment:""))
case .error(let error):
var errorTitle = ""
var errorMessage = ""
```
Contributor guide
Research direction
Start with the reported alertForPurchaseResult callback and its PurchaseResult handling in the application code. Compare the production auto-renewable subscription flow with the sandbox flow, and verify that a successful Apple purchase reaches the .success case; the issue does not name framework files or tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios, swift
- Domain
- mobile, payments
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100