I have two iOS applications (app "A" and app "B"), and I need to offer the user the posibility to access to app "B" with the login data stored in app "A" if the user is already loggued in app "A".
What I've done is to use the SSKeyChain library to store the login data of app "A" in the keychain. Something like this:
[SSKeychain setPassword:password forService:@"appA" account:username error:&error];
And then in App "B" I am retrieving this data in this way:
NSError *error;
NSArray *accounts = [SSKeychain accountsForService:@"appA" error:&error];
if (accounts.count > 0)
{
// alert to the user
}
This is working perfect on the simulator, but this not working on my iPhone.
I already also added this line to my didFinishLaunchingWithOptions method:
[SSKeychain setAccessibilityType:kSecAttrAccessibleAlways];
Am I missing something?
Check out this tutorial
Looks like SSKeychain doesn't support access groups link
Probably you can try to use SGKeychain