-
Re: How to activate app's running instance
pmills Dec 23, 2016 10:23 AM (in response to imneo)I would expect your running app to get app delegate callbacks for applicationDidUnhide or applicationDidBecomeActive (or both). Do you implement those?
-
Re: How to activate app's running instance
eskimo Dec 23, 2016 2:40 PM (in response to imneo)2. User hides my app completely (all windows are hidden) so that he/she has no way to accessing the app.
Does your app show up in the Dock?
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardwarelet myEmail = "eskimo" + "1" + "@apple.com"
-
Re: How to activate app's running instance
imneo Dec 24, 2016 4:46 AM (in response to eskimo)Oh, I forgot to mention this. I hide all windows completely from dock using a method like below:
+ (BOOL)hideWindowFromDock:(NSWindow *)window { if ([NSApp activationPolicy] != NSApplicationActivationPolicyProhibited) { [NSApp setActivationPolicy:NSApplicationActivationPolicyProhibited]; } [window setIsVisible:NO]; return YES; }
-
-
Re: How to activate app's running instance
KMT Dec 24, 2016 4:46 AM (in response to imneo)>User hides my app completely (all windows are hidden) so that he/she has no way to accessing the app.
Even via cmd-tab? Or Apple logo/recent items?
-
Re: How to activate app's running instance
imneo Dec 24, 2016 4:53 AM (in response to KMT)Cmd-TAB will not show my app because I hide windows by setting NSApplicationActivationPolicyProhibited (hiding from dock).
When I said 'no way to access my app' I mean by means of interactive UI, not recent items. The user is always able to 'access' my app in /Applications. But that's not the key to my problem.
Maybe my English is not good engough to express that I want. But anyway I wil l put it in another way. What I want is simple - I want to bring back app's UI after user requested hiding all of them.
-
Re: How to activate app's running instance
eskimo Dec 26, 2016 1:42 PM (in response to imneo)I hide all windows completely from dock using a method like below
Just by by of terminology, this isn’t ‘hiding all windows’, this is transforming your process into a what’s commonly called a UI element, that is, a GUI that has no normal UI. UI elements can display UI, but don’t show up in the Dock, or when you hit command-Tab, and so on.
I had to test this to confirm, but it turns out that UI elements do get the
-applicationShouldHandleReopen:hasVisibleWindows:
delegate callback when the user double clicks the app in the Finder, so it seems that like that’s the best way forward.Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardwarelet myEmail = "eskimo" + "1" + "@apple.com"
-
Re: How to activate app's running instance
imneo Dec 27, 2016 6:40 AM (in response to eskimo)It works. Great thanks for the tip.
-
Re: How to activate app's running instance
jljl789@icloud.comjljl789@iclo Jan 12, 2017 12:56 AM (in response to eskimo)ios
-
-
-