-
Notifications
You must be signed in to change notification settings - Fork 795
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
Critical issue when app have multi products. #22
Comments
BTW, at following patch could help me walk around this issue, even I'm not sure it's safe or correct to do it. // MARK: SKPaymentTransactionObserver
func paymentQueue(queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) {
var transactionResults: [TransactionResult] = []
for transaction in transactions {
// Patch start
if let productIdentifier = product?.productIdentifier {
if productIdentifier != transaction.payment.productIdentifier {
continue
}
}
// Patch end |
Thank you for reporting this and for the detail in the explanation. I'll try to look into it soon. |
Just send another email to b*[email protected] for test account and IAPs, please let me know if you didn't receive it. |
I opened a PR for this: #24 Would you be able to test on that branch and let me know if it fixes your problem? With this change I could start two concurrent purchases and only get one completion for each: |
Sure, I will test now and feedback later. |
I test again and it's fine. Thanks. To be honest, now I'm not familiar with git pull request, so I manually merge code and test. Here are the steps:
Another information is, I ever integrate SwiftStoreKit by framework, but now I directly copy folder of "SwiftyStoreKit" with swift files into my project to integrate it. The key reason is it's easily to debug. BTW, another issue I also walk around is, if I already purchase a product, remove the local information and try to purchase again, it will return func purchaseProductHandler(result: SwiftyStoreKit.PurchaseResult) {
// some code
switch result {
case .Error(let purchaseError):
switch purchaseError {
case .Failed(let errorType):
let error = errorType as NSError
if error.domain == SwiftyStoreKitErrorDomain {
if error.code == SwiftyStoreKit.InternalErrorCode.RestoredPurchaseWhenPurchasing.rawValue {
verify()
}
// some code |
I'll look into this today or tomorrow. |
I made some progress and figured out that since each purchase or restore purchase request registers to the same SKPaymentQueue, it's possible that the callbacks get mixed up when multiple requests are running concurrently. This pull request should address the problem: Would you be able to test this in your configuration?
|
Great! Will test and update you. |
This issue should be fixed with the patched. Thanks. My code didn't change, just replace the SwiftyStoreKit by |
First, thanks for your framework.
But, after spend days to finish the IAP with your framework, I find a critical issue which prevent me to release this product. This really make me feel upset, change another framework (or implement using Apple's api), or provide help and wait you until this critical issue is fixed?
Steps to reproduce this issue:
func paymentQueue(queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction])
SwiftyStoreKit.InternalErrorCode.RestoredPurchaseWhenPurchasing
.This issue doesn't happen every time, but happen 4 times for the 5 test. I guess it's related with the multi-threads/queue. Similar with issue #3 . As AlexCatch said,
I would like to provide test account if you need. You can also directly contact me beside Github. Thanks.
Jason
The text was updated successfully, but these errors were encountered: