Post

Replies

Boosts

Views

Activity

App Groups: How to use group. prefix and Team ID prefix for Multiplatform apps?
Hi there, I have a Multiplatform app with just one app target with an iPhone, iPad and Мас Destination. On the Mac my app is a developer singed App that is being distributed outside of the Mac App Store. I want to use App Groups, but as long as there are multiple destinations, Xcode only allows Group Identifiers starting with group.. However, for macOS I need to have a group ID that starts with the TeamID as explained here. So I created two separate entitlements, which are identical, but with different group IDs: With Automatic Code Signing enabled, I get this warning: Xcode still seems thinks it has to use the macOS Group ID for the iOS version. In the App Groups section, the mac Group ID is red and the iOS Group ID is not checked. The app builds and runs without issues on all platforms. The App Store Connect validation (for the iOS version) also works without any errors. Am I doing something wrong? Do I need a separate Mac target because Xcode does not support separate Group IDs for Multiplatform apps?
2
1
151
2w
Installing a command line tool from my sandboxed Mac app
Hi there,I'd like to ship an optional command line tool along with my sandboxed Mac app which I distribute through the Mac App Store and on my Website.The user can chose to install the command line tool from within the host app to/usr/local/bin/CommandLineToolI do this by creating a symlink at that location that links to the command line tool in my app's bundle:FileManager.default.createSymbolicLink(at: self.commandLineToolInstallationURL, withDestinationURL:self.commandLineToolURL)For this to work in a sandboxed app I have to use NSWorkspaceAuthorization and request an authorization of the type NSWorkspaceAuthorizationTypeCreateSymbolicLink.Here is my final code:NSWorkspace.shared.requestAuthorization(to: .createSymbolicLink) { authorization, authorizationError in if let error = authorizationError { DispatchQueue.main.async { self.presentError(error) } } else { guard authorization != nil else { NSLog("WARNING: #4ibfzwD8Ds") return } do { try FileManager(authorization: authorization!).createSymbolicLink(at: self.commandLineToolInstallationURL, withDestinationURL: self.commandLineToolURL) } catch { NSLog("WARNING: #argfgg - \(error)") DispatchQueue.main.async { self.presentError(error) } } } }I also had to request a Privileged File Operations entitlement here, which I did. I was then able to generate new Provisioning Profiles using that entitlement with my Developer certificate and the Distribution Certificate for the Mac App Store. But when I try to generate a new Provisioning Profile for my developer ID signed version of the app, the Additional Entitlements section, which lets you add the Privileged File Operations entitlemen, does not show up. Thus I cannot create a profile that works and the app I a distributing outside of the Mac App Store will crash upon launch.Looking at the NSWorkspace.Authorization documentation, it seems that the Privileged File Operations entitlement is only available for apps on the Mac App Store and would therefore not be available for Developer ID signed apps distributed outside the Mac App Store.What is the right way to install my command line tool (or a symbolic link) to /usr/local/bin from my sandboxed app that is signed with my Developer ID certificate?It has to be possible since apps like BBEdit do it as well. Looking at BBEdit it seems they use FileManager.default.createSymbolicLink but how if NSWorkspace.Authorization does not work outside of the Mac App Store... ?Thanks for your help!!
4
0
1.1k
Mar ’20