Swetha
Swetha

Reputation: 9

Unable to access Bluetooth and Local Storage Permissions in Maccatalyst Sandbox App MAUI

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.

Upvotes: 0

Views: 52

Answers (0)

Related Questions