I replaced the MBS implementation of Keychain with the one from iOSKit. When I debug on my iPhone 12 Pro, then the code executes without throwing any error, but it is not saving anything to the keychain either.
Can we assume that in the MBS code that you replaced the bundle ID (kSecAttrService) with your app’s bundle ID?
If so, are you testing in a simulator or on a device (since that is so much easier in 2022r1)?
On that device/simulator, are you logged into an
Apple account?
NOTE: Just for clarity, I had an experience recently which reminded me why Apple suggests that you have a separate Apple ID just for testing where I accidentally but permanently deleted some personal data. Keychain is one of those areas that should cause you to do this.
No, just another AppleID for testing. They do not have to match your developer account. You would never be able to do large scale testing of an app if you couldn’t give it to beta testers if they all had to have your ID
It’s necessary because sometimes during testing you need to disconnect from the account, wipe the account, reset the account or try different configurations that would otherwise corrupt your personal acct. trust me, losing your entire keychain password list is very inconvenient.
Please check the “KeyChain test iOS” example project coming with our MBS Plugins.
You need to run it on device (not simulator). Your provision profile should include keychain entry.
And if you use kSecAttrAccessGroup, you need to specify the right security group as you do in the entitlement file for code signing.
and for the errors, please watch Console.app to see the detailed log messages for your application.
When you get an error reported in keychain, you usually find an error message in console.
The iOSKit KeychainServices does not require any entitlements. The MBS implementation is different and requires a provisioning profile change as Christian has noted.
Actually both should do the same/similar.
The question is whether you like to have the stuff in an access group, which can be shared by several applications.