I started using the event monitoring of UIKit motion-event. When the application is running in the foreground, the shake action can be monitored. When the application exits the foreground, even if the background is alive (the application is active for about 10 minutes before exiting), it cannot be monitored. action.
Using the CoreMotion framework, shaking motions can be detected while the app is running in the background.
Personally, I think this demand cannot be met, although I don’t understand iOS development. Just imagine, if iOS provides this interface, and there are multiple applications in the background calling this interface, and you shake the screen in the foreground, which application should jump out...
I am not working on iOS. I thought that when the app program is in the background, it can only passively receive push messages and cannot actively process them.
I started using the event monitoring of UIKit motion-event. When the application is running in the foreground, the shake action can be monitored. When the application exits the foreground, even if the background is alive (the application is active for about 10 minutes before exiting), it cannot be monitored. action.
Using the CoreMotion framework, shaking motions can be detected while the app is running in the background.
Personally, I think this demand cannot be met, although I don’t understand iOS development. Just imagine, if iOS provides this interface, and there are multiple applications in the background calling this interface, and you shake the screen in the foreground, which application should jump out...
Want to know what background process capabilities the iOS platform opens to applications.
I am not working on iOS. I thought that when the app program is in the background, it can only passively receive push messages and cannot actively process them.