Invalid Product Identifier: How do I verify iOS sandbox environment - ios

Trying to figure this out and following Apple's docs. Here is what I have done, hopefully someone can help point out where I screwed up. My app, we'll call it MyApp, is at v1.1 and for sale in the app store. I have created an In-App non-consumable purchase for 99 cents, tier 1 with a product ID we will call AdFree. Simple option to remove ads from the app.
Product ID: "AdFree"
App Bundle ID: "com.name.MyApp"
I have setup my bank/tax info for iOS Paid Applications.
I created a provisioning profile to test this, with the explicit App ID: com.name.MyApp.AdFree - if the Product ID is "AdFree", should my explicit App ID be "com.name.MyApp.AdFree" or just "com.name.AdFree"?
I configured code signing in my project (Xcode) to use the new provisioning profile i created and downloaded.
On my phone, I am signed out from the iTunes Store. I run my app and try to purchase AdFree, but I keep getting back "AdFree" as an invalid product identifier.
Hoping someone here can point out something I missed or tip me off to some other related problem.
Code wise, I have a static NSString *productID = #"AdFree"; setup and I do the following when in the option to purchase Ad Free:
NSSet *productSet = [NSSet setWithObjects:productID, nil];
SKProductsRequest *request = [[SKProductsRequest alloc]
initWithProductIdentifiers:productSet];
request.delegate = self;
[request start];
This project is targeting iOS 7.
Thanks for your time...

Well, after being frustrated and side tracked, I finally got to work on this again. I was following old suggestions and found nothing recent that helped...until last Friday. My problem was where iTunes Connect stated:
This In-App Purchase is not currently available for testing in the sandbox environment because you have chosen to host your content with Apple, but have not delivered your content. Upload your content to test this In-App Purchase in sandbox.
So my product requests came back invalid. I read everything about having to upload an app binary and then rejecting it (don't do that), adding an IAP purchase screenshot (don't do that), using the app id in front of the IAP id or just the name of the IAP purchase and not the full bundle-like id in your product requests (don't do that).
This post finally solved my problem. It just linked to this guide for uploading IAP purchase content from XCode and Application Loader. Once I uploaded the IAP content I built in XCode, my IAP status went to "processing content." A lot of posts say wait anywhere from a couple of hours to a day. It took 3 days but my IAP finally moved to "waiting for screenshot" and my sandbox build now works great.
Part of my problem was trying to follow Apple's documentation. Nearly every post linked to the Technical Note TN2259, which should be good. However, that doc complete skips over the part about starting a new project in XCode to build your IAP purchase content and uploading with Application Loader when you use Apple to host your IAP.

Related

In app purchases using SwifyStoreKit unable to get info about product

I am implementing IAP in my iOS app, and I am using the latest version of SwiftyStoreKit Framework to help me with the purchases.
I have done all the pre cursor tasks such as setting up a developer account in itunes connect, generating provisiong profiles for the app, making new consumable and non consumable purchases in TestFlight, adding those purchases to the app information (ready to submit) and also creating a sandbox user. I have done debugging following this answer, this one and this one.
Now, the problem is that whenever I send a request to retrieve info about a product, I get the following error.
RetrieveResults(retrievedProducts: Set([]), invalidProductIDs: Set(["com.mycompany.app.consumable"]), error: nil)
and when I try to purchase the product, I get this error Purchase Failed: SKError(_nsError: Error Domain=SKErrorDomain Code=3 "Invalid product id: com.mycompany.app.consumable" UserInfo={NSLocalizedDescription=Invalid product id: com.mycompany.app.consumable})
Restoring purchases and verifying receipts seem to work fine...
Any pointers would be very helpful.
Thank you.
UPDATE:
I have now left behind the SwiftyStoreKit framework and am using Apple's own way of using a SKProductsRequest, where I have setup the delegate functions and all the requirements and then I run the function call 'SKProductsRequest.start()' and it still gives me back a set of invalid product ids once again.
For the new method, I setup a new project, along with bundle ids provisioning profiles, and itunes connect app. I can upload the app to itunes connect for testflight too! So the ids seem to be correct.
Ok, after all this time I visited my old co-workers again and they told me that the admin had forgotten to accept the store agreements.
Even though I had specifically mentioned it as a possibility... but oh well. They were able to get purchases working again after that.

First In-App Purchase

I'm trying to add my first in-app purchase to my iOS application
It's state in iTunesConnect is "Missing Metadat", but the only thing I didn't send is the screenshot for the review (I expect to see "Wiating for screenshot" instead of "missing metadata"). I also specified the localization name of its group
The thing is that in my application, my productIdentifier appears in the invalid products, and I don't know why because it seems for me that everything is fine.
I disconnected my AppStore account, My AppID and my signInProfiles have In-App Purchase checked in the capabilities, XCode does not show any error in the project's settings, I have a sandbox user on iTunesConnect.
I really don't understand what to do to make things working...
Note : A few months earlier, I managed to have an In-app product and I was able to test it on my application in the development state. We didn't submit it to the App Review and I had to delete it from iTunesConnect.
I found the source of my problem
I apologize because I totaly forgot to talk about it, but I work with 3 stagings of my application : Production, Integration (i.e BETA), Development
And to be able to have all 3 of them on my devices, I use extensions in my appIDs for each state :
- com.compagny.app for production
- com.compagny.app.integration for integration
- com.compagny.app.dev for develpment
And it seems that for IAPs YOU HAVE TO keep the exact same appID as it is on iTunesConnect... :/ That was just that...

In-App Purchase, always Invalid Product ID

thanks for reading.
I was success with IAP before, but now, when come back on 2nd project about IAP, I always get popular "Invalid Product ID" result.
Here is what I've done:
1) Create App ID: com.tim.TestIAP
2) Create Provisioning profile, with In-App Purchase (already checked) and install this into Xcode
3) Go to iTunes connect and add app with bundleID = com.tim.TestIAP
4) Add In-App Purchase products:
a) com.tim.TestIAP.C1
b) com.tim.TestIAP.C2
c) com.tim.TestIAP.NC
5) Open XCode and create new project with ID = com.tim.TestIAP
6) Set code signing = com.tim.TestIAP provisioning profile
7) Write code handle Storekit
productsRequest = [[SKProductsRequest alloc] initWithProductIdentifiers:[NSSet setWithObject:#"com.tim.TestIAP.C1"]];
productsRequest.delegate = self;
[productsRequest start];
8) Archive project and submit to iTunes connect.
9) Wait (over 48 hour til now)
10) Now I get:
a) iTunesconnect: App status = Waiting for review, IAP status = In review
b) App installed on device via XCode (I signed out iTunes account on device)
But everytime I tried to send product request, with correct Product ID, I still get this product in
SKProductsResponse.invalidProductIdentifiers
Please tell me where I was wrong, thankyou very much
Did you try remove app from device, clean your xcode and reinstall your app again?
Its so classic answer i know but it worked for me before and you be sure if your purchase is for free or not, free purchases absolutely dont work.
Your purchase should be in ready to submit or waiting for screenshot mode if you using it with test account. Also be sure about if your test account is working (if you tried sign with it before in iphone or in site, this account will be invalid.)
Hope it can help.
One more possibility: does the bundle ID match? I have a set up where I append "Beta" automatically to the bundle ID of my debug builds, and forgot about that during testing.
I tried everything everyone is talking about. I ended up making a guest account first to see if the product ID could be found.... It was. So then I started quitting everything in activity monitor and found the problem. I had to quit the "store" processes below. All of a sudden I stopped getting the invalid product ID. Hope that helps someone out there.
Quit these and then build and run if you're getting the invalid product id null error
Are you using iTunes Connect test accounts to purchase the IAPs?
You can't use real Apple id until your application + in-app purchases are approved, until then you can create test accounts from iTunes connect -> Manage Users -> Test User and use those credentials to purchase your testing IAPs
Did you complete the paid apps agreement in 'Agreements, Tax and Banking' in iTunes connect? I have missed that and spend days on technical analysis. After completion it worked in minutes.
Screenshot of completed paid apps agreement.

