SKErrorDomain Code=0 “Cannot connect to iTunes Store” - iphone

My application has just gone live on the iTunes Store, and after that, I am unable to start any purchase. I have tested the application and its working fine in Sandbox envoirnemnt. But Live application gives the error
Error Domain=SKErrorDomain Code=0 “Cannot connect to iTunes Store
enum value = SKErrorUnknown
I have tried signing out any test accounts from Store login, but it just doesn't ask for any account login and error keeps on coming. Any clue!

This can happen because of the two problems i guess.
Make sure you have placed the correct "Product Identifier".If that's the case, then you'll get error 0 shortly after calling -[SKPaymentQueue addPayment:], before you get the popup asking you to confirm payment.
Your test user has become invalidated. This can happen if you accidentally log into the App Store with your test user. When this happens, you'll get error 0 after entering your password to confirm your payment.
To fix problem #1, pass in the correct product ID. To fix problem #2, create a new test user on iTunes Connect, and optionally delete the old test user.
Hope this helps you.

I was getting the same error while testing subscriptions, was able to get it to work by adding a Localization (Subscription Display Name
and Description) to the product from iTunes connect.

Check if you sign out of the iTunes Store.
To sign out, follow these steps:
Open the Settings App
Tap the “Store” row
Tap “Sign Out”

you can check few things and verify it.
Verify following things :
(1) your App's Bundle ID. it should be same as you created in iTunes store in which you have added In App Purchases.
(2) Check Your In App Identifier Name, which you use in Application.
If any of these is not matching it would throw Error Domain=SKErrorDomain Code=0 “Cannot connect to iTunes Store exception.

This scenario was exactly mine. After addPayment was called, a dialog box popped up saying "Log in to the iTunes store with an existing or new account". As soon as I selected Login, I got the error above.
I had reinitialised my iPad and signed out of iCloud. No luck. Then, showing a friend, found that there is also an iTunes a& AppStore sign out option which is distinct from this. Clicked on the Touch Id line and it offered me a sign out option. Then, I was prompted to login with a test account on making a purchase. It worked!

in your Xcode:
Click on your active scheme name right next to the Stop button
Click on Edit Scheme....
in Run (Debug) select the Arguments tab
in Environment Variables click +
add variable: OS_ACTIVITY_MODE = disable

Related

Can't Submit apps to App Store, can't select any app

