Paid App : need to uniquely ID the user - iphone

I am designing a paying app that will require users to create their own profile.
This app will of course be downloadable on each of the devices the user has.
This is the precise scenario I want to bypass :
the user downloads the App on an iPhone
he creates an account and start using the app that makes server
calls
he downloads the app on his iPad and with his login & password
retreives the data on the server, so far so good
Now, he lends his iPad to a friend (who didn't pay for the app).
The friend wants to use the App, and wants to create his own
account. Yet, I want to forbide this since he didn't pay for the
App.
So my problem is : I want to restrict the use of the app only to the user that paid for the App, not for his friend.
Of course, I cannot use the AppleID since there is no way to reach it from code.
I thought one moment that I could use iCloud like mentioned here but since the ( iOS unique user identifier )user can choose not to use iCloud, my problem is not solved ...
Is there an easy solution that I missed to solve that issue?

You friend will be using different apple id. You could use Restoring Transactions api of apple to get understand whether the user has purchased the app or not. This is possible for non-consumable in app purchase. Please do check the below link :
https://developer.apple.com/library/mac/#documentation/NetworkingInternet/Conceptual/StoreKitGuide/MakingaPurchase/MakingaPurchase.html#//apple_ref/doc/uid/TP40008267-CH3-SW1

Related

Making the ios app in app store so that one apple id can install the app once [duplicate]

This question already has answers here:
Allowing only one download per Apple ID
(3 answers)
Closed 9 years ago.
Although it does not look like a technical question however it is, cause I want to make my app in the way that one apple id can download the app once and if he/she wants to re-download or re-install it, it will be prohibited from the app store or from the app itself in the device(Programatically).
The reason behind the same is to make one registration per apple id in the app so that I can choose the identical one from many.
Is it possible?
Thanks in advance.
Even if possible it would be against Apple's rules -- they insist that users can install each app on all of a users devices.
Only one download for each Apple Id
That's against Apple's software philosophy is that once you downloaded it, you can use, delete, redownload it.
An Idea
Add a non-consumable in-app purchase to your app. for registration. you can set this purchase to be free. That will grantee that an apple id will only register once. seems to be a good idea.
In the iTunes connect you can add in-app purchases to your app. (people will purchase from inside your app.) there are 3 types of purchases (products). A non-consumable product is only allowed to be purchased once per apple id. You also can set this purchase to be free.
You need to include the store kit in your project to handle store management.
Every time a user try to register will enter his/her apple id to purchase a registration. (you can call it registration key as a store name). apple store will send your app a receipt which you will validate to let the user register or you just tell him you already have an account with the following username and password. or you can let him reset his password.
This is not possible to do with the valid API's you are allowed to use for the store. You'd need to be jailbroken.
You can keep a record of the device on your own server and restrict functionality that way.

Interface to the AppStore?

I have a requirement that a client wants to be able to allow users to download apps from within an app (which I will call the main app), based on a user's score (when a user achieves a certain score, they can have an app). We would like to do this without linking to the app store directly, so that users of the main app can be granted access to another app.
So, is there a way to interface to the app store while hiding the official app store from the user? I have seen similar functionality in Passbook, but not exactly what we are looking for. Any ideas? Thanks! Viv
Possible duplicate
How to link to apps on the app store
If your app is in Apple appstore, you can use itms:// service to install apps directly. Check the above link that tells awesome stuff about the apple app store itms services.

how to know app was priviously install on ios device?

There is any way for identify that user is installing my app again? Actually in my app i have a feature user can translate some word for free but after that he have to pay. I am using in app purchase for same. But what if user delete app and install again ? he will be able to translate again for free.How to know app was previously install on that device?
Application goes to the App Store for in app purchases. If user has already bought that item, it returns true to your request. User won't pay it again each time.
Some implementations of in app purchases use the keychain to record purchase flags or freebie flags as you mention.
This blog entry will show you how to store and retrieve something from the keychain.
This approach really doesn't to my mind sit well with the principal of sandboxing an application so I expect it's frowned upon by Apple and by purists but if you search SO then you will find other posts relating to in app purchases and using the keychain.
See this answer as it seems to be pretty definitive on the subject.

How to identify user across devices on iOS?

I am working on an app where user will be buying some "credits" as in-app purchases and use them to buy some services inside the app. As user can has more then one device I need to identify him across different devices.
I understand I can create some logging (and store user accounts on my own server) but I would like to avoid this. In best case I would like to use Apple ID but I can't figure out how can I access Apple ID inside an app?
I found similar questions here but no satisfying answer. I do not believe there is no chance to access Apple ID from the app (I don't need password, just the id) as I found something like AVMetadataiTunesMetadataKeyAppleID in AVFoundation but this framework seems to be only for Mac OS X.
Any suggestion how to solve this?
Sorry. There's no way to do it without implementing your own authentication system on your own server. UDIDs are unique to each device and Apple does not give access to the iTunes user account whatsoever.
Other way is you can use facebook authentication in order to achieve that. Just connect you app with facebook api and u can keep their login address with some additional info.
Furthermore, it might be useful for your app if they can share your app with their facebook friends :p
You can identify user with help of GameKit.

Unique identifier for an iPhone app, NOT device

I want to avoid user registration in my app, and to identity my user by purchased app.
If someone purchase app on his iPhone, and with the same Apple ID download this app on other device, I want to use the same settings and content on this devices.
Is posible to use identifiers like AppleID (without entering in input field by user)?
I found similar question but UniqueIdentifier is unique only for physical device, not for user.
No. Apple does not give an app access to the user's Apple ID without the user's involvement. And for good reason.
I don't think you should outsmart the user. You can't assert that the user will want the same settings on another device. For instance I manage all my family iphones and download apps for them, all of them have their own accounts in apps and like different preferences. That's why it's the best to allow users to create accounts and sing in. This way user has a clear understanding what he/she is doing.