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

Apple review rejected but I cannot replicate their results? #525

Open
3 of 9 tasks
Tracked by #550
ToddGeorgeKelly opened this issue Feb 20, 2020 · 9 comments
Open
3 of 9 tasks
Tracked by #550

Apple review rejected but I cannot replicate their results? #525

ToddGeorgeKelly opened this issue Feb 20, 2020 · 9 comments

Comments

@ToddGeorgeKelly
Copy link

ToddGeorgeKelly commented Feb 20, 2020

Platform

  • iOS
  • macOS
  • tvOS

In-app purchase type

  • Consumable
  • Non-consumable
  • Auto-Renewable Subscription
  • Non-Renewing Subscription

Environment

  • 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?

@Sam-Spencer
Copy link
Collaborator

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?

@manish-cs
Copy link

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

@janczakb
Copy link

@Sam-Spencer is there a solution already?

@Sam-Spencer Sam-Spencer mentioned this issue Jun 23, 2020
9 tasks
@Sam-Spencer
Copy link
Collaborator

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

@smohn
Copy link

smohn commented Aug 7, 2020

Same issue using last version 0.16.1

@Jarutais
Copy link

I'm having the same issue

@miwandn
Copy link

miwandn commented Aug 18, 2020

Having the same issue as well

@miwandn
Copy link

miwandn commented Aug 18, 2020

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

@yanghuittxs
Copy link

yanghuittxs commented Aug 20, 2020

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:

<style> body { font-family: "Helvetica Neue", "HelveticaNeue", Helvetica, Arial, sans-serif; font-size: 15px; font-weight: 200; line-height: 20px; color: #4c4c4c; text-align: center; } .section { margin-top: 50px; } </style>

Not Found

The requested page could not be found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants