Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read on iOS fails silently and returns null instead of throwing platform exception. #519

Closed
janniklind opened this issue Feb 8, 2023 · 3 comments

Comments

@janniklind
Copy link

janniklind commented Feb 8, 2023

Hi.

I am investigating this plugin a bit, since I want to store an encryption key for the local database in my app.
It is crucial that this key is not lost, otherwise the data in the database will be lost.

I am performing a standard check like (pseudo code):

key = flutterSecureStorage.read('key');
if (key == null) {
  // On first app start.
  flutterSecureStorage.write('key', cipher.generateKey());
}
database.open(key)

However it seems from the following line in your code, that you ignore the status on the response and always just returns the value:
https://github.com/mogol/flutter_secure_storage/blob/develop/flutter_secure_storage/ios/Classes/SwiftFlutterSecureStoragePlugin.swift#L47

Do I understand correctly that is fails silently and instead returns null? That would be bad for the most usage of this plugin since you cannot count on what you get from the read method.

@gevork
Copy link

gevork commented Feb 14, 2023

I having the same problem.
Wait any solution

@BraveEvidence
Copy link

This will help https://www.youtube.com/watch?v=JogvnnaJ8TI

@juliansteenbakker
Copy link
Collaborator

I am closing all older issues. If this issue still exists in the latest version, please let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants