iOS: Is there any notification that Siri has appeared?

瘦欲@ 提交于 2019-12-21 06:16:21

问题


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?


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/13620475/ios-is-there-any-notification-that-siri-has-appeared

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!