how mac App get notification when user shake mouse(cursor become larger) in 10.11 - macos

when in 10.11, a new feature is brought: user can shake mouse to find cursor(cursor become larger).
my mac app want to get notify when user does this.
is there a way or any clue?

Apple engineers have reviewed my request and have concluded that there is no supported way to achieve the desired functionality given the currently shipping system configurations. Application's can not be notified when the user activates the cursor location assistance feature.

Related

Android Wear System Alert Window Permission

How to ask for system alert window permission on Android Wear? I am able to achieve the SYSTEM ALERT WINDOW for mobile but on the wearable device same code is not working for me. If any example of SYSTEM ALERT WINDOW for wearable would help me a lot.
This is a duplicate of Requesting permissions on Android wear, but SO won't let me mark it as such because the OP didn't accept my answer there.
The summary is that it's not possible to request this permission on Android Wear 1.x, but it is on Wear 2 (currently in beta and slated for release in early 2017).
In addition to #String's answer, you might want to use requestPermissions() method. Please note, these permissions must be requested in your manifest.
And, as mentioned in Permissions for Services,
only an activity can call the requestPermissions() method, so if the user interacts with your app via a service, for example a watch face, the service must open a background activity before requesting the permission.
You can gain additional insights from the solutions given in this SO post and from the sample code shown in this GitHub post.

Is it possible to get an app to open up when entering a beacon region / within range of a beacon/ibeacon

I'm exploring the end user experience for a beacon prototype but I'm struggling to find any end-user scenarios that involve the app becoming active / opening up on the screen when within range.
I can get the app to send a notification and this is the most likely experience on both Android and iOS but does anyone know if it is possible to get the app to open up?
It's unlikely that I'd want real customers to have their experience interfered with in this way, I think it's ok if the app is already running and is open but not if it's running but not open.
Thanks
On Android this is possible. The reference app for the Android Beacon Library demonstrates how to do exactly this.
On iOS, it is not possible due to OS security restrictions. See here for details. The best you can do is send a local notification to the user when the beacon is detected, then if the user gestures to it, bring up the app.

Windows phone notification that stays till user checks

I am new to windows phone app dev. I want to know if there is any way to have a notification alive till the user checks it. I found that "toast notification" expires in 10 seconds irrespective of user checks it or not. And there is no way of finding out if a tile notification arrived or not. Is there any workaround? I want to have notifications that are similar to Android notifications which stay till user checks them.
Persistent on-screen notifications on Windows Phone are not possible, by intentional design. It's interesting to see how many users on Android disliked persistent notifications when applications started to interrupt and then disrupt the current foreground application experience.
The design philosophy is that they distract from the user experience and could be easily abused by applications.
The general Microsoft recommendation for the platform would be to use a combination of a notification, Live Tile (reference), and in application UI update.
In Android 4.3, the behavior was changed to highlight applications that were constantly running (interesting reference)
You can use "MessageBox.Show(String)".
Refer below for:
MSDN Doc
Example 1
Example 2

Reacting upon iTunes launch with NSDistributedNotificationCenter

I'm trying to intercept when iTunes starts up on Mac OS X, so I can relaunch my application to work around few bugs in the iTunes Framework.
What I did is to temporarly disable the sandboxing of my application and listen to all NSDistributedNotificationCenter notifications in order to examine them and pick the ones I want.
What I found is that upon start iTunes apparently sends this event:
object: com.apple.iTunes.help name: HelpBookRegistrationDidChange userInfo: (null)
which seems rather unique but also doesn't give an exact clue it is related to a startup event only at 100%.
Does anyone know if this is safe way to intercept such event?
If so, once my app is sandboxed again I need to ask temporary permission to listen to this kind of event, how can I do that in code?
Do you believe scripting bridge can help in this case?
You don't need to disable sandboxing for this, just observe NSWorkspaceDidLaunchApplicationNotification in the notification center provided by NSWorkspace, not the distributed one.
You'll get an instance of NSRunningApplication in the user info of the notification, which you can use to determine whether the launched app was iTunes (use the bundleIdentifier property).

Can Mac App Store Sandboxed apps use CGEventPost?

For an app I am working on I am using CGEventPost to post some key events and I noticed that it stopped working with sandboxing enabled, even I turned on the "Enable Access for Assistive Devices" system preference.
Is there an entitlement to allow the use of CGEventPost? Or, is there another way to post key events with apps submitted to the Mac App Store?
Can Mac App Store Sandboxed apps use CGEventPost?
No.
Is there an entitlement for CGEventPost? Or is there any way to post key events with apps submitted to the Mac App Store?
No.
If you look at the developer forums, Apple has made it very clear that they will never enable an entitlement for this, because it allows a blatantly obvious way for any app to escape the sandbox.
If you have some more specific need that you can justify (not "post some key events" but "get iPhoto do to XXX, which as far as I know can only be done by posting event YYY at it"), file a bug report, and post a thread on the dev forums.
This will do two things:
Someone at Apple may suggest a workaround--possibly a private one that nobody else can tell you and/or one that isn't normally allowed on the App Store but will be accepted if you've been told to use it.
It increases the chances that Apple will invent some better way to do what you want in the future.
Old question, but accepted answer is wrong. There are apps in Mac App Store that are using CGEventPost to simulate events. For example apps "Remote Mouse" and "Mobile Mouse Server" do that. They can send input to any other app and based on symbols in those apps they are clearly using CGEventPost-function. I would like to know how are they doing it.

Resources