문제

I would like to receive a notification each time Siri appears or disappears from the screen.
It may appear when the user puts the iPhone near his ear.

Is it possible?

도움이 되었습니까?

해결책

I ran a test and the following notifications are sent when Siri appears:

_UIApplicationWillAddDeactivationReasonNotification
UIApplicationWillResignActiveNotification

... and when Siri is dismissed:

_UIApplicationDidRemoveDeactivationReasonNotification
UIApplicationDidBecomeActiveNotification

So, no... since there isn't a public Siri API, and UIApplication doesn't send any Siri specific notifications, it looks like we're out of luck for now.

다른 팁

The only notification you'd get is a applicationDidEnterBackground (or something like that).

I don't think there are any Siri APIs at the moment so you would be looking at the OS as a whole.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top