Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@sayem314/react-native-keep-awake
Advanced tools
Keep the screen from going to sleep. iOS, Android and Web.
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.
As the first step, install this module:
yarn add @sayem314/react-native-keep-awake
You must use react-native-keep-awake@1.2.0
or newer if you want to use the RN new architecture.
import { useKeepAwake } from '@sayem314/react-native-keep-awake';
import React from 'react';
import { Text, View } from 'react-native';
export default function KeepAwakeExample {
useKeepAwake();
return (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<Text>This screen will never sleep!</Text>
</View>
);
}
import KeepAwake from '@sayem314/react-native-keep-awake';
import React from 'react';
import { Text, View } from 'react-native';
export default function KeepAwakeExample {
return (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<KeepAwake />
<Text>This screen will never sleep!</Text>
</View>
);
}
import { activateKeepAwake, deactivateKeepAwake} from "@sayem314/react-native-keep-awake";
import React from "react";
import { Button, View } from "react-native";
export default class KeepAwakeExample extends React.Component {
render() {
return (
<View style={{ flex: 1, alignItems: "center", justifyContent: "center" }}>
<Button onPress={this._activate}>Activate</Button>
<Button onPress={this._deactivate}>Deactivate</Button>
</View>
);
}
_activate = () => {
activateKeepAwake();
};
_deactivate = () => {
deactivateKeepAwake();
};
}
FAQs
Keep the screen from going to sleep. iOS, Android and Web.
We found that @sayem314/react-native-keep-awake demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.