I am trying to submit my app to the app store and when I archive it and enter my iTunesConnect email and password it says in application "Not Value". My app is currently "Waiting For Upload".
The weird part is that if I give a bad password it saysthe same thing. App: "Not Value", and I've checked the email and password and they are correct.
What can I do? I need to submit today :S
Thanks
I solved it.
Just download and reinstall the Xcode and you will get all the certified right.
Just archive it and you will submit. This is because Application Loader was corrupted [I don't know why].
Thanks
Here is how I submit an app to the App Store:
Open the app in Xcode.
Go to the Product menu item and select Archive.
Open the Xcode Organizer.
Select Archives.
Select the App and version number you want to submit.
Press submit.
Fill in your iTunes Connect username and password.
Select the correct provisioning profile.
Fix any errors or warnings and repeat the process.
Once this is completed, you should see a message telling you that your app has been received and is now waiting to be reviewed.

invalid binary error in iTunes connect

I am trying to upload my app on appstore. Whenever I submit the app successfully,it shows Invalid binary in iTunes connect.
I tried various ways suggested to avoid this error in the other posts.
like I checked all icon images.
I created entire app again.
Revoked and recreated certificates and provisioning profiles.
Still its giving me same error. it does not give any error while building app or while submitting app. only after submitting it shows invalid binary. can any one help me in this?
does creating new id at iTunes connect will work? but i do not want to change the name of the app. whenever i try to delete app from iTunes connect it gives me warning that this app name can not be used in future for any application.
Finally it worked!
I revoked all certificates, and created new. then Recreated new app id and provisioning. created new app id in iTunes store and uploaded application. and now it is showing me Waiting for Review status.
If you have several distribution certificates, check whether you are selecting the same distribution certificate when submitting the app and the certification which you have used to build the application. This might cause to your problem.
The same happened to me, no errors in the validation nor submission and no resolution center.
But later i have found that they have sent an email to the account owner's email, and registered developer
The email I received from Apple had clear language in it corresponding to the change I needed to make. I was submitting a build with an Apple Watch app written in Swift. I had to target 7.0 because I was using Swift. I made this change and the binary was accepted and approved within hours.

StoreKit Sandbox Testing Doesn't Prompt to Log in

I'm testing an in-app purchase which did work fine a week ago, but now seems to be playing up.
I can load the product from the store without any problems (using NSLog to confirm the product id, price etc...), but when I send the actual request to purchase the product - I don't get challenged to log in to my (test) user account, it just returns an error code -1003 "Cannot connect to iTunes store".
This is strange because it did work a week ago, and now it doesn't. What's weirder is that it does prompt me for my password (to purchase the product) if I am currently logged into my live iTunes account.
It's almost as if the app is checking to see if there is an iTunes account logged in, and if not it will just fail... which is rather annoying as you're not supposed to log into the test accounts via your settings as it will invalidate it.
Can anyone shed some light on this for me? I'd be well chuffed if you could :)
Thanks!
I have had this issue as well. You may want to try one or all of these steps.
Delete the app from your device and rebuild it.
Log out from any iTunes account on the device.
Delete the app. Reboot your device and build and run again.
Log into the iTunesConnect portal and view your test user page.
I have been able to reconnect by doing one or all of these things.
Hope this helps.
I've fixed this by creating a new test user. My guess is the test account accidentally saw the live store - which tends to kill them. Might be your problem as well?

Expected sequence when using iTunes test user

I'm trying to test in app purchases in our app but I'm not having any luck. Part of the problem may be due to the expected sequence not being documented anywhere. Here are the steps I followed to support in-app purchases:
Create test user in iTunes Connect.
Log out of the Store on the device.
Build and run the app in Xcode using a non-wildcard App ID and provisioning profile targeting the device (an iPhone 4 running iOS 4.2.1). I've run through this building for both debug and ad-hoc release.
Make an in-app purchase.
Alert is displayed: "Confirm Your In AppPurchase" with two buttons - Cancel and Buy. Tap the Buy button.
Alert is displayed: "Sign In" with three buttons - Use Existing Apple ID, Create New Apple ID, and Cancel. Tap the Use Existing Apple ID button.
Alert is displayed: "Apple ID Password" with two text fields and two buttons - Cancel and OK. Enter the email address and password for the test user and tap the OK button.
Here is where my understanding of what is the expected behavior is deficient. Here is what I see at this point:
Alert is displayed: "This Apple ID has not yet been used in the iTunes Store. Tap Review to sign in" with two buttons - Cancel and Review. In all the documentation, blog posts, and forums, no one has mentioned this alert. Is this supposed to be displayed? I tapped the Review button.
I am now taken to the App Store app and taken through a series of steps to confirm the account.
The first page is titled "Confirm Your Country or Region" with a single value titled Store set to United States. I tapped the Next button on the toolbar at the bottom.
The second page is to agree to the terms and conditions and the Apple privacy policy. I tapped the Agree button on the toolbar at the bottom.
Alert is displayed: "I have read and agree to the iTunes Store Terms & Conditions." with two buttons - Cancel and Agree. I tapped Agree.
The third page is to confirm information for the account (email, password, security question, birth date) and enable/disable iTunes store subscription information. It requires me to enter the year (why didn't iTunes Connect just ask me for it!). I entered the birth year and then tapped the Next button on the toolbar at the bottom.
he fourth page asks is titled "Billing Information." This is when I realized something was wrong. All the documentation, blogs, and forums say I shouldn't be asked for a credit card.
Q1: What exactly should I expect once I enter the test user email address and password (the first set of steps)?
Q2: Why am I being asked for all this extra information for a test user? What should I be looking at to troubleshoot this?
Thanks for your help.
It happens when you install your development application over downloaded from App Store.
To fix this issue, you need to remove application from the device and install fresh copy using XCode.
iOS caches distribution profile somehow and requires production user if the first installation was done through App Store. With no regard what installation method was used recently.
Here is the trick (at least if worked for me..).
First log out of your real iTunes account in Settings > Store > Apple ID. You must be logged out of an account to be able to use your test account.
However, don't log in to your test account on that screen.
Go to the app, initiate your in-app purchase, and enter the test account email and password there. Assuming the test account is set up correctly (!), that should work.
Then, when finished testing, go back to Settings > Store > Apple ID and log out of the test account.
This sequence worked for me. I tried all of the above sequences and they failed for me.
Sign out of your account on the iPhone in Settings -> Store
Delete your test app
Power the iPhone off and on again
Close iTunes on your computer
Run the app again from XCode
Thanks to OmegaDelta's blog for this one:
http://omegadelta.net/2011/05/11/testing-in-app-purchases-in-ios-4-3-sandbox/
I found some answers to my questions above after I completely deleted the app off my device and tried again. I have no idea why that was required.
Q1: What exactly should I expect once I enter the test user email address and password( the first set of steps)?
No addition questions are asked once entering user credentials if it works, so if the first alert in the second list is displayed then you know it didn't work.
Q2: Why am I being asked for all this extra information for a test user? What should I be looking at to troubleshoot this?
The only thing I can think of is that there was something cached in my app from previous requests. This makes me nervous as I have no idea whether customers will have to delete the app or not like I did.
I've experienced the same problems until I quit iTunes and installed the right provisioning profile to my device. Running iTunes with Xcode restored my account from time to time so even when I log out on the device I was suggested to use my (not test) account in the app. Installing the correct profile fixed the second problem.
Hope it can help somebody too.
None of these answers is very specific or wholly correct, and the in-app behavior has changed slightly over the past year wrt test accounts. The true/current solution to this if you hit it: go through the review/sign-in pages in iTunes for the test account and just "cancel" from the "enter billing information" screen with no harm, no foul. If for whatever reason you never get prompted to review/sign-in, then don't bother to do so.
I was able to get around this issue by signing my test user into a different app that I was developing, then going back to the app where I was having problems (no amount of deleting or restarting helped). As others have said, you don't want to be signed in as the test user in the Settings menu when you try to perform your IAP.

Build and Archive - nothing happens on Submit Application

After successfully building the distribution version of my app for submission to iTunes Connect, I selected Build and Archive, as recommended, and the Organizer window popped up. Why, wondered I. OK, if I click the Archived Applications tab it displays one archived application (unfortunately grayed out - don't know if that means anything. I mark it and click Submit to iTunes Connect, XCode asks for credentials - and nothing happens. OK, says I, I will add the app manually via the browser, and right-click it and select 'Reveal in Finder'. I go hunting for files created recently, and find nothing.
How are you supposed to submit apps, really?? :)
I followed the iOS dev guide for Distribution, here.
I would also like it confirmed that submitting from within XCode allows me to log onto iTunes Connect and add screenshots etc, this is my first app for Appstore.
Update: Apparently it ends up in username/Library/MobileDevice/Archived Applications/somelongnumber - on the second go it revealed it in Finder. I updated the title, since I now have some files ;)
To clarify, I was expecting some kind of upload progress bar after supplying the credentials, followed by 'your app has been submitted to iTunes Connect' or similar.
Is this a common problem? Will uploading manually be possible now? I guess iTunes Connect will tell me what files to upload if so?
Yours is a common mistake due to Apple's unhelpful UI.
Before validating and submitting your app via Xcode's Organizer, you must login to iTunes connect and submit all the information about your app (description, screen shots, etc.). Once you've submitted everything but the binary via iTunes Connect, your app will be in a "Waiting for Upload" state. Now if you go into Organizer and click "Validate Application..." you'll get a response. Once your app has been validated, you can click "Submit Application to iTunes Connect..." and cross your fingers for a quick acceptance.