macOS Entitlements for Removable Media - macos

When sandboxing an app for the macOS app store, is it possible to allow for read/write access to removable media (SD Cards specifically)? So far, I've haven't been able to find an entitlement that would work. The Windows Store does have an entitlement for removable media so I'm hoping I'm just missing something on the Apple side.
Here is the current entitlements content:
Our current Entitlements file has this set for the dictionary:
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
<key>com.apple.security.device.usb</key>
<true/>
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
<key>com.apple.security.files.downloads.read-write</key>
<true/>
</dict>
Here is the exception being thrown:

Related

How to force portrait orientation in NativeScript 8.x for iOS and Android

There are a few community plugins that made for this, but none of them support NativeScript 8.x. They utilize "tns-core-modules" rather than "#nativescript/core". I've only found one paid plugin that supports NativeScript 8.x.
Is there truly no way to force portrait orientation natively in NativeScript? If not, it seems like a major oversight for a framework dedicated to making mobile apps.
You will have to update your AndroidManifest.xml & Info.plist in your App_Resources.
AndroidManifest.xml
Set screenOrientation to portrait on your main activity
<activity android:name="com.tns.NativeScriptActivity"
...
android:screenOrientation="portrait">
Info.plist
Keep only the portrait orientation, remove rest from UISupportedInterfaceOrientations.
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
Note: Make sure you run a clean build after these changes.

Application's iCloud drive folder doesn't show in macOS

I have an app that needs to store video files in it's own container folder in iCloud Drive. I have tried suggestions from most forums and I still couldn't resolve this issue.
These are the things I did to setup a cloud container for my app -
Added iCloud capability. Selected 'iCloud Documents' for Services and selected the appropriate iCloud container that I had created through my developer account.
Added the following entry in Info.plist
<key>NSUbiquitousContainers</key>
<dict>
<key>iCloud.com.TeamName.AppName</key>
<dict>
<key>NSUbiquitousContainerIsDocumentScopePublic</key>
<true/>
<key>NSUbiquitousContainerName</key>
<string>AppName</string>
<key>NSUbiquitousContainerSupportedFolderLevels</key>
<string>Any</string>
</dict>
</dict>
These are the values in the entitlement file
<key>com.apple.developer.icloud-container-identifiers</key>
<array>
<string>iCloud.com.TeamName.AppName</string>
</array>
<key>com.apple.developer.icloud-services</key>
<array>
<string>CloudDocuments</string>
</array>
<key>com.apple.developer.ubiquity-container-identifiers</key>
<array>
<string>iCloud.com.TeamName.AppName</string>
</array>
Have tried with new bundle identifiers and cloud containers.
Have tried updating the Version and the Build value
The app folder is created at '/Users/{user}/Library/Mobile\ Documents/iCloud~com~TeamName~AppName/Documents' and I can see the files I've written to it.
I can find these files at iCloud -> Manage Storage -> AppName on my iPhone too.
Will 'NSUbiquitousContainerIsDocumentScopePublic' be accepted as true only when an app is released on the Appstore? Or it's just that I'm missing something here?
Same here, I followed every tip I could find here and on other websites, but still the folder / files are not showing up visibly.
Problem: ubiquitous container works, files can be read and written, but are not showing up in macOS Finder, nor in the Files app on iOS devices.
macOS 11.5, iOS 14.7, Xcode 12.5.1
I have tried:
everything stated here: https://developer.apple.com/library/archive/documentation/General/Conceptual/ExtensibilityPG/FileProvider.html
everything stated here: https://developer.apple.com/library/archive/qa/qa1893/_index.html
every variation of info.plist values for NSUbiquitousContainers (eg. both the container id and my bundle id)
every variation of info.plist values for NSUbiquitousContainerIsDocumentScopePublic
every variation of info.plist values for NSUbiquitousContainerName
every variation of info.plist values for NSUbiquitousContainerSupportedFolderLevels
creating new containers
changing the apps' version and build numbers, including only increasing CFBundleShortVersionString.
changing the apps' bundle identifier
deleting and reinstalling the app
reboots of used devices
switching off/on iCloud drive for the user on all devices
It is driving me crazy. Who can help?

NSAppleScript sandbox entitlement for Numbers

