jeroentrappers / flutter_keychain

A flutter plugin for secure storage on Android via KeyStore and iOS via Keychain
Other
56 stars 41 forks source link

Read from keychain in iOS project #13

Closed hx28939 closed 4 years ago

hx28939 commented 4 years ago

Hello! I made a package with flutter and imported it into swift project. In my swift project, I can read data stored by flutter_keychain in flutter part. However, in flutter package, I can't read data from swift keychain. I tried other keychain package such as flutter_secure_storage. I got the same result. What's more, in flutter project, I can't use flutter_secure_storage to read data stored by flutter_keychain. Is there any way I can do to read data stored in swift project? Thanks a lot.

jeroentrappers commented 4 years ago

These projects use different identifiers to prefix their keys. This is by design. Please look into the implementation details.

Check line 40 of FlutterKeychainPlugin.m -> The service name is used as query parameter.

ryanboerner commented 4 years ago

I am running into the same problem. Is there a workaround to be able to share keychain info between an iOS app and a Flutter app on the same device?

jeroentrappers commented 4 years ago

I am running into the same problem. Is there a workaround to be able to share keychain info between an iOS app and a Flutter app on the same device?

for that you need to setup keychain sharing. You can find more info here: https://medium.com/@anshuraguvansi/keychain-sharing-between-applications-on-ios-af1931468e26