I cannot get in app purchase test to work

左心房为你撑大大i 提交于 2019-11-30 15:21:39

I just got it to work. I used only "TAP001" for a product instead of "com.companyname.appid.TAP001". and I got product information back.

I feel dumb but I know have tried "TAP001" in the past with no success but I have tried so many things prior to this that I must have had some other information wrong a the time I did.

For those who are struggling with this issue, I can say:

  • Your app does not need to be live in the store.
  • You do need an app in the App store submission. Reject the binary after uploading it.
  • Testing your app should work in Release or Debug modes
  • You do need an in app product "Cleared for sale"
  • Your product request only needs to contain the product id(s)

Here is an example:

- (IBAction)buyButton1Click:(id)sender{
    NSSet *productList = [NSSet setWithObjects:@"TAP001", @"TAP002", nil];

    SKProductsRequest *request= [[SKProductsRequest alloc] initWithProductIdentifiers:productList];
    request.delegate = self;
    [request start];
    }

According to Apple's itunes connect FAQ, you need to create a test user in order to use the itunes store sandbox environment.

That being said, even after creating such a user and setting my iphone to use that user, I am still experiencing the same issue that you report: all products are "invalid" according to the store kit API.

I'll update this post when I figure it out.

I've also heard that some times, you need to wait several hours before the in-app item goes through apple sand box servers, so it could be the reason it doesn't work yet. I'm in that case, i'm going to wait 24 hours to see, i'll let you know !!!

So: Imagine an extremely complicated and convoluted set of rules for how to test in app purchases. Now make it ten times more complicated. That is apple's solution. :)

You'll need to read the itunes connect developer guide, and probably also the In App Purchase guide. The short answer is that you'll need a special test account and you'll also need to use it in a very particular way if you want to test your in app purchase.

Good luck!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!