Open andymedvedev opened 7 years ago
To solve your issue, we might need to see your code. All I can say right now, is that you probably incorrectly spelt forUserAccount:
, causing the dictionary not to be found.
@andertsk
When you trying to get value from Keychain in your extension, you have to do this way:
let value = Locksmith.loadDataForUserAccount(userAccount: "user_account", inService: "__YOUR__APP_BUNDLE_ID____")
Usually you have different bundle ID for app and extension. For example:
Application bundle id: com.mywebsite.myapp Extension bundle id: com.mywebsite.myapp.extension
If you try to get value without passing inService value. Like that:
let value = Locksmith.loadDataForUserAccount(userAccount: "user_account")
Locksmith will not return value, because it will use Bundle ID of the Extension. But your value has been saved under your app bundle id.
You also need to make sure, you are enable keychain share under Project -> Capabilities for app and extension target. And they both use the same group.
@shuhrat10 thanks! You solve my problem!
I have created Action extension for the app. In app i set the field and then i want to retrieve them in extension but its failed (dictionary not found).