Swiftystorekit: Apple review rejected but I cannot replicate their results?

Created on 20 Feb 2020  Â·  9Comments  Â·  Source: bizz84/SwiftyStoreKit

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.15.0

Issue summary

TL;DR: IAPs work perfectly for me and my beta testers, the app got rejected because apple testers can't make a purchase.

I have made and tested my app with the in-app purchases, my beta testers have had no problems testing the app and also no problem with testing IAPs. However, my app is being rejected because they cannot make purchases while testing it. I cannot figure out why. I have searched a lot into this and found that some people had a similar issue and solved it by making sure the app doesn't try to validate or get a receipt on the first run of the app, but my app doesn't do that.

Can anyone help shed some light on this?

Using this to get the price value. For me, it returns the correct value, but for the review team, it is returning the "Invalid" result.

SwiftyStoreKit.retrieveProductsInfo(["com.tedia.removeAds"]) { result in
    self.removeAdsPrice = "..." // Variable ad price is to be stored in.
    if let product = result.retrievedProducts.first {
        self.removeAdsPrice = product.localizedPrice!
         print("Product: \(product.localizedDescription), price: \(self.removeAdsPrice)")
    } else if let invalidProductId = result.invalidProductIDs.first {
         self.removeAdsPrice = "Invalid"
         print("Invalid product identifier: \(invalidProductId)")
    } else {
         self.removeAdsPrice = "Error"
         print("Error: \(String(describing: result.error))")
    }
}

Using this to make a purchase, which works for me and all who are testing my app, but specifically when the App Store testers test it, apparently nothing happens when they hit a button.

SwiftyStoreKit.purchaseProduct(productID, quantity: 1, atomically: true) { result in
            switch result {
                case .success(let purchase):
                    flow.purchase_loading = false
                    flow.thankYou_show = true
                    switch purchase.productId {
                        case "com.tedia.removeAds":
                            settings.ads_Removed = true
                        case "com.tedia.tipLarge":
                            settings.tip_largePurchased = true
                        case "com.tedia.tipSmall":
                            settings.tip_smallPurchased = true
                        default:
                        print("This item doesn't have a place here")

                    }
                    print("Purchase Success: \(purchase.productId)")
                case .error(let error):
                    flow.purchase_loading = false
                    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")
                        default: print((error as NSError).localizedDescription)
                }
            }
        }

Apple just says:

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.

But from what I have read and understood of SwiftyStoreKit, this is already taken care of. Any Ideas?

help wanted question

All 9 comments

Would a PR like #518 solve this issue for you? I realize it may not be as straightforward as that, but would that be a step in the right direction?

@ToddGeorgeKelly is your issue resolved?. Got the same rejection message from Apple.

@Sam-Spencer is there a solution already?

Please take a look at issue #550. Your help with this project is dearly needed! @manish-cs @ToddGeorgeKelly

Same issue using last version 0.16.1

I'm having the same issue

Having the same issue as well

Digged into it a bit and seems to be happening on 13.6 simulator and not 13.3
fetchProducts() → Error Domain=SKErrorDomain Code=0 "(null)" UserInfo={NSUnderlyingError=0x60000288f9f0 {Error Domain=ASDErrorDomain Code=507 "Error decoding object" UserInfo={NSLocalizedDescription=Error decoding object, NSLocalizedFailureReason=Attempted to decode store response}}}

Happens on Apple's own example project on - (void)request:(SKRequest *)request didFailWithError:(NSError *)error

I have the same problem.
The in-app purchase receipt verification failed only during app review.
Failed to verify the receipt using the verifyReceipt method. The failure type is jsonDecodeError. Its associated value is printed out as the HTML code .
It was like this:

Not Found

The requested page could not be found.


>

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DClark5218 picture DClark5218  Â·  5Comments

designedbyadam picture designedbyadam  Â·  4Comments

anatoliykant picture anatoliykant  Â·  5Comments

X901 picture X901  Â·  5Comments

jlaws picture jlaws  Â·  6Comments