Iphone: error when buying an application

I am developing an application and using it in applications. I created products in an app in iTunes Connect. Until yesterday, everything worked fine. but today. he began to give this error.

"Error. Payment requests are limited to products returned as valid using the Store Kit didRecieveResponse method.

I have no idea what the problem is. answer

+4
source share
4 answers

Well, it could be a smoking gun -

In accordance with the official flow of data from the Store Kit apps, you must obtain information about available purchases (SKProductsRequest) before attempting to make a purchase (SKPaymentQueue).

I added code to do this, although no localized data was used. I made a call, confirmed that the item was present, and simply reset the NSLOG about it.

The purchase went without errors!

Then I deleted the code that SKProductsRequest called, and re-run it, and received the error message "Payment requests ...".

It looks like the repository structure has been changed in such a way as to DEMAND you to call SKProductsRequest so that purchases can behave correctly when tags are added to SKPaymentQueue.

In computer science they say that they seem to have introduced a tough relationship between two logically connected, but separate modules. This is REALLY bad practice.

Try adding this code to your application and call dumpProductInfo at some point before making "real" SKPaymentQueue calls and see if it starts to work - be sure to update the built-in string literal using your actual product identifier (s).

-(void) dumpProductInfo { SKProductsRequest *request = [[SKProductsRequest alloc] initWithProductIdentifiers:[NSSet setWithObject:@"com.company.domain.app.purchase"]]; request.delegate = self; [request start]; } - (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response { NSArray *myProduct = response.products; // populate UI NSLog(@"Products:"); for (int i = 0; i < [myProduct count]; i++) { SKProduct *product = [myProduct objectAtIndex:i]; NSLog(@"Name: %@ - Price: %f ID: %@" , [product localizedTitle], [[product price] doubleValue], [product productIdentifier]); } } 

Follow-up observation: as mentioned below, Apple Technical Note QA1691 confirms that what I thought was correct - two weeks after we found out: p

+13
source

I started getting it too! The last time I tested the purchase code was the end of last week, and then it worked fine!

I even used the previous version for testing to ensure that no code changes were responsible. This version worked and was sent to the store.

Something has definitely changed, and it looks like something from the app store!

I note that the "official" store data stream requires the application to retrieve a list of products available for purchase, but instead I encoded the identifier after the purchase was determined in iTunes Connect. I checked if the purchase ID has changed, and the answer is that he did not.

To make this more confusing, I pulled out the Live app from iTunes and the purchase went through a fine. Differences between the two scenarios 1. one was created using my development profile instead of the deployment profile 2. one worked in the sandbox instead of the β€œreal” one 3. one used a test account to make a purchase

To make sure this was not a bad test account, I just created a new one and tried to test it. It didn’t matter.

UPDATE - I sent Apple an email in connection with this, did not receive a response (yet), but the error suddenly disappeared, and everything started to work, as expected!?!

+2
source

Here is my theory regarding what comes from my recent IAP testing for a new application:

  • The IAP env sandbox does NOT allow you to test IAP anymore AFTER you have approved and submitted it for review. This is a new undocumented behavior, as far as I can tell, which causes a lot of headaches for us monkeys iPhone SDK. Before this change, you could test the IAPs even after they were submitted to Apple and before the application was approved.

So, in this case, even a request to store the IAP repository for valid product identifiers will not help you.

  • It appears that as part of the review process, Apple has added the following automatic test: invalidate ALL of your IAPs and test your application to make sure you submit a request for valid IAP identifiers before populating your interface using IAP. Thus, if you do not fix this with your code, your application will be rejected, but they will tell you that requesting valid identifiers is only recommended best practice, not mandatory, but is now required in my experience.

I hope this saves someone some time - spend hours on it and had to go through several application crashes until I realized what happened.

+2
source

You must create it directly from xcode in order for the sandbox to work now.

0
source

All Articles