detect screen unlock events in IOS Swift

前端 未结 3 1624
梦谈多话
梦谈多话 2020-12-09 13:05

How can i detect screen unlock events on iPhone? When the user unlocks it, I want to perform an action in my app. I searched on googled but only found code related to object

3条回答
  •  感情败类
    2020-12-09 13:59

    As far as we know you can't detect screen lock-unlock status by using native code. By using private api there will be chance of detecting screen lock-unlock status. Your app might be rejected if you are using private api of apple. We recommend not to use apple private api.

    You can find the answer from below links if you want screen lock-unlock event in jail broken device

    Getting state for system wide notifications in iOS and OS X

    Lock Unlock events iphone

    Detect screen on/off from iOS service

提交回复
热议问题