iPhone In App Purchase – response.products are still empty?

Another important step that is often overlooked is you need to make sure you have an iOS Paid Applications Contract setup which is located under the “Contracts, Tax, and Banking” section of iTunes connect. First you have to click on the request button, then you have to click on the 3 Set Up buttons (Contact … Read more

iPhone In-App Purchase Store Kit error -1003 “Cannot connect to iTunes Store”

I had a similar situation and dumped the iPhone’s network traffic to see what’s going on. I found that the normal store was contacted instead of the sandbox. It helped to delete the app from the device, make clean and build/install it again. Apparently something with the development profile had gone wrong. Update: To dump … Read more

When to use restoreCompletedTransactions for in-app purchases?

Update (June 2022) Apple has given a name to this subject and devoted an entire WWDC session to it. WWDC 2022: Implement proactive in-app purchase restore (If the link eventually goes stale, it was referring to session 110404 from WWDC 2022.) The session is 20 minutes, covers a considerable amount content, and is highly recommended. … Read more

iPhone Store Kit “Cannot connect to iTunes Store”

I was getting SKPaymentTransactionStateFailed error code 0 “Cannot connect to iTunes Store” and thanks to thomax for this answer my problem is solved. Turns out you MUST enter a build number under Targets->Summary. I spent the last 24 hours resetting my phone, screwing with iTunes connect, and doing just about everything i could think of … Read more

‘requestReview()’ was deprecated in iOS 14.0

iOS 16+ There is now a new RequestReviewAction that is available as an environment value: private struct ContentView: View { @Environment(\.requestReview) private var requestReview var body: some View { Button(“Review”) { DispatchQueue.main.async { requestReview() } } } } iOS 14+ Quick solution if let scene = UIApplication.shared.connectedScenes.first(where: { $0.activationState == .foregroundActive }) as? UIWindowScene { … Read more

Undocumented NSURLErrorDomain error codes (-1001, -1003 and -1004) using StoreKit

All error codes are on “CFNetwork Errors Codes References” on the documentation (link) A small extraction for CFURL and CFURLConnection Errors: kCFURLErrorUnknown = -998, kCFURLErrorCancelled = -999, kCFURLErrorBadURL = -1000, kCFURLErrorTimedOut = -1001, kCFURLErrorUnsupportedURL = -1002, kCFURLErrorCannotFindHost = -1003, kCFURLErrorCannotConnectToHost = -1004, kCFURLErrorNetworkConnectionLost = -1005, kCFURLErrorDNSLookupFailed = -1006, kCFURLErrorHTTPTooManyRedirects = -1007, kCFURLErrorResourceUnavailable = -1008, kCFURLErrorNotConnectedToInternet … Read more

A complete solution to LOCALLY validate an in-app receipts and bundle receipts on iOS 7

Here’s a walkthrough of how I solved this in my in-app purchase library RMStore. I will explain how to verify a transaction, which includes verifying the whole receipt. At a glance Get the receipt and verify the transaction. If it fails, refresh the receipt and try again. This makes the verification process asynchronous as refreshing … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)