Reputation: 1782
I have an iOS application which uses in-app purchases.
I have already set the environment:
I have also tested all with a sandbox environment and all works as expected: the list of products is correctly received by the store and i can purchase a product validating the corresponding receipt.
I have also tested the application using testflight which creates automatically a sandbox user for all testers and all works as expected.
I submitted my application to the Apple store and the revision has been passed so that at the moment the application is in "pending developer release" status, all the products have been approved:
In order to try an actual purchase (using a real credit card) I have generated a promo code with iTunes connect and I have installed the application on my iPhone. However, when using the application downloaded in this way I can't see any products in the IAP section of my application. It seems the application downloads an empty or invalid product list. The same application version works fine with Testflight. Is the use of promo code permitted with IAP? Why I can download a proper list of products only using a sandbox user? Since I can't debug my application, how can I find the problem?
EDIT
I found found here the following points about invalid Product Identifier problem:
I have generated the App Id managing signing automatically with XCode.
In the developer portal I have the App ID in this form
Currently, I don't have generated any provisioning profile, in fact I can't find it in the "Provisionig Profile" section of the developer portal. And, as you can see in the image above, in Xcode I see "XCode Managed Profile" as a Provisioning Profile:
Is this a problem? If yes, how should I fix it? Is it enough to generate a new provisioning profile manually and install it on my machine? Should I upload a new build for my application?
If the provisioning profile is missing, why is my application working correctly using sandbox users and Testflight environment?
Upvotes: 5
Views: 1744
Reputation: 1782
The problem was that, actually, you can't download a list of product until the application is in the "ready for sale" state. As stated in the In app Purchase FAQ:
"When an application is approved, the developer must also approve the application for release to the App Store. On approval, the application ID is activated to the App Store. The same activation is required for the in-app purchase identifiers and can only take place once the application is activated. In some cases, the activation of the In-App Purchase identifiers may lag up to 48 hours following the activation of the application. If the developer does not approve the release of the production application to the App Store, then any new in-app purchase identifiers will not be activated. This is an issue when a developer wants to verify the application prior to activating it on the App Store. If the desire is to test the in-app purchase process for the new items, the application must be activated to the App Store. This is only an issue for new in-app purchase identifiers in a corresponding application submission. Once these in-app purchase identifiers have been activated, application updates to the submission will find that these in-app purchase identifiers are validated, even if the update is not activated."
So if your application is in "pending developer release" status, you can't get the product list with an application downloaded through promotional codes. Once the app has been released on the store, the product list has shown correctly.
The problem was not related to provisioning profiles: the auto-generated provisioning profile is valid to submit applications with in-app purchases functionalities.
Upvotes: 4