Cannot connect to iTunes store error - iphone

Well, I'm having this issue now. I'm using MKStoreKit in my in-app purchase. This are my errors:
Failed transaction: <SKPaymentTransaction: 0x136a62e0>
error: Error Domain=SKErrorDomain Code=2 "Cannot connect to iTunes Store" UserInfo=0x13654a90 {NSLocalizedDescription=Cannot connect to iTunes Store}
Any idea?

You may remove that error via cross checking this check list.
If your answer is no for any of the points then it may be causing the problem
Have you enabled In-App Purchases for your App ID?
Have you checked Cleared for Sale for your product?
Does your project’s .plist Bundle ID match your App ID?
Have you generated and installed a new provisioning profile for the new App ID?
Have you configured your project to code sign using this new provisioning profile?
Are you using the full product ID when making an SKProductRequest?
Have you waited several hours since adding your product to iTunes Connect?
Are your bank details active on iTunes Connect?
Is your device jailbroken? If so, you need to revert the jailbreak for IAP to work.
For iOS7 and Xcode 5 Try doing this:
You have to test on a physical device as apple restrict IAP testing in the simulator.
Go to setting -> iTunes & App Store -> and log out of your account.
Remove app from device and clean all data.
Most importantly do logout from your current iTunes account in your device before trying to do any purchase.
Make sure you have done all necessary steps for in-App purchase testing.

As of September/October 2013, iOS7 simulators cannot process app store inapp purchase requests.
You need to use a real device

Imagine, you created new app profile in My Apps of itunes connect. Added in-app. All correct.
Now you want to test purchases. It shows list of products but stops on buy button with "Cannot connect to iTunes Store" error in log.
This is because you try to buy not approved and not existing product!
You can test only sandbox product right now.
So, you have to
create sandbox user (in itunes connect - users...)
logout you real itunes login on device
try to buy under sandbox login (it will ask you)

Had same issue and I just remembered not any apple id will work. You have to create a testing apple id in itunes connect / manage users/ test user / add new user.

Try putting a build number in. Target > General > Identity > Build.
This solved it for me.

Related

iOS app submission not working

I am trying to submit an iOS app through iTunes Connect.
However, when I try to validate the app it gives me an error saying : "This app contains an embedded provisioning profile that is not associated with your account. Please use a provisioning profile associated with the Team ID.
Is this because I am using different accounts for creating the provisioning profiles and for iTunes connect ?
I'm guessing you have submitted your app before signed with a developer certificate from one account and now your trying to do it from another.
To fix it visit this website http://blog.hoachuck.biz/blog/2012/12/04/use-a-provisioning-profile-associated-with-team-id/
Edit
I do think that using different accounts for creating the provisioning profiles and for iTunes connect will cause the issue. So just switch the provisioning files from the prov. acct for the itunes connect account. Provisioning files are easy to make, and Apple has a tutorial on what to do when you try to create one.

In-App-Purchase sandbox testing error

I am getting the below error for sandbox testing while test in app purchase
you are not authorized to make purchases of this in app in sandbox at
this time
How to avoid this error
Make sure of the following:
1. The test account created is from the same developer portal from which you generated your provisioning profile.
2. The test account still exists and was not deleted from there.
3. Use the same identifier for which you created the in-app purchase for your app in iTunesConnect.
I found that I got this error when trying to log in with the wrong test account. One not connected to my iTunes connect account.
Log into iTunes Connect and double check you are using the correct email address as in the test account.
Otherwise here is a pretty good post about all the checks you need to go through to get the in app purchases working in sandbox mode, each has a short blurb on completing each one: http://ireviewappsblog.wordpress.com/2014/07/07/adding-in-app-purchases-in-sand-box-mode/
It covers adding the app to iTunes connecting, setting up the developer account and then also adding the code in xCode to get it working.
1.Check in-app product identifier on itunesconnect is same as you are using in your application
2.Check the bundle identifier for your app are same in the development profile & & itunes connect
3.The status of in app purchase for which you are testing on iTunes connect should be "Ready to submit"
4.Delete the app from your device clean its build from xcode if you have changed bundle identifier or provisioning profile
5.No documents agreement should be pending on iTunes connect or developer.
It is possible that your test account does not exist any longer. I found that you are still able to log in with a deleted test account but you are not allowed to make purchases and you will see the same message as you described.
Chances are you are using provisioning profile from different developer account. check it once again.
Step 1 : Go to settings.
Step 2 : Select iTunes & Settings
Step 3 : Scroll to the bottom. There is a section for SANDBOX ACCOUNT
Step 4 : Sign in there using your Sandbox account
Now test your app & it will work fine.
For sandbox, only sandbox testers can make purchases.
Make sure testers NEVER use the sandbox accounts to make actual purchases; this will convert the sandbox account to a live account.
Only Sandbox Testers can make test purchases. It's NOT the users who are listed in Internal and External testers lists. Check iTunes Connect => Users and Roles => Sandbox Testers.

