How can i get android screen-off event

#1

Hello(i am first question~)

I want to know how to get the event of screen-off for lock screen publishing.

https://github.com/AudyOdi/react-native-android-pattern-lock-screen

The project just make pattern lock screen, i want to publish real lock screen.

how can i add screen off event listener?

please help~~

※ i don’t want to expo detach for the native android studio project

1 Like
#2

Have you looked into AppState API at all?

None of us do :slightly_smiling_face::joy:

If this doesn’t work for you, could you open a canny: https://expo.canny.io/feature-requests and share it here so others can vote on it :blue_heart::slightly_smiling_face::star:

#3

Thx for reply

I thought AppState is just check the react-native application status.

I thought Screen-off is not appstate~

Yeah i will check more PhoneState(screen off) through AppState API~

#4

Hello

I checked AppStat, but it didn’t work.

i think AppState is not only screen-off event.
(in home screen, in another app, etc…)

i dont want these results.

closed #5

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.