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

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.

Related

Flutter in app purchase iOS not testable in testfly?

I have already an iOS app in production, but I have change a little the purchase part. I don't remember or found if it's normal that I can't test a purchase in testfly or in debug mode/release mode.
The id purchase is detected and the product is display. My purchase test work on Android when I clic on the product, I see pop up to test a purchase. But on iOS when I clic on product I have nothing. In debug the purchase is call but no pop up to validate purchase to test, and no more information about errors.
sandbox is activated
sandboxTesting=true;
On my device setting-> itunes Store and app Store-> I have my app id add in sandbox
In app purchase is add on xcode signing and capabilities
Other observation I remember that before I had pop up to add user id and password to connect, I now I don't know why, I don't have the apple connect pop up.
The only things I did, is to try to upgrade flutter, and downgrade ( because some bug) to return to initiale version who is in production. I even try to return to the initial flutter release ( who expected to work) and I have same problem...
I try to create a new flutter projet to test purchase example from flutter package, and use my current bundle id to display my product. It's display but I have same problem : no connection pop up, no purchase pop up. nothing... but purchase is display, found, and all processus (Xcode, appstore connect, testfly .. is valid.
So I'm little afraid to publish without testing.
Before use time machine to backup all my mac before all this bug, I would have your opinion about this
Thank you

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.

In app purchases in iTunes Connect. How to make the in app purchase "Cleared for sale"?

I am trying to add in app purchases to an app that is already for sale on the app store for the next update. I have never added any in app purchases to it before.
I am using MKStoreKit to handle the in app purchases so I figure everything is as it should be on the coding side of things.
When my app starts up I query the list of available in app purchases, this successfully returns the list of in app purchases (just two at the moment) and the prices of them.
I have a button in my app that sends a purchase request, I pass in the appropriate product ID. This consistently gets cancelled every time and I get the error message
User cancelled transaction:
in the log.
From reading other blogs and posts I have come to the conclusion that it is because my in app purchases aren't cleared for sale in iTunes connect, they currently say "Waiting for Review".
I have tried everything on this check list to try get this to work http://troybrant.net/blog/2010/01/invalid-product-ids/ but still nothing.
I submitted an app and then a few hours later developer rejected it because I heard this worked for some people.
Anybody know how I make the in app purchases cleared for sale in iTunes Connect?
Just spotted that I never closed this question. The reason this was happening was because Apples servers were acting up at the time. Game center sandbox was also effected at the time. I left it alone for a couple of days and it started working when I got back to it.
Actually you should have tested the in-app before submitting them for review. Afaik, as soon as they are in-review state, purchases with the test account might not work. You could try and create another in-app item for testing purposes, just create it and try to purchase that (using your iTunes Connect Test account) without submitting it for review.
The cleared for sale status can be set in the pricing and availability section of the respective in-app item.

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.