Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sayem314/react-native-keep-awake

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sayem314/react-native-keep-awake - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

android/src/main/java/com/sayem/keepawake/KCKeepAwake.java

23

index.js

@@ -1,26 +0,11 @@

import React, { useEffect } from "react";
import { NativeModules } from "react-native";
import React from "react";
export function useKeepAwake() {
useEffect(() => {
NativeModules.KCKeepAwake.activate();
return () => NativeModules.KCKeepAwake.deactivate();
}, []);
}
export function useKeepAwake() {}
export function activateKeepAwake() {
NativeModules.KCKeepAwake.activate();
}
export function activateKeepAwake() {}
export function deactivateKeepAwake() {
NativeModules.KCKeepAwake.deactivate();
}
export function deactivateKeepAwake() {}
export default function KeepAwake() {
useEffect(() => {
NativeModules.KCKeepAwake.activate();
return () => NativeModules.KCKeepAwake.deactivate();
}, []);
return null;
}
{
"name": "@sayem314/react-native-keep-awake",
"version": "1.0.1",
"version": "1.0.2",
"description": "Keep the screen from going to sleep. iOS, Android and Web.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -15,3 +15,3 @@ This React Native package allows you to prevent the screen from going to sleep while your app is active. It's useful for things like navigation or video playback, where the user expects the app to remain visible over long periods without touch interaction.

```jsx
```js
import { useKeepAwake } from '@sayem314/react-native-keep-awake';

@@ -34,3 +34,3 @@ import React from 'react';

```jsx
```js
import KeepAwake from '@sayem314/react-native-keep-awake';

@@ -52,6 +52,6 @@ import React from 'react';

```jsc
import { activateKeepAwake, deactivateKeepAwake } from '@sayem314/react-native-keep-awake';
import React from 'react';
import { Button, View } from 'react-native';
```js
import { activateKeepAwake, deactivateKeepAwake} from "@sayem314/react-native-keep-awake";
import React from "react";
import { Button, View } from "react-native";

@@ -61,3 +61,3 @@ export default class KeepAwakeExample extends React.Component {

return (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<View style={{ flex: 1, alignItems: "center", justifyContent: "center" }}>
<Button onPress={this._activate}>Activate</Button>

@@ -71,8 +71,8 @@ <Button onPress={this._deactivate}>Deactivate</Button>

activateKeepAwake();
};
};
_deactivate = () => {
deactivateKeepAwake();
};
};
}
```

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc