I am trying to get the listing from the store of in-app purchase items for my app. Here is what I have done:
The only thing I'm not sure about from the answer to this previous question (Cannot connect to iTunes store error) is the part that says: 3)Does your project’s .plist Bundle ID match your App ID?
The Bundle ID is listed as N-A.${PRODUCT_NAME:rfc1034identifier} so I'm not sure how to expand that out to see that it matches. However, since this app is in the store for sale, I'm not sure how this could be off.
The error from the store is Code 0, "Cannot connect to iTunes Store".
Thanks for any help!
The problem turned out to be none of the items on the checklist, but rather a syntactical blunder resulting from my inexperience with Swift. The same issue is not likely to happen to others but I present the solution below for the sake of completeness:
func fetchAvailableProducts() {
// wrong syntax (but able to compile):
// let productIDs:NSSet = NSSet(objects: ["com.mysite.IAP1MONTH", "com.mysite.IAP6MONTH"])
// correct syntax:
let productIDs:NSSet = NSSet(objects: "com.mysite.IAP1MONTH", "com.mysite.IAP6MONTH")
let productsRequest:SKProductsRequest = SKProductsRequest(productIdentifiers: productIDs);
productsRequest.delegate = self;
productsRequest.start();
}