I am trying to install a mobileconfig file to enable guided access mode programmatically from my application. I have created the profile using Apple configurator 2 by adding the key "autonomousSingleAppModePermittedAppIDs" manually.
<key>autonomousSingleAppModePermittedAppIDs</key>
<array>
<string>com.apple.ist.GuidedAccessTest</string>
</array>
However when I try to install this profile I get an error saying "Profile Failed to Install [MCInstallationErrorDomain – 0xFA1 (4001)]".
Replacing "autonomousSingleAppModePermittedAppIDs" with any other keys such as "blacklistedAppBundleIDs" or "whitelistedAppBundleIDs" which are also an array of strings in restrictions payload works just fine and I could install the profile.
Any pointers as to what I'm missing here? Much appreciated if anyone can point me to a sample mobileconfig file for enabling guided access.