0

I cannot access any permissions, especially Bluetooth, and local data in the MacCatalyst app when App Sandbox is enabled in MAUI. The popup asking for permissions is not displaying even though I have set all permissions in Info.plist and Entitlements.plist as below

Note:When I disable Sandbox everything works fine.But I need to enable sandbox in order to work with secure storage

Entitlement.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>com.apple.security.app-sandbox</key>
    <true/>
    <key>com.apple.security.network.client</key>
    <true/>
    <key>com.apple.security.bluetooth</key>
    <true/>
    <key>com.apple.security.files.user-selected.read-write</key>
    <true/>
    <key>com.apple.security.files.bookmarks.app-scope</key>
    <true/>
    <key>keychain-access-groups</key>
    <array>
        <string>$(AppIdentifierPrefix)com.mycompany.myapp</string>
    </array>
</dict>
</plist>

Info.Plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>UIDeviceFamily</key>
    <array>
        <integer>2</integer>
    </array>
    <key>UIRequiredDeviceCapabilities</key>
    <array>
        <string>bluetooth-le</string>
    </array>
    <key>XSAppIconAssets</key>
    <string>Assets.xcassets/ic_launcher.appiconset</string>
    <key>CFBundleName</key>
    <string>my App Name</string>
    <key>CFBundleDevelopmentRegion</key>
    <string>en</string>
    <key>UIBackgroundModes</key>
    <array>
        <string>location</string>
        <string>bluetooth-central</string>
        <string>remote-notification</string>
    </array>
    <key>UIFileSharingEnabled</key>
    <true/>
    <key>LSSupportsOpeningDocumentsInPlace</key>
    <false/>
    <key>NSBluetoothAlwaysUsageDescription</key>
    <string>My app requires Bluetooth Permissions .</string>
    <key>NSLocationWhenInUseUsageDescription</key>
    <string>If enabled, my App uses location services to store the geo-coordinates of the logger at the time of configuration.</string>
    <key>UIViewControllerBasedStatusBarAppearance</key>
    <false/>
    <key>ITSAppUsesNonExemptEncryption</key>
    <true/>
    <key>CFBundleURLTypes</key>
    <array>
        <dict>
            <key>CFBundleURLName</key>
            <string>my app</string>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>url</string>
            </array>
            <key>CFBundleTypeRole</key>
            <string>Editor</string>
        </dict>
    </array>
    <key>CFBundleIdentifier</key>
    <string>com.mycompany.myapp</string>
    <key>NSDocumentsFolderUsageDescription</key>
    <string>My app  requires access to the Documents folder </string>
</dict>
</plist>

.Net MAUI version:9.0.10 .NET9.

4
  • Have you followed the doc iOS capabilities to add ios capabilities? Commented Jan 29 at 9:20
  • @LiqunShen-MSFT I have add all required capabilities mentioned in documentation but still no use Commented Jan 30 at 7:10
  • Does it help? Bluetooth permission is asked by the terminal instead of the app on MacOS. Commented Jan 31 at 8:14
  • @LiqunShen-MSFT thanks for providing the link. it worked after adding this line in entitlement list. '<key>com.apple.security.network.server</key> <true/>' Commented Feb 4 at 14:10

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.