[英]Looking for tools and methods to use to narrow down causes for a React Native app to stop a device from going into sleep mode
I am maintaining an App that has been created in React Native targeted at Android tablet devices. 我正在维护一个在针对Android平板电脑设备的React Native中创建的应用程序。 The issue that I am currently experiencing is that when the app is active but has not had any activity, the device will not go into sleep mode after the assigned period of inactivity whilst the is app active.
我当前遇到的问题是,当应用处于活动状态但未进行任何活动时,在应用处于活动状态时,设备在指定的不活动时间后将不会进入睡眠模式。
I have been attempting to find any processes that could be preventing the app from allowing the device to go into sleep mode and have not been able to find anything through Chromes debugging tools or Reactotron. 我一直在尝试寻找可能阻止应用程序使设备进入睡眠模式的任何进程,并且无法通过Chrome调试工具或Reactotron找到任何东西。
I did find this question App not letting device to go into sleep mode so my next step is to look at our third party packages as well as our own Java files, though our customisation of them have been very minimal and to the best of my knowledge there has not been any code added intentionally to stop a device from going into sleep mode. 我确实发现了这个问题,但App不允许设备进入睡眠模式,因此我的下一步是查看我们的第三方程序包以及我们自己的Java文件,尽管我们对它们的定制非常少,并且据我所知没有任何有意添加的代码来阻止设备进入睡眠模式。
What I am looking for is any additional tools as well as any methods that I could use to narrow down my search for this issue. 我正在寻找的是任何其他工具以及可以用来缩小搜索范围的任何方法。
Was this application created using Expo? 这个应用程序是使用Expo创建的?
If so you can prevent the screen from sleeping by using KeepAwake
as documented here in the Expo documentation https://docs.expo.io/versions/latest/sdk/keep-awake/ 如果是这样,您可以使用
KeepAwake
文档中的文档https://docs.expo.io/versions/latest/sdk/keep-awake/中记录的KeepAwake
来防止屏幕进入睡眠状态。
There is also information inThe github repo which details how to use this in applications that aren't using Expo too : https://github.com/expo/expo/tree/master/packages/expo-keep-awake github repo中还有一些信息,详细说明了如何在不使用Expo的应用程序中使用它: https : //github.com/expo/expo/tree/master/packages/expo-keep-awake
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.