简体   繁体   中英

How can I get uniqe id for ios device that would not change

I want to allow user to be logged in into app based on devices only. Like if user have username and password and he logged in with one device then he could not log into another device unless Admin's permission.

I can go with following things but that is also not usefull in my case,

  1. Vendor IDs :

Erased with removal of the last app for that Team ID.

  1. Advertising IDs :

That is unique to the device but Reset with “Erase All Content & Settings”. Also apple would reject it if I am not using iAd.

  1. Keychain :

I can use keychain to store device Id like password but that will also change once the provisioning profile get changed.

Note: I want user's to be access the app only for the device which admin has given permission. Like once user logged in with one device for next time onward he/she should not logged in with another device without Admin's permission.

This might be the solution: storing UUID in keychain. sent it in login API param. check bellow: considering there is no registration process. if yes then it will be too easy. just add one more param with registration API for UUID. and sent it in every login API with other params for valid login. on error basis you can show respective error msg admin permission required or not etc.... --- first time login: API param (username, password, uuid) ,, uuid - will be empty for first login, API will allow login, for empty uuid for that user. IMP but only when there is no uuid for that user at server. after successful login, hit another API which with param uuid for that user. also store uuid at keychain so for next login you will have uuid value.-- if user wants to login on other device then for first attempt s/he will send empty uuid but server will not allow login though its empty uuid but it has uuid value for that user. so you can notify admin with this situation. Check this iOS unique user identifier

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM