Inapppurchase invalid product id - iPhone StoreKit - iphone

I'm building an iPhone app and having a really hard time testing my support for in-app purchase using StoreKit.
Specifically, I am unable to retrieve a product ID using SKProductRequest, and so I can't get far enough to even try to attempt the purchase.
Here's what I have done so far:
- Created an App in iTunes Connect
- Created an App ID will a valid Bundle ID in the Provisioning Portal, and configured it to Enable In-App Purchase (I see a green ball for this App ID)
- Created a Provisioning Profile using the App ID above for my iPhone 3GS that I use for development (iPhone is updated with the latest current firmware) and imported it into XCode
- Set the Bundle ID for my application in Info.plist to match the Bundle ID (full Bundle ID, like "com.company.myapp")
- Created an In-App purchase associated with my iPhone app above, set its ProductID to "com.company.app.feature", set the type as Consumable and marked it as "Cleared for sale". The current status is "Pending Developer Approval"
- Updated my code to use the ProductID of the in-app purchase created above when requesting Product Information using SKProductRequest
- Signed out of my iTunes Store account on my phone, and enabled In-App Purchases on the device
- Built a Debug build of my app targeted for my phone with the Provisioning Profile above
- Deployed my app on my device using XCode and tried to run the StoreKit code with the USB cable attached.
When I issue a request for the product from the store, the productsRequest:didReceiveResponse: delegate is invoked, but the productID I request shows up as invalid.
Next, I also tried to upload a binary for my app and see if that made a difference, but it didn't. The current status of my binary is "Developer Rejected", if it matters.
It has been well over 24 hours since I created the app/in-app purchase
Thinking that it might have something to do with my device, I reset an iPod touch to factory settings updated with the latest firmware. I created a provisioning profile for the iPod touch and deployed the app to it using XCode. That didn't help either - I see the same "invalidProduct" problem.
Any suggestions of what I should do next?

Here you have many possible causes of Invalid Product ID

Related

Cannot connect to iTunes store error

Well, I'm having this issue now. I'm using MKStoreKit in my in-app purchase. This are my errors:
Failed transaction: <SKPaymentTransaction: 0x136a62e0>
error: Error Domain=SKErrorDomain Code=2 "Cannot connect to iTunes Store" UserInfo=0x13654a90 {NSLocalizedDescription=Cannot connect to iTunes Store}
Any idea?
You may remove that error via cross checking this check list.
If your answer is no for any of the points then it may be causing the problem
Have you enabled In-App Purchases for your App ID?
Have you checked Cleared for Sale for your product?
Does your project’s .plist Bundle ID match your App ID?
Have you generated and installed a new provisioning profile for the new App ID?
Have you configured your project to code sign using this new provisioning profile?
Are you using the full product ID when making an SKProductRequest?
Have you waited several hours since adding your product to iTunes Connect?
Are your bank details active on iTunes Connect?
Is your device jailbroken? If so, you need to revert the jailbreak for IAP to work.
For iOS7 and Xcode 5 Try doing this:
You have to test on a physical device as apple restrict IAP testing in the simulator.
Go to setting -> iTunes & App Store -> and log out of your account.
Remove app from device and clean all data.
Most importantly do logout from your current iTunes account in your device before trying to do any purchase.
Make sure you have done all necessary steps for in-App purchase testing.
As of September/October 2013, iOS7 simulators cannot process app store inapp purchase requests.
You need to use a real device
Imagine, you created new app profile in My Apps of itunes connect. Added in-app. All correct.
Now you want to test purchases. It shows list of products but stops on buy button with "Cannot connect to iTunes Store" error in log.
This is because you try to buy not approved and not existing product!
You can test only sandbox product right now.
So, you have to
create sandbox user (in itunes connect - users...)
logout you real itunes login on device
try to buy under sandbox login (it will ask you)
Had same issue and I just remembered not any apple id will work. You have to create a testing apple id in itunes connect / manage users/ test user / add new user.
Try putting a build number in. Target > General > Identity > Build.
This solved it for me.

In-app purchase product id clarification

I have used "product id" like this "ADR123" in my application. I am getting "invalid product identifier" in-app purchase not working, whether this product id is valid or not?
u need to ensure that the bundle identifier is the one which is for the same app you have on itunesconnect which is having this product id added in in-app-purchase
Follow the checklists of http://troybrant.net/blog/2010/01/invalid-product-ids/
Also refer to this blog.
Checklists:-
Have you enabled In-App Purchases for your App ID?
Have you checked Cleared for Sale for your product?
Have you submitted (and optionally rejected) your application binary?
Does your project’s .plist Bundle ID match your App ID?
Have you generated and installed a new provisioning profile for the new App ID?
Have you configured your project to code sign using this new provisioning profile?
Are you building for iPhone OS 3.0 or above?
Are you using the full product ID when when making an SKProductRequest?
Have you waited several hours since adding your product to iTunes Connect?
Are your bank details active on iTunes Connect? (via Mark)
Have you tried deleting the app from your device and reinstalling? (via Hector, S3B, Alex O, Joe, and Alberto)
Is your device jailbroken? If so, you need to revert the jailbreak for IAP to work. (via oh my god, Roman, and xfze)

Testing In-App purchasing Iphone

