I am looking for a solution to get the external path for the IOS platform to store some authentication files which should not be deleted even though my application is being uninstalled. Is there any way to achieve this with the solution I am looking for or any other technique could be used. All suggestions are welcomed, Thanks for help.
Asked
Active
Viewed 720 times
1
-
what kind of authentication you use?\ – Darish Feb 27 '20 at 08:46
-
I am generating an application Key and storing it in a .device file – Yogesh Chawla Feb 27 '20 at 08:51
-
did you try the path_provider package – Darish Feb 27 '20 at 08:56
-
yeah, but it only provides Application Directory path which is deleted while uninstalling the application – Yogesh Chawla Feb 27 '20 at 08:57
-
You cannot access the filesystem outside of the application sandbox. You could store data in the keychain; that will persist across application delete/re-inistall – Paulw11 Feb 27 '20 at 09:46
-
@Paulw11 can you provide some sort of example, I don't know how to store data in keychain – Yogesh Chawla Feb 27 '20 at 09:49
-
@YogeshChawla see my answer below. Use [flutter_secure_storage](https://pub.dev/packages/flutter_secure_storage) to store files securely. – om-ha Feb 27 '20 at 10:01
-
1@om-ha Will values stored in Keychain and KeyStore survive app uninstallation ? – Yogesh Chawla Feb 27 '20 at 10:08
-
@YogeshChawla They should for KeyChain but this is not encouraged and not future-proof. They definitely don't for Keystore. Updated my answer below. – om-ha Feb 27 '20 at 11:11
1 Answers
0
Storing Authentication Files Securely
For storing files, if you were to store authentication files then you'd have to do so in a secure manner. i.e. KeyChain on iOS and KeyStore on Android. flutter_secure_storage pub encapsulates this for you.
Persisting information and surviving app uninstallation
As per your second point, your stored authentication files cannot survive uninstallation. You have to use DeviceCheck for iOS and SafetyNet for Android. Which offers storing bare minimum information (two bits on iOS!) and associating them with the device.
KeyChain may support this for now, but this is not guaranteed to be future-proof. KeyStore certainly does not support this.
You can also check out the following articles for more insights:

om-ha
- 3,102
- 24
- 37