Detecting the state of an in app purchase - iphone

How can an app check the state of an in app purchase and see whether is has been purchased or not?
I want to do this in the viewWillAppear and set the icons of the in app purchases according to whether they are purchased or not.
Can this be done with the apple libraries?

This is a great tutorial which shows you all the steps in setting up in app purchases, including sample code on how to do it. Hope that Helps!

Related

In App Purchase Tab Cannot possible to access

I have developed iphone app with working In App Purchase. Now I want to release new version of the app with new price for in App Purchase. But, Whenever I tapped on iTunesConnect -> Manage Your Applications-> My App -> Manage In App Purchase, I found this ------"java.lang.IllegalStateException: Seventeen".
Can anybody tell me, how to tackle with this issue?
The solution is that there's no solution for that. It is a bug on Apple's side. This iTunesConnect site stinks in all possible ways. I recommend you to fill a feature request asking Apple to provide a software application we can use to manage our apps and in-apps that are already created. Do it at http://bugreport.apple.com. I already did that and the bigger the number of people asking for it, more likely Apple will create that.

Apple Rejection of application due to in app purchase

I had created one application with 2 versions one is paid second free.
Now in free application my some of features are showing an alert by telling the user
"For using this feature you have to purchase Full Version. Do want to purchase?"
On click of No nothing done just dismiss the alert and user can continue with other available features.
On click of Yes I am navigating user on my application's link in app store. My application enter in background and AppStore opens. That shows my application. From there user can purchase app and can download app.
Apple rejected my free version application with following reason:
11.13 Apps that link to external mechanisms for purchases or subscriptions to be used in the app, such as a “buy" button that goes to a web site to purchase a digital book, will be rejected.
1) Am I doing is wrong?
2) Can I use in app purchase in the manner that my free version application get removed and full version get available? because logic for both application is different.
Thanks,
You can't disable features in lite versions. For example, if your lite version has a button that says "Level 5", the user clicks it, and it tells them to buy the full version, the app will be rejected. However, if you have a button that says "Get the full version for more levels," that should be acceptable.
The only way to be sure is to ask Apple.
I would interpret what you've said as:
Going to the App Store to purchase the full version of your app is acceptible. Many apps (including mine) do just that.
However, using IAP to perform the upgrade might be preferable. Your main problem is transitioning existing users from the Lite/Full apps to one with IAP -- in short there's no fool-proof way of doing it.
One thing that might get you rejected is non-functional buttons in the free app. According to the guide-lines, all apps need to be fully functional. Of course your free version can have fewer features, but they don't like it when there are buttons that do nothing but prompt you to upgrade.
What you are doing here is not in-app purchase. In-app purchase refers to using the iOS SDK to allow a user to purchase additional content or functionality that will run in your app. Having 2 separate versions of the app like that does not use in-app purchase.
I'm guessing your app was rejected because you gave the appearance of in-app purchasing by having a message saying "For using this feature you have to purchase Full Version. Do want to purchase?" What you should be able to do, without significant change, is disable those buttons that aren't available in the free version; perhaps replace their text with "Full Version Only." Then, somewhere else in the app, maybe the home screen or screen where those buttons are, you can have a button that says "Get the full version!" or something, which would link to your full version in the store.

Free -vs- Purchase App for iPad/iPhone question

I need some help/clarification on how the paid vs free works. I have an App and I have a free version with ads. When the user purchases I want to disable the ads... that's no problem. But, how do I know they purchased? When the user goes to the App store, to purchase do I get an e-mail, or anything that I can key off of? I do not want to have two versions and if I do, how does Apple evaluate both? I am ready to submit the App, but I am confused on how I transition from free to paid.
I hope this makes sense and someone can clarify the process for me.
Thanks
You could use inApp purchase or compile a different version that will have a price and sell it separately.
#Helge is right. You can do it either through In-App purchase or a separate app version.
If you want to knw about In-App purchase pls go through this Tutorial

inmyapp purchase

i have application first this application is used by customer in demo mode and if he/she want to buy it then how i can make this type application or how can i use inmyapp purchase in my application or please explain in detail what is inapp purchasse...please help me....
You can use this tutorial for InappPurchase
http://www.raywenderlich.com/2797/introduction-to-in-app-purchases
At first you should check Getting Started with In App Purchase on iPhone OS
And for more details: In App Purchase Programming Guide
This should answer most of your questions
and after you are done with the apple provided documentation you should have a look at In App Purchases: A full Walkthrough by Troy Brant.

Need to upload binary to test in-app purchase?

Opinion seems to be split on whether an app binary is required to be uploaded to iTunes Connect before a testing an in-app purchase. I've created the app (no binary uploaded yet), created the in-app purchase, enabled by App ID for in-app purchase and marked the purchase "available for sale". I've followed the instructions in the guide as far as I can tell.
However, when I try it on my device I am unable to retrieve the products - SKProductRequest returns my request product as invalid.
Any suggestions what I need to do?
Does the in-app purchase product need to "Developer Approved" for this to work?
Any definitive answer on whether a binary needs to be uploaded? I would like to avoid that if possible but am willing to do it if required.
Well, actually I just had a similar issue that was solved only AFTER uploading a binary and rejecting it, so I am not sure that the answer above is correct. Would love to hear something from Apple about it as it is the second time this happens to me.
Binary does not need to be uploaded. Source: my current in-development app.
I am getting my test in-app purchases without uploading my binary, and without setting the purchase to be developer approved. I followed the instruction included in the docs to set it up.
Have you been testing on the device? in-app purchases do not work in the simulator. Perhaps if you posted some more info we could help a little bit better.
This is my method... I usually get caught because I miss step 3:
Step 1
Create your IAP's
(I won't go throught that in detail... unless someone wants me too.)
Step 2
Edit In-App Purchases
Select In-App Purchases for review with this app version. The In-App Purchases shown will be ones in the Ready to Submit state.
Step 3
Re-generate your dev & dist certificates in apple developer.
Site 4
Install the certificates from step 3. and ensure under Xcode's Code Signing you do this:
- Set both debug & release setting to Don't Code Sign
- Then assign with your new certificates.
Step 5
Clean and rebuild in Xcode and your IAP's should sandbox on your test devices.
Good luck!
This question is just a bit dated, but working through the Ray Wenderlich IAP tutorial (found HERE) confirms how one goes about testing IAP without uploading a binary.