About In-App purchase between devices and apps - ios

I want to share a question about In-App Purchases
I have some maps applications where I'm trying to add In-App Purchases to let user buy different map layers to show in the application. I want to let users buy the In-App Purchases in the same app to get new map layers, and I want to show other layers that they buy in another application from us too. And I want to show all the IAP that user purchased in different devices.
The way I want to do this is using a Server Product Model, where an app will send some information to our server when the user buy a IAP. When we want to get the user IAP purchased for show all the IAPs that user have, I request the info to our server to know if there are another purchases for this user in other apps of us and if it is, we will show another extra layers in the map.
The problem I have is that seems that is not possible to get the user account because is private data, and we need to get this information for some reasons:
To detect if the same user is connected in another device because we can show all the IAP the user purchase in some device
To detect if a user using an application has yet another IAP purchased in another application of us, to let him see the map layer in this application too
I know that Apple let you get the identifier "identifierForVendor", that let you know if the same device is using an app of ours. But my problem is I don't know how to detect if the user install our app in another device, how can I detect if the user has some IAP purchased to talk to our server and show the IAP the user purchased in this app or another app.
There is no way to get some user identifier to do this communication?
Any help will be welcome :) Thanks for your time

Related

Allow iOS In-app purchases to be bought only in the app

Depending on certain parameters, we want to offer our users a different subscription in app product to be bought in our app. This basically works very well as our app can control which of the available in app products will be shown to the user. However on the app store page of our app the user can freely choose to subscripe to whatever in app product he wants. Is there any way to disable this (so that users can only buy through our app and not in the app store)? If not, how else could we handle this scenario?

How to implement InApp Purchase iOS for this Pay per view type of app?

I am working on an app that serves new movies every week and users have to buy a movie to be able to watch it. Once an user purchases a movie they can watch it any number of times. We have our own user registration and login system. I want to know do i have to create an In App Product on the iTunes Connect For every movie? We don't want to restore purchases to the different users using same apple id as well, will Apple allow that? I am really confused guys, I'd really appreciate some ideas.

iOS - Subscription payment based on phone number or promo code

We plan to implement all the subscription server-side services. Here is the flow for our client iOS app:
The registered user enters phone number, we check if the number is valid and if it is, the user can subscribe and thus use some features of the app that an user without an active subscription can't. The subscription is not free and it doesn't go via AppStore; the user is charged at the side of his/her provider, based on his/her phone number. The user isn't asked to give any of his/her credit card data. One of the features that gets unlocked when user subscribes is the possibility to download digital content.
The question is: would Apple approve this flow? I know for subscriptions as in-app purchase types, but the plan is to have something different in our iOS app.
And what about promo codes? Is it possible for vip users to use our promo codes in order to subscribe..?
Apple will not approve any purchases that get added to an iOS device, are initiated on the iOS device, and don't go through the app store. You can do purchases through your web site; in that case you will have to avoid links to your website from the app.
On the other hand, physical purchases must not go through the app store. So if you have an app for buying hand bags, you can not get payments through the app store.
Apple will also give you a very hard time if you ask users for their personal information, like their phone number, and if there are features they can't get without giving you such information.

How to get some user Information when user buy some items on Apple In app purchase by swift?

I am working an app that has In app purchase function.
And i need some unique user information when they make some purchases in order to store it on my Database for some reason.
So how can i get some info like email,username or userId from the purchased user?
Thanks!
You cannot obtain this information from the Apple purchase flow, so the answer depends on what you are trying to accomplish.
If you are selling a non-consumable item, such as a game unlock, Deepak's solution will work for you -- by providing a "restore" button in you application the user will be able to connect to their iTunes account from any of their devices and re-obtain the item.
If you are selling a consumable item, such as in-game currency, you should have the users register with your backend service and be authenticated when they make their purchase. Once you have verified the purchase you can write it to your database and you will be responsible for restoring their state regardless of the device they log in on.
Note that if you combine these approaches it would be possible, though unlikely, that a user could share a non-consumable purchase by using the same iTunes account but different accounts on your system by performing a Apple restore action. If you are managing your own inventory on a server, I recommend using consumables.
So the short answer is, if you want that information, you have to ask for it from the user.
[Answer is valid if you have users registered with your system]The transactions can be restored based on user who has logged into your system ,please refer to link here then you can map the information from your system to the product you are selling via in-app purchase.

Can Apple tell me what purchases a user has?

I'm aware of the restore functionality and have implemented it in my apps before, but still has holes in it.
I'm trying to display customized screens based on what apps the user have. Without user interaction, I want to be able to ask apple to retrieve me the in-app purchases that belong to that user for this app?
Other posts mention that I should always keep track of that via calling methods like:
NSUserDefaults.StandardUserDefaults.BoolForKey
But at the same time considers it insecure.
I am currently storing the info in DB. That's easy, but consider the following scenario:
User downloads the app. My DB records that user has 0 in-app purchases. The user later purchases 1 in-app purchase. My DB records that too.
User deletes the app for whatever reason
After a while, he re-downloads the app. My DB at this point starts a fresh and records that the user 0 purchases.
the user sees the in-app purchase (he already bought) and clicks on purchase again.
Here, my execution flow stops and apple picks up... Apple alerts the user that he has already bought the in-app and offers to get it for free.
That message is for the benefit for the user only, and my app is unaware of that. I haven't been able to find a call to apple asking what purchases a user had made for my app? I too, wouldn't want the user to pay again, but be able to always know what purchases he has made in the past at any given point. Why is that information so sealed at apple side? They alrady know the user has may app and I am only asking about in-app purchases in that app.
I am using Xamarin.
You need to refresh the receipt file and then scan through it. It will list all purchases the user has made inside that app, whatever device it was on. This code will let you parse the file and see the purchases made: https://github.com/rmaddy/VerifyStoreReceiptiOS
You could simply make your database store account information the user creates when they want to purchase something from your in-app extras. So in order to make that purchase they have to create a username and password for your app, thus giving you a way to keep track of who owns what in app content without having to ask apple.

Resources