Skip to content
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

Purchase not completing in app review. #361

Open
3 tasks
Tracked by #550
rahulvashisht42 opened this issue Apr 13, 2018 · 10 comments
Open
3 tasks
Tracked by #550

Purchase not completing in app review. #361

rahulvashisht42 opened this issue Apr 13, 2018 · 10 comments

Comments

@rahulvashisht42
Copy link

Platform

  • iOS

In app purchase type

  • Auto-Renewable Subscription
  • Non-Renewing Subscription

Environment

  • [*] Sandbox
  • [*] Production

Hello,

I am using this function to purchase product of in app purchase:

func purchase(_ purchase: RegisteredPurchase) {

    SwiftyStoreKit.purchaseProduct(bundleId + "." + purchase.rawValue, atomically: false) { result in
        
        
   if case .success(let product) = result {

            print(product.transaction.transactionIdentifier!)
        
            if product.needsFinishTransaction {
                SwiftyStoreKit.finishTransaction(product.transaction)
            }
           
        }else{
            if let alert = self.alertForPurchaseResult(result) {
            self.showAlert(alert)
            }
        }
    }
}

It's working fine when I was testing with test user. But in app review it got rejected with reason:

We found that your in-app purchase products exhibited one or more bugs when reviewed on iPad running iOS 11.3 on Wi-Fi connected to an IPv6 network.

Specifically, we are unable to complete the in app purchase due to an error.

Next Steps

When validating receipts on your server, your server needs to be able to handle a production-signed app getting its receipts from Apple’s test environment. The recommended approach is for your production server to always validate receipts against the production App Store first. If validation fails with the error code “Sandbox receipt used in production,” you should validate against the test environment instead.

Please help me how can i change the environment during purchase. Because I will validate the receipt with both the environment once purchase will be successfull but their purchase is failling then how i will validate it with both environment. It gives error of paymentinvalid
Please tell me the solution of it.

@pengxianhe
Copy link

The Same, App Store Refused

@botsbuzz
Copy link

botsbuzz commented Apr 16, 2018

App Store team review rejected my app for the same reason. Any idea to solve the issue?
I don't validate any receipt. My code is like this below:
SwiftyStoreKit.purchaseProduct("com.musevisions.SwiftyStoreKit.Purchase1", quantity: 1, atomically: true) { result in switch result { case .success(let purchase): print("Purchase Success: \(purchase.productId)") case .error(let error): switch error.code { case .unknown: print("Unknown error. Please contact support") case .clientInvalid: print("Not allowed to make the payment") case .paymentCancelled: break case .paymentInvalid: print("The purchase identifier was invalid") case .paymentNotAllowed: print("The device is not allowed to make the payment") case .storeProductNotAvailable: print("The product is not available in the current storefront") case .cloudServicePermissionDenied: print("Access to cloud service information is not allowed") case .cloudServiceNetworkConnectionFailed: print("Could not connect to the network") case .cloudServiceRevoked: print("User has revoked permission to use this cloud service") } } }

@rebeloper
Copy link

Most probably it is not a code issue. Make sure that everything else is set up properly in iTunes Connect. Check out my video on this: https://youtu.be/upTO0g_Qjhs

@eftalersoy
Copy link

Same problem here
It seems validation process throwing .unknown type of error.
This code was working fine 2 months ago
I am trying to purchase autorenew subscription in sandbox enviroment.

@svalagorn
Copy link

Same here. Looks like it's a sandbox server issue: https://forums.developer.apple.com/thread/96389

@snake302
Copy link

Same trouble, any news?

@vkill
Copy link

vkill commented May 9, 2018

+1

@rafaelapaula
Copy link

Someone find solution?

@bizz84
Copy link
Owner

bizz84 commented Jul 24, 2018

Apologies for the late reply everyone.

This is likely a duplicate of #81, and has been discussed to some length there.

@AdieOlami
Copy link

hi please I have been unable to get this project to work kind view my issue and contribute to it please thanks. #412

@Sam-Spencer Sam-Spencer mentioned this issue Jun 23, 2020
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests