Hi All,
I'm working on an app that mounts a network webdav location as a folder that users can access. The app is done and now I'm just working through my one Mac App Store hurdle. I got a rejection notice from the Mac App Store because I was mounting this location into the app's container folder.
What is the right location that I should mount this that would also abide by the sandboxing rules? I was thinking about maybe the downloads folder, but I am worried that people might accidentally delete it if it is inside that folder. If the downloads folder is the right answer, how do I retrieve it?
Any thoughts?
Thanks for your help!
Hi Chris,
Thanks for the example. After setting up a sample project I found my issue - App Sandboxing was killing the dialog. I needed an additional entitlement.
I have two feature requests if you can pass them along:
It would be really nice if Visual Studio for Mac would detect sandboxing violations when they occur and alert them to you. Perhaps even offering a fix. For example, when running my app, it would have been nice if the "Errors" pad said something like "Warning: Sandboxing violation at [....]. Are you missing the .... entitlement?"
It doesn't appear as though the NSOpenPanel maps the "isAccessoryViewDisclosed" property. This prevents me from showing the accessory view by default.
I agree that if we can (I'm not sure what we get back from the debugging side of the hose) we really should do better on sandbox/code signing crashes - https://bugzilla.xamarin.com/show_bug.cgi?id=54344
And you are correct on that NSOpenPanel selector. Unlike Xamarin.iOS, Xamarin.Mac doesn't have 100% API coverage yet. It's a goal we're working towards, and making steps every release though.
Until then, since the API was trivial, here's a monkey patch to add it that seems to work:
https://gist.github.com/chamons/0c3eca631f9cae8ec215240219177e41
Answers
Also, I've been doing some research and I've found that I might need to use app scoped security bookmarks. That's not my preference, but it may be necessary.
In my app, I have no main window (the app basically runs everything in the background), but I think I need to show an NSOpenPanel in order to allow users to select where they want the files stored.
I keep getting this error:
modal session requires modal window
when I run this code:
Ok, I think I understand the problem. The Modal Dialog APIs might strongly assume there is a window in view, and a message pump.
Here's a use from our samples: https://github.com/xamarin/mac-samples/blob/master/MacWindows/MacWindows/AppDelegate.cs#L51
When you say everything runs in the background, are you still running NSApplication.Main? Do you have a UI thread at all?
Hi Chris,
Thanks for the example. After setting up a sample project I found my issue - App Sandboxing was killing the dialog. I needed an additional entitlement.
I have two feature requests if you can pass them along:
It would be really nice if Visual Studio for Mac would detect sandboxing violations when they occur and alert them to you. Perhaps even offering a fix. For example, when running my app, it would have been nice if the "Errors" pad said something like "Warning: Sandboxing violation at [....]. Are you missing the .... entitlement?"
It doesn't appear as though the NSOpenPanel maps the "isAccessoryViewDisclosed" property. This prevents me from showing the accessory view by default.
I agree that if we can (I'm not sure what we get back from the debugging side of the hose) we really should do better on sandbox/code signing crashes - https://bugzilla.xamarin.com/show_bug.cgi?id=54344
And you are correct on that NSOpenPanel selector. Unlike Xamarin.iOS, Xamarin.Mac doesn't have 100% API coverage yet. It's a goal we're working towards, and making steps every release though.
Until then, since the API was trivial, here's a monkey patch to add it that seems to work:
https://gist.github.com/chamons/0c3eca631f9cae8ec215240219177e41