In-App Purchase not working in Apple Store but working in the sandbox

I am developing an iOS application with In-App Purchase (IAP). I have tested the IAP (in the sandbox environment) and it's working fine. Apple accepted the application and my IAP is ready for sale. But when users download the application and try to buy, they receive the alert the product is not yet available.
For information, I have two Apple accounts, one for the client and one for me. I have added the same productID in the two accounts. In my account it's just for testing and I have used the same productID for the release of the application with the client's account.
Do you think that the use of the same productID can cause this error in the Apple store?
Finally it was a Bug from the Apple Store, after waiting (6 days) it's OK.
how long did you wait after approval? My experience is that 4-hour of waiting, check it out here --- plus you can go thru a few things in the link to see if any of that was not properly set for your app.
IAP fails after release, but no in development stage

In App Purchases - empty product list

I'm trying to understand how to work with In App Purchases. I've read many documents and seen a lot sample codes but I can't understand why product list is empty. According to documentation and forums I made this:
Setup contracts on iTunes connect.
Create AppID on provision portal with unique bundle ID
Create and install provision profile for this AppId and enable In App Purchases
Create application on iTunes connect.
Create purchases for this application.
Submit application.
Reject application.
In code, I've tried to receive product information by product ID and as result I can see empty list. However, I can see an array of invalid product IDs.
Could you help me to understand what is wrong?
Thanks.
According to Apple documentation:
Follow these steps to test your application in the sandbox.
- Log out from your iTunes account on the test iOS device.
- Before you can test your application, you must first log out of your regular iTunes account. iOS 3.0 includes a Store category in the Settings application. To log out of your iTunes account, exit your application, launch the Settings application and click the Store icon. Sign out from the currently active account.
- Important: Do not sign in with your test account in the Settings application.
- Launch your application.
- Once you have signed out of your account, exit Settings and launch your application. As you make purchases from your application’s store, Store Kit prompts you to authenticate the transaction. Log in using your test account to approve the payment. No financial transaction takes place, but transactions complete as if a payment was made.
I've tried it and can't see "Store Kit prompts you to authenticate" when I ask for products. Maybe I need to setup project in xCode?
Hm...
I can see products in Simulator of iOS 5 but can't buy it. Magic.
Try to delete your build and app on your device. I think this one should work.
It can take a good few hours for Apple's server to get round to enabling the in-app buys. I had the same problem that you did, but then it just started working half a day later.

Resources