Unknown App when confirming in-app purchase

I have created a newsstand app and have everything working. The only issues I have now are:
When I click 'subscribe' and the dialogue box pops up to confirm the in app purchase it says
Confirm Subscription
Do you want subscribe to Unknown App for free?
[Environment: Sandbox]
Why does it say Unknown App? Everything else works (receipt validation, completing the transaction & co.)
Also, will the [Environment: Sandbox] go away automatically once I upload it to the app store and download it for real? Is there something in my code that I am missing that sends the in app purchase request to the sandbox? Or is it just because i am using a test device that has the app compiled onto it from XCode.
If your app is not in app store, it shows you the [Environment: Sandbox]. It will automatically go away once you uploaded app and your app is in app store.
For "Unknown App":
You need to add text in inApp purchase section in iTunes connect. If you haven't done that it will show you "Unknown App" on message which comes on iOS pop-up.When you activate in-app purchase by filling all information in inApp purchase section, pop-up will not show you "Unknown App", rather the pop-up will mention your app name.
Hope this will help you.
If your app is not in app store, it shows you the [Environment: Sandbox]. it will automatically will go away once you uploaded and your app is in app store.
If your binary has been rejected by Apple, the IAP products submitted with it should also show up as rejected. When you try and purchase a rejected IAP within the app, the confirmation screen will show the aforementioned "Do you want to buy one Unknown App...".
To correct this you should be able to make a small change to each IAP product in iTunes Connect. Then simply change it back, then the rejected flag should go away (and be replaced by waiting for review. For example, I added an 's' to the Display Name for the English language of each product. Then went right back in and removed the 's'.
This may not be acceptable to Apple if the reason for your rejection centers around your use of In-App Purchases.
I suggest to check your itunesconnect account.
Goto your Specific App "NewStandApp" .-> Manage InAppPurchases. Now check Reference Name you have Added with your ProductID.
Product_Id your are referring in project/app (sandbox environment) might be connected with app name "Unknown app"

Can't enter test user email for in-app purchase sandbox

I've created my iTunes Connect in-app test user and implemented all my in-app purchase code. I clicked on the home button -> settings -> appstore -> signout button. I launch my app through xcode. When it goes to perform a purchase transaction it continues to bring up my real itunes connect user info prompting me for the password. Even though it shows me as signed out in the settings appstore screen it never prompts me to enter my test user's email address when I'm testing in-app purchases.
Anyone have any ideas what's going on?
Might try rebooting your device. If you go into the AppStore.app, Featured Tab, and scroll all the way to the bottom where it should show your login name, are you still signed in?
Make sure you did not install your development version over distribution version.
My case:
I’ve downloaded my application from Apple AppStore – distribution version. Later, started debug session over installed application and got the same situation as described the question author. No sandbox environment for in-app purchase.
Solution:
Just uninstall the application and start debug/test your application again – xcode will install development version to your device.
Now there is a new way to log in and log out test users. Under
Settings -> iTunes & App Store
You can manage your current sandbox user. If you log out the sandbox user there you will be asked to give the email address for your user when you try buying inside your app.

Why doesn't in-app purchase show my application's name when testing in the sandbox?

I have completed in app purchase for my application. Its working fine.
The only problem i have , when i test in app purchase in sandbox enviornment, It shows a message do you want to buy an "un known app" for 1.79. why doesnt it shows the name of the app.
Plus when i am going to upload the final binary to app store. what i need to do to swrich in app purchase from sandbox enviornment to real in app purchase or it will switch automaticall?
Thanks guys
Probably your configuration on iTunes connect for this in app purchase is wrong, maybe you forgot to enter the name.
Go to iTunes connect, Manage you in app purchases, select the desired app, and make sure that you have all the fields correctly filled.
When you release on the app store, you don't have to do anything, the sandbox environment is just used when you are developing, when the app is uploaded to the app store, this behavior changes and you can't use your sandbox account anymore
Hope that helps.
When I added in-app purchase support to my application, I had already released a version so there was an entry in iTunes Connect. But I've read that you need to add a new application in iTunes Connect, but check the option to upload a binary later. Then you can enable In-App Purchase on it and configure items.
And your sandbox does not go away after the application is submitted. The In-App Purchase system determines whether to use a sandbox based on the account that is currently logged in to the store on the device. I think as long as you don't have a credit card (or any payment information?) associated with the account, and the account is designated as a In-App Purchase Test User in iTunes Connect, it will use the sandbox. You can log out and use a different account through the "Store" item in Settings.