Flutter get unique device id iOs - ios

I am trying to make an application that when user logged in once, user will not log in again. In Android, i can get Android ID but in iOS, i cannot get anything unique. When user deletes the app, unique id changes. I tried to get identifierForVendor but it changes too. Is there a solution to get a uuid does not change when user deletes the app?

Related

Losing access to the keys stored on iOS Key Chain

We have an app on the iPhone App Store which needs to store the user id and password on the device for features like Touch ID and Remember Me.
Both user id and password are encrypted and the respective AES key is stored in the device key chain.
Now, the problem statement is : we are unable to retrieve the AES key from key chain every time we update the app from AppStore and also when user updates iOS on their device (eg : from iOS 9.1 to 9.2).
Since we are unable to retrieve the key, we are unable to decrypt the user id and password that results in failing a couple of key features every time user updates the app (eg : Remember Me and Touch ID).
This is becoming a huge concern since the issue continues until user totally uninstalls and reinstalls the app.. When user reinstalls the app, every thing works fine. We can enable Remember Me, Touch ID features and they are enabled fine and works fine.
What must be going wrong ?
In general keys in the keychain persist across update and even deletion and re-installs. So, there is something you are doing that is not correct. Please provide more information.
It is not necessary to encrypt the name and password, they can be stored directly in the keychain, the keychain encrypts it's contents.
Are you changing the Bundle ID when you update? If so have you made the keychain available to a group all the updates belong to?

Auto logout feature while using Parse in iOS

I'm creating login and registration page in iOS using Parse.com. Now if a user is logged in in one device than same user is logging in in different device than the first logged in device should get logged out.
How to achieve this thing in iOS objective C?
You could create a "logged in"-token for each device, based on device id. When you log in as a user, the current device id is stored in this field.
Then, every time your app is opened, it performs a check against this device id. If the stored device id does not match the current device id, you log out the user.

Retrieve the user's App Store nickname programmatically

Is anyone aware of a method to get the user's App Store nickname? I know about the CloudKit method fetchUserRecordIDWithCompletionHandler, but this returns the user first and last name, not the nickname that the user uses to e.g. write reviews on iTunes.
Thanks
Using fetchUserRecordIDWithCompletionHandler and discoverUserInfoWithUserRecordID is the only way to get information about the current iCloud user.
Besides that you do have to be aware that starting from iOS 9 you wont't get the first and last name anymore only a displayname. For more info see https://developer.apple.com/library/prerelease/ios/documentation/CloudKit/Reference/CKDiscoveredUserInfo_class/index.html#//apple_ref/swift/cl/c:objc(cs)CKDiscoveredUserInfo

How to uniquely identify users ios7+?

I want to know who the user is without them actually logging in. There are bunch of methods on the internet and the one I am currently using is:
static let DeviceId = UIDevice.currentDevice().identifierForVendor.UUIDString
The problem is this resets when the user deletes and reinstalls my app. Also somehow this value changes in about 1-5% of the users without them actually deleting the app. It happens after they upgraded to a new iOS version. Possibly happens when they change appstore country too.
I want the user id to be unique no matter whatever the user does. Kind of like how Whisper app works.
What is the best way to do this? Advertising identifier looks really good on paper, but does apple allow using that just for user login info?
Should I use keychain? icloud? Is there some other value I can use?
Here are some sources I read about this topc:
http://tinymission.com/post/ios-identifierforvendor-frequently-changing
http://possiblemobile.com/2013/04/unique-identifiers/
How to preserve identifierForVendor in ios after uninstalling ios app on device?

Delete user from server if they delete app

Is it possible to delete a user from a server if they delete your app from their phone?
I am using UUID to create users so they do not have to register but I do not want users to delete the app then rejoin and have a new uuid while the old one is still in the database.
Are there any alternatives to using UUID to avoid registering. Apparently UDID which would have been ideal has been deprecated for IOS 6 and upwards.
Please help, thanks in advance.
Alternatively,
You can create a service in App that ping server once a day. if any device didnt respond from long time then delete it from database.
You can't know if user deleted your app or not. So the method you mentioned is not possible.
One-way is, if you are using any advertisement in your app, you will get the advertisement identifier. It's unique for a device, so if user installs your app again, you will get the same advertisement identifier and you can identify the user. But I won't recommend this method, as I can sell my phone at anytime and the new owner can use your app. But he will be considered as old user in this scenario.
So my suggestion is keep a login for individual users. There are a lot of pitfalls in this approach also. You can't identify whether the app is deleted or not. Also same user can create multiple usernames and use it from same device.
You can save DeviceId into database associated with your user and then check if that device is already registered, delete old one and set new UUID. You can get DeviceId like following:
[[UIDevice currentDevice] identifierForVendor].UUIDString;
This will be the same for all your apps(on the appstore) but unique for device
I think that you can't catch delete event with your application.
Also, check this link as well:
Can I know when the user delete my app?
instead of catching a delete event what you can do is store the user info in your database, if the same user tries to join again throw a prompt indicating the user is already present and don't allow him to sign up

Resources