Remember user purchase info in server model of in-app purchase - iphone

IN BUILT_IN MODEL
If i purchase feature through Non-consumable for on application,if i delete it,
If i purchase it again,will apple remember my user_id to purchase it as free?
IN SERVER MODEL?
suppose the app uses server model, may the server use apple to remember that user?
any help please?with explaination?

If your user purchases an item and then loads your app onto another device and purchases the same item, it will not charge the user for the purchase. The answers to your questions are in the docs here:
http://developer.apple.com/iphone/library/documentation/NetworkingInternet/Conceptual/StoreKitGuide/Introduction/Introduction.html
In particular, on the chapter on making a purchase the docs say:
If the user attempts to purchase a
nonconsumable item they have already
purchased, your application receives a
regular transaction for that item, not
a restore transaction. However, the
user is not charged again for that
product. Your application should treat
these transactions identically to
those of the original transaction.

Related

User can restore the same purchase on different accounts

In my app user can log in with a phone number (account) and purchase auto-renewable subscription. This subscription will be associated with his account so he can log in on another device and see his purchased items. The problem is that he can log in with different phone numbers (accounts) on the same device where the subscription was purchased and restore purchases. So he can restore purchased item for other accounts using the same subscription.
Question: Can we remove Restore Purchases functionality in that case? If we can't how can we handle such situations?
I heard that all apps in Store should have restore purchase button but it doesn't make sense in our case.
See this answer here: https://stackoverflow.com/a/54153169/3166209
In summary, you're required you to have restore functionality, but it doesn't have to be implemented through StoreKit. You'll notice large, cross-platform, subscription apps like Netflix don't have a restore purchases button anywhere for the exact reason you mentioned.

CloudKit sync testing with sandbox users

I'm creating a Mac app that has a non-renewing subscription as an in-app purchase. I want to sync this data to the cloud for the following reasons:
I want the user to be able to use the app on all their Macs
The in-app purchase enables a widget, so that widget needs to access this data.
By Apple's documentation the restoration of non-renewing subscriptions has to be handled by the app by some kind of registration / cloud sync.
So I decided to implement a CloudKit sync to store the following data:
Which IAP product did the user purchase (currently only one value, but might change in the future)
When did the purchase occur.
Here's what I'm doing now when a user makes an in-app purchase:
I validate the receipt
If I find any IAP data, I sync that to CloudKit
I use a function to fetch the purchase data from CloudKit for the said widget
Question 1: As far as I can tell all the in-app purchases are contained in the receipt file, even after removing and restoring it. I could be using this, however the documentation clearly says I shouldn't. Even the forums are not certain about it... What do you think?
Question 2: While testing the app with multiple sandbox users I noticed that no matter which sandbox user I use to make the purchase, the currently logged in iCloud account (my personal account) gets the receipt data synced to CloudKit. Why isn't the purchaser (App Store) user getting the data to their private cloud database? How can I test that everything works fine? Do I have to log out of my iCloud account to make this work?
Thank you for your time :)
Question 1: Using the App Receipt to restore non-renewable subscriptions
From Apple's Documentation:
Apple's documentation on whether an in-app purchase of a non-renewing subscription remains in the receipt has contradictory answers:
Yes (retrieved 2016-05-11):
Table 1-2 Comparison of subscription types
Subscription type Auto-renewable Non-renewing Free
Users can buy Multiple times Multiple times Once
Appears in the receipt Always Always Always
Synced across devices By the system By your app By the system
Restored By the system By your app By the system
No (retrieved 2016-05-11):
The in-app purchase receipt for a consumable product or non-renewing subscription is added to the receipt when the purchase is made. It is kept in the receipt until your app finishes that transaction. After that point, it is removed from the receipt the next time the receipt is updated—for example, when the user makes another purchase or if your app explicitly refreshes the receipt.
From Apple's Developer Forums:
In a thread reporting the temporary (now fixed) loss of non-renewable subscriptions from the app receipt, an Apple Developer Technical Support engineer said:
I've queried the iTunes Production Support engineer who made the change - The "fix" to provide the history of non-renewing subscriptions in the application receipt is permanent. My interpretation is that permament means that if we make a change, we'll announce the change at a Developer Conference and announce the function to be deprecated for a period of time.
With regards to using iCloud as a means to restore non-renewing subscriptions, I've heard from my App Review contact - an application "can use iCloud to track the non-renewing subscriptions (NRS) but it can’t force the user to login prior to making the purchase. It has to be optional - that can can alert the user that iCloud is required to access the NRS content from their other iOS devices - and providing a way to register later, if users wish to have access to this content at a later time."
Source: https://forums.developer.apple.com/thread/22345#79067
You could attempt refreshing the app receipt to restore the non-renewable subscriptions, but it has broken before, the documentation isn't clear, and there have been past reports of App Review rejecting applications that try this method.
Question 2:
CloudKit always uses the current iCloud account under Settings > iCloud.
App Store purchases use the Apple ID configured in Settings > iTunes & App Store.
The user may be signed into the same Apple ID for both iCloud & iTunes, but there is no guarantee. These are two entirely separate settings.

