I'm building an action extension for my iOS app. However, I'm having some real difficulties with handling user data. In my app I'm storing the user's username and password like this:
KeychainItemWrapper *keychainItem = [[KeychainItemWrapper alloc] initWithIdentifier:@"testapp" accessGroup:nil];
[keychainItem setObject:[self.txtUsername text] forKey:(__bridge id)(kSecAttrAccount)];
[keychainItem setObject:[self.txtPassword text] forKey:(__bridge id)(kSecValueData)];
NSString *valueToSave = @"Remembermebycredentials";
[[NSUserDefaults standardUserDefaults] setObject:valueToSave forKey:@"RememberMe"];
[[NSUserDefaults standardUserDefaults] synchronize];
How can I access this from my action extension? I tried retrieving it with the same identifier and creating a shared container, but that didn't work...