How is "restore purchase" actually implemented in most apps? - ios

According to Apple doc, calling restoreCompletedTransactions() prompts user for App Store password:
Don't automatically restore purchases, especially when your app is launched. Restoring purchases prompts for the user’s App Store credentials, which interrupts the flow of your app.
I tried quite a few apps but never observed this behavior. One example is bear, a freemium note taking app. When I pressed its "restore purchase" button, it just went ahead to query and then showed an alert saying that there was no purchase information for me.
I wonder how is this implemented? I guess it stores users purchase information on its own server so it queries its own server, instead of App store. But the question is how it identifies me? (Note Bear app doesn't require user to create an account to use the app. I just downloaded the app and didn't do anything in it yet.). I know iOS has DeviceCheck API, but I think that only identifies a device, instead of an user, right?
Thanks for any help.
Note: Bear app's "restore purchase" button can be found by going to its side menu, pressing setting button at the bottom, pressing "get Pro!" button.

You need to be signed in with Apple ID in order to download apps and make purchases, that's how they match it.

Related

Mechanism of apple in-app Purchase need a restored button?

After reading Apple's terms with my average English I understand that all application who sell non-consumable item need to use the IAP and insert a "restored button" if not the application is rejected by apple.
My user need to be connected to an account to play in my game and the IAP is attached to his account. And the non-consumable item is a money that he can spend. So I can't add a "restore button"...
So my question is, compared to my project do I really have to install a restore button? And if yes, how?
Update
I found my answer :
Apple documentation
So I don't need a restored button because I've sell consumable item.
The simplest solution is to look, how other similar apps work.
Add a restore button somewhere in settings. User taps the restore button.
If user is logged in, then his balance is automatically restored from the account on your server and you just tell him, that his balance is restored.
If he is not logged in, you should tell him, that he should login to restore his balance and then show him a login view.
All this should be reproducable by AppStore's app tester.

Apple in app purchase

I'm trying to test my in-app purchase on my book collection app. I'm using mag+ publish tool for this, maybe someone know it.
I put downloadable content files in my server and upload them correctly (my free issue download is ok). I set my in-app purchase in iTunes connect and I activate it with "cleared for sale yes". I create my test user id, sign out in settings open my app and push the button to buy my issue. The message "are you sure to buy nameofmyissue?" appears, and I put my id and password. The App Store opens after I check ok, but I got this message [environment: sandbox] and the download never starts.
Is that the expected behaviour, or there is a problem?
[environment: sandbox] is development side so may be it cause not download
and I think in production(distribution) mode it will run fine
Thanks hope this two line helpful to you
1) Go to Settings > iTunes & App Store
2) Tap on the Apple ID and delete the entry
3) Tap Done
This should cause this section to display a Sign In message now.
Now try to make the In-App Purchase again. You should be prompted to sign in to the App Store before proceeding. Then it'll ask you to enter your password again to make the actual purchase.
(AFAIK once the product(which you want to sell as part of IAP) on the iTunes store is approved, the message of sandbox will be removed. This will be done when you put your application for approval process. User will automatically diverted for actual product and not the sand box one.)

Require In-App Purchase

I want to create an app that will be displayed as FREE on the App Store, but upon opening it, users are required to do and in-app purchase to be able to access any of the content. I am reading the App Store Review Guidelines, but I am not sure if Apple allows this since the users will not be able to see anything on the app unless they subscribe to it.
The reason I need this is because my client wants the app to be sold at $0.99/year and I don't think this can be done by setting only via Price Tier.
Create a membership only app.
You must sign in to use the app (you can give apple a test account)
then you can manage the membership on your own servers. Or allow them to sign up with the in app purchase.
(enable both the user login and the in app purchase to get a user login, then you can give apple a "test" account that requires no purchase)
They will test your in app purchases anyhow so make sure you follow all the rules on Re-Activating in app purchases, this way if the user comes back and reloads their purchase and they have 2 months left you are sure the app will still allow them.
As long as you dont try to accept credit cards from the app, and use their in app purchase system you should be fine.
If you want to enable users to purchase their account from your server, you cannot allow the purchase from the app. The login however can enable the app without the purchase (and the test account should) but in app purchase should allow them to attach their purchase to the account they use.
I think im rambling now so I hope thats enough clarification.
What you can do is present a demo of the app as a feature before the user buying in-app purchase.just a screen extra. So that Apple does not reject it.
The other option is:
If you have a login/password app, you can tell apple that your app requires login before any feature can be given, only if your in-app thing is login related.

iOS: How Do IAP's Work?

I was wondering how I give the user the new add-ons after they purchase them. Lets say that one of my IAP's is a new tab in a tab-based application. I'm under the impression that the process is something like this:
Submit an update to my app, adding in the IAP support.
Submit my app to iTunes Connect's "Manage IAP's", with the new tab implemented in the program.
When the user clicks "Buy Now" in the IAP screen, the app will grab the version of itself with that feature implemented off of iTunes Connect.
Sorry if this is confusing, I'm having a hard time wording what I'm trying to say. Any help would be great, thanks!
Number 3 is wrong. The user will download the version of your application that supports both IAP and the new tab feature. Your app itself will have to determine whether to show the tab or not.
That is, when the user makes the purchase, you show the tab. There won't be two separate versions of your application on iTunes.
Depending on the purchase type, you can store a local flag or receipt on the device indicating that the user has purchased something. The next time your app runs, you check the flag or receipt and then show the tab only if the user had purchased the feature.
See: In-App Purchase Programming Guide

App rejected due to "missing restore mechanism"

My application was rejected due to "missing restore mechanism". I don't understand because I put the restore button in a UIAlertView.
Yes, the functionality that Apple is asking you to put into your app is to provide a "restore" ability.
If one deletes your app (which they paid for) and wants to restore it later, they've still paid for it. And that's the functionality you need to make happen.
Here is a tutorial that talks about what to do, in terms of code.
You must add Restore button whenever you used in App purchase in your app.
as per apple documentation there is several types of in app purchases. one of them is "non-consumable n app purchase". Nonconsumable inapp purchase means the user have to paid for that only once, he do not need to paid for the same item again.
But now question is that if user deletes your app from device then how can he get his/her product back without any type of payment. for this purpose apple recommends to the developer to add the RESTORE button in app when there is in app purchase.
http://www.raywenderlich.com/21081/introduction-to-in-app-purchases-in-ios-6-tutorial
The above link is for in app purchase where you can find extra information about restore and some helpful code.
Hope this help someone.

Resources