Posts

Post not yet marked as solved
3 Replies
1k Views
Every day at work, I need to search for some technical question about programming for Apple platforms.I search on Google. I see 5 results on Stack Overflow. I see 5 results from the Apple Developer Forums.I open all the results in new tabs.Stack Overflow results work fine! The pages load.Apple Developer Forum links result in an error and do not load.> We're sorry. > We're having a problem processing your login. > Return to Apple Developer Forums.Image: https://i.imgur.com/yIxk5Kc.pngURL shown in the address bar for the error: https://forums.developer.apple.com/sso-error!home.jspa?errorKey=apple.sso.plugin.validation.error&statusCode=19This is EXTREMELY ANNOYING. It's not a private forum! If my login fails, just show me the non-logged-in view of the page.There is not even a link to the page, or a hint at the title of the page. I have no idea what the page was about. I have to return to the google results page and re-click-through. I have usually closed the Google SERP by this point, and have no idea how to get a link back to the ADF page.On the second click-through to ADF of the day, the login issue has apparently been reset and the page loads fine. This happens EVERY DAY on the first link to ADF.Please fix this so that a failed login does not completely obliterate the page I was trying to open.Also filed as rdar://45231929
Posted
by pkamb.
Last updated
.
Post not yet marked as solved
1 Replies
683 Views
For better or for worse, many sandboxed apps ask for "/" access via an Open Panel, and then save a Sandbox Bookmark to that location. They are then able to work freely in the File System (for the user's benefit). This is accepted sandbox behavior by App Review.Catalina adds a new "Full Disk Access" permission to System Preferences.At WWDC and in the betas, I believe that this new permission was added to grant access to "SIP-like" private files in the filesystem (such as the Mail database, iMessages, etc.) that even apps with "/" access should not have access to.Two questions:1. Does adding Full Disk Access grant access, as if you had a Sandbox Bookmark? Or is it that *IF* you have an existing Sandbox Bookmark, you can additionally access the SIP-like files?2. Assuming that it does grant access, can a tutorial for the user to enable Full Disk Access be used as an ALTERNATIVE to the (error-prone and unintuitive) granting of "/" sandbox access via an Open Panel? Are there any App Store Guidelines or real-world Reviews that show that this can or can't be used in the App Store?
Posted
by pkamb.
Last updated
.
Post not yet marked as solved
2 Replies
1k Views
NSWorkspace has the method `open(_:withAppBundleIdentifier: [...] )`:> Opens one or more files from an array of URLs. func open(_ urls: [URL], withAppBundleIdentifier bundleIdentifier: String?, options: NSWorkspace.LaunchOptions = [], additionalEventParamDescriptor descriptor: NSAppleEventDescriptor?, launchIdentifiers identifiers:) -> Bool---The NSApplicationDelegate *of the app you want to open* has corresponding methods that are called to open the URL(s) you provide: func application(_ sender: NSApplication, openFile filename: String) -> Bool func application(_ sender: NSApplication, openFiles filenames: [String])---Back to `open(_:withAppBundleIdentifier: [...])`, that method has an NSAppleEventDescriptor parameter:> **`additionalEventParamDescriptor descriptor: NSAppleEventDescriptor?`**> Additional options specified in an AppleEvent-style descriptor. For example, you could use this parameter to specify additional documents to open when the app is launched.---###I would like to send additional information to the app that will open the files.This would be used similarly to the `userInfo` dictionary on a notification.I've constructed a `NSAppleEventDescriptor` object to represent this information. I can set this event descriptor in the NSWorkspace `open( ... )` function.But how do I **receive** this event descriptor in Application Delegate of the target app?The `application(_: openFile:)` functions have no parameters for the event descriptors or any other "`userInfo`"-type additional information.---## CodeBased on answers and other questions, I settled on the solution below. I am now getting a triggered handler for Apple Events. But the Apple Event that I am setting on the NSWorkspace function is not the one that is received in the handler! How do I get **my** Apple Event instead?---## Sendlet appleEvent = NSAppleEventDescriptor(eventClass: AEEventClass(kCoreEventClass), eventID: AEEventID(kAEOpenDocuments), targetDescriptor: nil, returnID: AEReturnID(kAutoGenerateReturnID), transactionID: AETransactionID(kAnyTransactionID)) appleEvent.setDescriptor(NSAppleEventDescriptor(string: "THIS IS A TEST"), forKeyword: AEKeyword(keyDirectObject)) let didOpen = AppKit.NSWorkspace.shared.open([URL(fileURLWithPath: "/path/image.png")], withAppBundleIdentifier: bundleID, options: [.withErrorPresentation], additionalEventParamDescriptor: appleEvent, launchIdentifiers: nil)### Sent Apple Event:> `<nsappleeventdescriptor: 'aevt'\'odoc'{="" '----':'utxt'("this="" is="" a="" test")="" }="">`---## Receiveclass AppDelegate: NSObject, NSApplicationDelegate { func applicationDidFinishLaunching(_ aNotification: Notification) { NSAppleEventManager.shared().setEventHandler(self, andSelector: #selector(handle(event:replyEvent:)), forEventClass: AEEventClass(kCoreEventClass), andEventID: AEEventID(kAEOpenDocuments)) } @objc func handle(event: NSAppleEventDescriptor?, replyEvent: NSAppleEventDescriptor?) { guard let event = event, event.eventClass == AEEventClass(kCoreEventClass) && event.eventID == AEEventID(kAEOpenDocuments) else { return } guard let directObject = event.paramDescriptor(forKeyword: keyDirectObject) else { return } print(directObject) } }### Received Apple Event: <NSAppleEventDescriptor: 'aevt'\'odoc'{ '----':[ 'bmrk'(888/$626F [....] 00000...$) ] }>Can anyone help me understand why the Apple event I send along with NSWorkspace `open()` is not the Apple Event that I receive in my handler?Sorry for the wall of text above (easier to see in markdown)Please let me know if there's anything I can add.
Posted
by pkamb.
Last updated
.