You must enable keychain sharing to use AirWatch SDK for iOS (Swift) features. View some common issues with setting keychain sharing and their solutions.

Disabled Keychain Sharing

Symptom

The SDK cannot initialize because the keychain-saves cannot happen.

Fix

Enable keychain sharing by signing the application with the keychain access group.

Different AppIdentifierPrefix

Symptom

Applications in a keychain access group cannot share passcodes or data if they have different prefixes. The system treats the different prefixes as separate clusters.

Fix

Edit the prefixes for applicable applications on the Apple Developer portal. However, before you change prefixes, ensure you do not need the data stored with the older prefix. This older data is lost when the prefix changes.

Different Keychain Access Groups

Symptom

Applications with the same prefix cannot share passcodes or data if they are in different keychain access groups. The system treats the different groups as separate clusters.

Fix

Ensure that the applicable keychain access groups have enabled keychain sharing.

Merging applications from different groups that use the same account and service names can result in data collisions. Check for the listed situations to prevent collisions.

  • The kSecAttrAccessGroup attribute is one of the required attribute that can uniquely identify the item stored or retrieved from the keychain.
  • All other attributes, for example kSecAttrAccount and kSecAttrService, that uniquely identify the item stored and retrieved are the same.
  • The kSecAttrAccessGroup attribute is not specified in the actual query to store and retrieve from the keychain.

More Information

For information on how to sign the application for keychain sharing, see Keychain Access Group and Entitlements. For the procedure to enable keychain sharing for applications with the same prefix and keychain access groups, see Enable Keychain Sharing for SDK Applications.

See Apple documentation for more information on entitlements and keychains at the listed sites.