lock/unlock event

hi, Im using:

  1. SDK Version: 38
  2. Platforms(Android/iOS)

is there any way to detect lock/unlock screen by user?
I want to make an app so that I can do a specific task on unlock/lock