I'm needing to read from a Numbers spreadsheet in an App Store Sandboxed Mac app.
I have it working fine until I enable the Sandbox.
Apples docs say to use the com.apple.security.scripting-targets entitlement however I cannot find any entitlements for Numbers.
I can get it working using
<key>com.apple.security.temporary-exception.apple-events</key>
<array>
<string>com.apple.iWork.Numberss</string>
</array>
but I was reading that App Review will reject apps using the temporary-exception.
Is this a complete non starter, am I missing a way to get the entitlement to work with Numbers or will App Review allow it through with the temporary-exception?

Can't deploy to iPad when I add iCloud entitlement

Using Xcode and Visual Studio for Mac:
In Xcode, I can make, deploy and run an out-of-the-box HelloWorld app to my provisioned iPad.
Also in Xcode, I can add iCloud to the same app (via entitlements), and it deploys and runs on my iPad.
In VS for Mac, I can make and deploy a blank Xamarin Forms HelloWorld app and it runs on my iPad.
However, if I add iCloud to the entitlements.plist for the Xamarin forms app, it won't deploy to my iPad.
I get the following for #4:
ApplicationVerificationFailed: Failed to verify code signature of /private/var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.tlZMLz/extracted/HelloWorldV.iOS.app : 0xe8008016 (The executable was signed with invalid entitlements.)
error MT1006: Could not install the application '/Users/Huber/Projects/HelloWorldV/iOS/bin/iPhone/Debug/device-builds/ipad5.3-11.1.1/HelloWorldV.iOS.app' on the device 'Denny's iPad': Your code signing/provisioning profiles are not correctly configured. Probably you have an entitlement not supported by your current provisioning profile, or your device is not part of the current provisioning profile. Please check the iOS Device Log for details (error: 0xe8008016).
Application could not be uploaded to the device.
The entitlements.plist file that Xamarin generates is:
<?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.developer.icloud-container-identifiers</key>
<array>
<string>iCloud.com.DennyHuber.HelloWorldV</string>
</array>
<key>com.apple.developer.ubiquity-kvstore-identifier</key>
<string>$(AppIdentifierPrefix)$(CFBundleIdentifier)</string>
<key>com.apple.developer.icloud-services</key>
<array>
<string>CloudDocuments</string>
</array>
</dict>
</plist>
I have Key-Value Storage and iCloud Documents both checked.
Can anyone help?
Thanks,
Denny Huber
You need to go to developer.apple.com and regenerate provisioning profile with new entitlements. After that, I advise you to manually delete all provisions, because sometimes it still tries to sign with an old one.
The provisions located in ~/Library/MobileDevice/Provisioning Profiles
After that go to Xcode, Setting -> Accounts -> Select your program, and press Download Manual Profiles.
After that clean the project and try to build again.

Invalid Mac App Store Validation using iCloud Entitlements

I've been trying to simply validate an app for the Mac App Store. I was able to submit the iOS version without a hitch.
At this point in time i've configure the App ID in the dev portal to a unique iCloud identifier, so that eliminates the possibility that this is a shared ICID problem (iCloud ID).
I've recreated certificates, App ID, iCloud container, and distribution provisioning profiles.
*After days of troubleshooting, i've narrowed the issue down. If I assign the iCloud container to the App ID, validation fails. If I un-assign it, validation passes.
I have opened several tickets with Apple over the course of the week, but I haven't had a response so i'm hoping SO can help.
The errors reported by the validation tool:
My App ID: com.proj-build.cocoa-notes
My iCloud Container ID: iCloud.com.proj-build.cocoa-notes
The prefixed iCloud in the iCloud Container ID confuses me. My iOS app does not specify the prefix in the entitlements file (using a different container ID) and it was validated. Prefix or no prefix on Mac does not work.
Any ideas what I could be doing wrong?
Entitlements configuration below
<?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.developer.ubiquity-container-identifiers</key>
<array>
<string>$(TeamIdentifierPrefix)com.proj-build.cocoa-notes</string>
</array>
<key>com.apple.developer.ubiquity-kvstore-identifier</key>
<string>$(TeamIdentifierPrefix)$(CFBundleIdentifier)</string>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.files.bookmarks.app-scope</key>
<true/>
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
<key>com.apple.security.print</key>
<true/>
</dict>
</plist>
It looks like your app ID and provisioning profile are misconfigured. The iCloud containers (those that match iCloud.*) are a Mac OS X 10.10 Yosemite feature. You'll need to log in to the developer center and remove that, but keep the 10.9 (and previous) iCloud entitlement. Then regenerate the provisioning profile and use the new one.

Resources