user16780334
user16780334

Reputation: 502

How to allow the user to use the application only for one device at a time in iOS?

I have been searching Google to find a answer to if it is possible to restrict users to login from one device at a time.

Suppose there is a mobile application (iOS application) which allows one user to login from one device at a time. How can this be achieved ?

To solve this problem, I think the first thing is to identify a device. Maybe by its Mac address, but I did not find any way to fetch the Mac address of a device from user request made from a the application as any identifiers which directly identifies the iOS Device is strictly prohibited by Apple Privacy Policy.

So for this I am trying to do the following things:

For creating custom UUID I am using the following code :

let uuid = NSUUID().UUIDString.lowercaseString
print(uuid)

I am saving this UUID to my keychain.

So while thinking to apply the above steps I came to a very serious concern

  1. Am I following the correct approach?
  2. If yes, for example what if an user A logs into the App then logs out , next User B logs in then will it send the same UUID to the server ?
  3. What will happen if the User A logs into the app then uninstalls it without logout and User B logs into it by re installing.

How to manage the UUID in the above scenarios? It would be really helpful if anyone could share some thoughts about possible solutions. Thanks!

Upvotes: 0

Views: 940

Answers (1)

saqib kafeel
saqib kafeel

Reputation: 306

you have to use the token approach and you have to manage it from the backend if is there any new login appear the previous token should expire and in app whenever the token expires it should move to the login screen, and to use UDID for this purpose it is completely illegal or maybe your app gets reject when you submit it to the app store thanks.

Upvotes: 1

Related Questions