简体   繁体   English

寻找用于缩小React Native应用程序停止设备进入睡眠模式的原因的工具和方法

[英]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.

相关问题 React Native可以在睡眠模式下工作吗? - React Native can work in sleep mode? 搜索缩小的结果React - Searching narrow down results React 如何在 React Native 中使用 React 开发工具? - How to use React dev tools with react native? CSS @media 查询仅在开发人员工具的设备模式下有效 - React - CSS @media queries only work in Device Mode of Developer Tools - React 如何阻止 Chrome 进入调试模式? - How can I stop Chrome from going into debug mode? 如何从进入睡眠状态的WebSocket客户端计算机或应用程序进入后台恢复(iPad上的Safari) - How do I recover from a WebSocket client computer going to sleep or app going to background (Safari on iPad) react native:缩小列的方法是什么? - react native: what is the way to narrow column? React Native 应用程序在模拟器上运行,而不是在设备上 - React Native app runs on emulator, not on device 如何使用 Google App Script 缩小 web 抓取的结果? - How to narrow down results from web scraping using Google App Script? 不使用应用程序或在后台模式下,React Native是否具有正在运行的功能生命周期? - Does react native have a function lifecycle is running when app is not use or in background mode?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM