Craig
Craig

Reputation: 693

iPhone Store Kit questions

I'm trying to set up In-App purchasing with the Store Kit at the moment. I've got the Store Kit programming guide but there's aspects which aren't clear. I'm trying to first of all, just get a response from iTunes connect with the following:

- (void)requestProductData {
SKProductRequest *request = [[SKProductsRequest alloc] initWithProductIndentifiers: [NSSet setWithObject: @"com.domain.appname.productid"]];
request.delegate - self;
[request start];
}

- (void)productsRequest:(SKProductsRequest *)request didRecieveResponse:(SKProductsResponse *)response {
NSArray *myProduct = response.products;
NSLog(@"array count: %i", [myProduct count]);
}

I have the storekit framework added - I have the Storekit.h added and the delegate in the .h. I have set up a test product in iTunes (in my code I have the full path instead of the sample above). But it always returns 0 for the Array count.

Does anyones have any experience with this? It seems there's very little documentation and no actual sample code.

Thanks!

UPDATE! I believe this is to do with App Ids and provisioning profiles now. It seems you need specific App Ids and Profiles for the App. I'm testing this out and will answer the question if this is right. Anyone else who can confirm it please do!

Upvotes: 2

Views: 2499

Answers (3)

Peter B. Kramer
Peter B. Kramer

Reputation: 16553

Check out TN2259 especially FAQ#6. And be sure to delete old builds and log out of the app store before reinstalling from Xcode.

Upvotes: 0

Akhil Bhadauria
Akhil Bhadauria

Reputation: 110

First, you'll have to make sure all your paperwork with Apple is finished. That's in the Contract, Tax Info, and Banking section.

http://troybrant.net/blog/2010/01/in-app-purchases-a-full-walkthrough/

Yes, you do need a specific App ID, and the App ID prefix (aka a Bundle Seed ID). You can't use a wildcard App ID here. I'm talking about something like "ABCDE12345.com.mycompany.myapp".

Yes, you do need to have an IAP item marked as Cleared for Sale. (You'll need to set up the App ID prefix first.) Some people report that you need to check the Cleared for Sale checkbox when you create the IAP item; that leaving it unchecked and then trying to edit & enable it later doesn't work.

Yes, you do need a provisioning profile set up, because:

No, you can't test the store kit in the simulator - you need to run on a device, whether that device is an iPhone, iPad, or iPod Touch. You can check this with [SKPaymentQueue canMakePayments], which will also return NO if you're on a device with parental controls that have disabled the store.

Upvotes: 0

AndrewS
AndrewS

Reputation: 8472

First, you'll have to make sure all your paperwork with Apple is finished. That's in the Contract, Tax Info, and Banking section.

Yes, you do need a specific App ID, and the App ID prefix (aka a Bundle Seed ID). You can't use a wildcard App ID here. I'm talking about something like "ABCDE12345.com.mycompany.myapp".

Yes, you do need to have an IAP item marked as Cleared for Sale. (You'll need to set up the App ID prefix first.) Some people report that you need to check the Cleared for Sale checkbox when you create the IAP item; that leaving it unchecked and then trying to edit & enable it later doesn't work.

Yes, you do need a provisioning profile set up, because:

No, you can't test the store kit in the simulator - you need to run on a device, whether that device is an iPhone, iPad, or iPod Touch. You can check this with [SKPaymentQueue canMakePayments], which will also return NO if you're on a device with parental controls that have disabled the store.

No, you don't need to have the application itself for sale in the App Store, but I think you might need to approve it for sale and then reject it in order to get it into the right state.

Upvotes: 2

Related Questions