Expected sequence when using iTunes test user - iphone

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.

Related

App Store Rejection With Reason: your app requires users to register personal information to purchase non account-based in-app purchase products

For last few days this cat and mouse game is going on between me and App Store Reviewers. And despite searching everywhere, I have not been able to find an answer to this question, so seeking help here.
I have submitted an app with auto-renewable subscriptions in it.
My app requires that users sign-in in order to see additional options, which includes subscription option as well.
App Store Reviewers keep rejecting my app citing this same text every time:
Regarding 5.1.1, we continue to notice that your app requires users to register with personal information to purchase non account-based in-app purchase products, which does not comply with the App Store Review Guidelines.
To resolve this issue, it would be appropriate to make it clear to the user that registering will enable them to access the content from any of their iOS devices and provide them a way to register at any time, if they wish to later extend access to additional iOS devices.
We look forward to reviewing your resubmitted app.
Best regards,
App Store Review
What is non account-based in-app purchase products by the way?
I have also made it clear in my app what App Reviewer have asked above, i.e. make clear to the users that registering will enable them to access the content from any of their iOS devices. I didn't say iOS devices specifically, but said other devices since I'll have the same app on Android devices as well.
While I appreciate App Store Reviewers to help me improve my app, but I am totally lost here. I have submitted two updates to my app but every time it got rejected with the same reason.
Over this period I have also read their guidelines, read many similar cases online, but am still not clear what is required of me here.
Do they want the users to be able to purchase subscriptions even if they are not signed in? If so then technically how does this work? First it'll break the core functionality of the app since without registration I don't have user's info to create an account for them. Secondly how will I know which user purchased the subscription? I have to tie the subscription to the user's account on my backend. This means first I need to create an account for the user before user can purchase a subscription.
Please help me to get this right.
Currently I am waiting App Store's reply and my screens looks like these, with all other options removed when not signed in, and added text bottom of the Sign-In option, and help icon on top right of the screen where there is more information available for the user; and the one when user is signed-in.
If I would be a user of your app, I think I would find this behavior quite odd.
I would expect a login/registration screen when starting your app. If I decide to create an account, the Subscription button would always be visible within the settings.
However, there would also be an option "Continue without registration". If you do not create an account, the settings page could show some info text like "Some features are only available for registered members. Please tap here to create an account". Tapping the corresponding cell would show the registration page that is also shown when starting your app for the first time.
Maybe some users created an account in the past but forgot their passwort? Then they would not be able to restore their purchases, right?
Your login/registration form should also contain a "Forgot Password" option.
My app was eventually approved last year. The change I made was to remove the Subscriptions button from the Settings menu. And move it inside the user profile page. This means that user can see the Subscription option only after signing in and by going to their profile page. While this doesn't make sense to me, but that's how probably Apple wanted it. Subsequent updates to my app were also approved without any problem.

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"

iOS5 log out completely to test in-app purchases

I"m testing an in-app purchase using my iPhone on iOS5 but despite going to Settings > General > Store > Log out (as I've seen on many websites), I can only enter a password when prompted in my app. The username appears to be stuck as my primary Apple ID (used in the stores). Somewhere there must be a setting to sign out completely on the device, but I can't find it.
Anyone know how to fully sign out of the iTunes store on the device to test in app purchases?
Open the App Store, scroll to the bottom in the "Featured"-pane. You should see your account there, click it and log out.

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?

in-app purchase sandbox mystery: phone left in state unable to initiate purchase

I have an ad-hoc deployment of my iOS game, which includes in-app purchase. It is correctly set up with a purchasable item on itunes, and I have test users on itunes. I am able to successfully test it with my own iPod, and with a friend's iPod -- I can choose the item to purchase, get the price info correctly from the Apple server, choose to buy, enter the Apple ID and password for one of the test users, an the purchase completes successfully.
Another friend also installed the game on his iPhone and was starting to look at in-app purchase, but he followed an incorrect procedure, an now we can't get in-app purchase to work on his iPhone at all.
Specifically, he correctly signed himself out of the Store via the Settings application, then ran the game and chose the item to purchase. It correctly retrieved the price information. However, when the standard UI popped up and where he was supposed to click "Use an Existing Apple ID" he chose "Create a New Apple ID" by mistake. This brought him out of the game (game was sent to the background) and over to the web page to fill in the details for a new user. He realized that was wrong and returned to the game. But when he then tried to repeat he process, after retrieving the price info (again successfully), when he went to initiate the purchase, it errors out and never shows the standard UI where he can choose Existing Apple ID or Create New. So it's like his phone was left in a funny state. He tried rebooting the phone, reinstalling the app. Same problem. Then I recommended that he log in to the Store via the Settings app using his regular account, download a couple free apps, and then log out of the Store via the Settings app and try again. My thought was that this full process would somehow "clear out" whatever bad state his phone was in. But no dice. Same problem.
We can't figure out what state his device is in such that it fails when going to the purchase step of this sandbox in-app purchase process. I am still able to successfully complete the process on more than one other devices, so I don't think it's a problem with the state of the purchasable item or test users on itunes. It seems to be something specific to his device. I also had him using iPhone Config. Utility to watch the Console log as he went through this process. Very little was seen -- just an error code coming back after trying to initiate the purchase. (Nothing about PIPELINING errors and other web-service type errors that I've seen before when in-app purchase wasn't set up correctly on the sandbox.)
Any ideas on what state his phone could be in with respect to (sandbox) in-app purchase, and how we can clear it out?
Reset your network settings (Settings -> General -> Reset -> Network Settings)
Turn off your iPhone and turn it on again.
Wait for 15 min (This is the time iOS caches AppStore credentials)
Try running the app again.