I am writing an app for newsstand with free subscription but the product identifier i am using always comes back in the invalid set when making the request.
I have used this tutorial:
http://troybrant.net/blog/2010/01/in-app-purchases-a-full-walkthrough/
I have:
1) created an Appid (fsfe4.com.myapp.myappdesc)
1a) signed the paid ios app contract and filled in the banking/tax info
2) put that appid as the bundle id (com.myapp.myappdesc) in the plist
3) downloaded developer and distrubtion provisioning profiles (developer profile does not have wildcard)
4) updated the code signing identity (both the Debug and 'Any IOS SDK' has the iPhone developer referencing the developer profile i created and downloaded)
5) added the code
6) created and added info for the app on itunes connect (turned newsstand on, uploaded photos and filled out all the info)
7) compiled and archived the xcode project, uploaded it to itunes connect, rejected the binary.
8) created the in app purchase (free subscription), and attached it in the 'view details' part of the application.
I get this notice:
The first In-App Purchase for an app must be submitted for review at the same time that you submit an app version. You must do this on the Version Details page. Once your binary has been uploaded and your first In-App Purchase has been submitted for review, additional In-App Purchases can be submitted using the table below. Note that free In-App Purchase subscriptions may only be submitted with a version that is enabled for Newsstand.
I am not entirely sure what that means.
9) waited 24 hours
10) tried again with no luck
I have re-archived,uploaded and rejected my app a couple of times. I haven't changed the version # in itunes connect but i don't think that should matter.
According to Apple's guide it specifically says that I should not have uploaded the binary and rejected it:
Important DO NOT upload the development binary to iTunes Connect until the application is ready for App Review approval. If the binary is present in iTunes Connect and it is not
fully functional, App Review will review the binary and likely reject the development binary. Testing In App Purchase will fail if you or App Review reject your most recent
binary in iTunes Connect. The workaround in this case is to upload a binary without In App Purchase features that can get approved by App Review.
Once the binary is approved, resume testing the binary with In App Purchase features.
That goes against every other tutorial i have seen. Is there a way to remove the binary to get it back to the pre uploaded binary state so that I can test? should i just delete the app and start over? if I do delete it can I use the same bundle id and same app name?
The problem was that I didn't delete the app from the device and reinstall it after i had gone through the checklist here.
So much time wasted. Sigh.
Are you running your app with development provision or distribution provision?
Are you running your app with same app id / provision for which you have uploaded the in app purchase?
Follow this article - http://www.raywenderlich.com/2797/introduction-to-in-app-purchases

invalid Product Id's in In App Purchases iPhone application?

i just created In App Purchases for my new application and checked Cleared for Sale option.
But when i test my application after 2 days its still giving me invalid product id's..
I didnt Approve them earlier. Do i need to approve the App Purchases too before testing them...Will that affect my application when i upload my final binary and apple starts testing it??
I had the same problem.
It turned out I had to increment the version number of my app in my bundle. This was an app already on sale on the app store for which we decided to add in-app purchase.
Also make sure your bundle Id matches the one in iTunes Connect.
You don't need to approve the in-app purchase to test it only to clear it for sale.

Can I change the Bundle Identifier in my app after it's been approved?

I've got my app approved a while ago and used the * provisioning profile so I created somehting like:
com.mydomain.MyApp
but now I have the necessity of adding push notifications and I can't due I am using the * provisioning profile and it needs to have its own app ID and profile.
How should I proceed in order to achieve an app update without breaking anything
The bundle identifier for an app must always remain the same between updates, but the AppID can actually be different. So all you need to do is create a new AppID that used the same bundle identifier as the original app instead of a wild card.
Apps that use a wildcard still need a normal bundle identifier. The wildcard AppID lets you use any bundle identifier you like, but it still needs one.
There used to be an Apple article about this:
but it is no longer available online However, an archive is available.
You can't change the CFBundleIdentifier of a released app if you want to release updates for it, the App Store will automatically reject it when you upload. So...
I needed to enable iAds on an app previously developed with a wildcard App ID. Here's what I did:
I have a wildcard App ID of <AlphaNumeric>.* which my app currently uses, and my app has a CFBundleIdentifier of com.companyname.mygame.
Created a new App ID of <AlphaNumeric>.com.companyname.mygame.
Created new development and distribution provisioning profiles that include the new App ID.
Download the new provisioning profiles to Xcode and my devices.
I was then able to compile the App with the new non-wildcard distribution profile, which meant on upload I could enable iAds (or Push for you). The CFBundleIdentifier didn't change so the new compilation appears as an update to the existing app.
I can confirm this process worked without issue.
Under Frequently Asked Questions in the document entitled "Technical Note TN2259," which is "Adding In-App Purchase to your iOS and Mac Applications," there's this bit
Question: My iOS application is currently signed with a Provisioning Profile
that uses a wildcard App ID. How do I enable my App ID to support
In-App Purchase?
Answer: Read the Creating and Configuring App IDs section of
the iOS Team Administration Guide to learn how you can enable your App
ID to support In-App Purchase.
The link points here, and there's a section called, "Updating Your App to Include APNS, iCloud, In-App Purchase, or Game Center Requires an Explicit App ID"
That said, I don't know (yet) at what point the app takes on the new App ID. Is it when you upload for review, before that, or when it has been approved? I am working on this problem now, so I might be able to add to this answer soon.
Edit: The explicit app id only affects the piece of software you are testing and has, essentially, nothing to do with iTunes Connect whatsoever. This means that if you are testing in-app purchases, the piece of software that's running (your app) has to have a provision profile based on a cert that is app specific. What happens in iTunes Connect is totally irrelevant.