In-App Purchase and App Rejection iOS

I am new to In-App purchase feature in iOS.
I am working on an iOS app in which I'll be showcasing my products along with its price, and when the user wants to purchase a products he can do so by tapping on shopping cart, which will launch a web-view and displays my mobile webpage from where they can buy the selected product. My products are tangible and will be delivered outside the App.
My question is:
Do I need to implement In-App purchase, even if the user transaction is done in my mobile web-page?
If I have to implement Apple In-App purchase, how will I know if the user has purchased the product, so as to inform the Apple that a product has been purchased?
It really depends on the type of product you are selling. If it's a tangible good. i.e. a Plane ticket, or some other physical item. You can use your own payment mechanism. If it's something that can be consumed in the app, or could otherwise be conceivably delivered via Apple's IAP mechanism then you must use IAP. If you don't you will most likely be rejected.
To answer your questions. 1) If the transaction is done via the web, and is for a none-IAP type item as described above, then you cannot use IAP. 2) If you did have something that could be purchased via IAP, Apple is responsible for the transaction, and they take the typical 30% off the top.
Check out section 11 (specifically, 11.2 and 11.3) of the review guidelines
Apple will not allow you to direct the consumer to purchase something Within the app. Unless it is with an in app purchase.
The way we have gotten around this. is to let the user request information about it. or sign up an invoice. which will be delivered to their email address. and they can continue the purchase outside the app.
Apple has graciously accepted our app with this feature.
If you want them to provide a credit card number within the app, then you will need to use In app purchases instead.
Another way around this may be to have them sign up on your site and add a credit card for them to purchase with. And use that purchase method when the user buys something.
Not requiring them to put in their credit card on the app is I believe the main concern.

Check if an In-App Purchased has already been purchased iphone

I submitted an iPhone app to the store that got approved, but some things with the inApp purchasing weren't working. The consequence is that the users that tried to install the inApp purchases were charged, and Apple has recorded that they already purchased the additional feature. I have fixed the issue, and I use NSUserDefaults to track whether or not a user has purchased the feature. The problem is the users that have already paid for it. Is there a way to check through Apple whether or not the feature has already been paid for?
Thanks.
See the Restoring Transactions section of the In-App Purchase guide. Specifically:
Store Kit provides built-in functionality to restore transactions for
non-consumable products, auto-renewable subscriptions and free
subscriptions. To restore transactions, your application calls the
payment queue’s restoreCompletedTransactions method. The payment queue
sends a request to the App Store to restore the transctions. In
return, the App Store generates a new restore transaction for each
transaction that was previously completed.
If it is a consumable product (it shouldn't be) then I don't think there is a way to do it via Apple.

iphone in-app purchase subscriptions products

I am making an in-app purchase application for bulk of quizzes. I have all the information, graphics and data set of quizzes on my server. I want user to purchase quizzes with in-app purchase and want to transfer all the related content of purchased item from my server to application.
Now, apple is asking me to submit binary while adding in-app purchase item. Is this compulsory? For all kind of products (Consumable, Nonconsumable & Subscriptions)?
What if I want to manage the contents(graphics, database for that quiz product) of the product on my server not on itunes connect?
Help would be appreciated.
Thanks.
You don't have to submit binaries. In fact, it's not even possible. In-app purchases only have a product ID, a description and a price.
Also, be aware that you can't send new application code to the device via your web server. Only data can be sent.