forked from corbt/react-native-keep-awake
-
-
Notifications
You must be signed in to change notification settings - Fork 36
Open
Description
Hi i got issue about press it does not work noting happen
import { activateKeepAwake, deactivateKeepAwake } from "@sayem314/react-native-keep-awake";
import React, { useState } from "react";
import { Button, View, Text } from "react-native";
const KeepAwakeExample = () => {
const [isAwake, setIsAwake] = useState(false);
const activate = () => {
console.log("Activating KeepAwake...");
activateKeepAwake();
setIsAwake(true);
};
const deactivate = () => {
console.log("Deactivating KeepAwake...");
deactivateKeepAwake();
setIsAwake(false);
};
return (
<View style={{ flex: 1, justifyContent: "center", alignItems: "center" }}>
<Button title="Activate" onPress={activate} />
<Button title="Deactivate" onPress={deactivate} />
<Text>{isAwake ? "KeepAwake is Active" : "KeepAwake is Deactivated"}</Text>
</View>
);
};
export default KeepAwakeExample;
```
`
my sample package " "dependencies": {
"@peculiar/webcrypto": "^1.5.0",
"@react-native-async-storage/async-storage": "^2.1.0",
"@react-native-google-signin/google-signin": "^13.1.0",
"@react-navigation/native": "^6.1.18",
"@react-navigation/native-stack": "^6.11.0",
"@react-oauth/google": "^0.12.1",
"@sayem314/react-native-keep-awake": "^1.3.0",
"axios": "^1.7.9",
"buffer": "^6.0.3",
"jose": "^5.9.6",
"moment": "^2.30.1",
"moment-timezone": "^0.5.46",
"react": "18.3.1",
"react-native": "0.75.4",
"react-native-crypto": "^2.2.0",
"react-native-get-random-values": "^1.11.0",
"react-native-linear-gradient": "^2.8.3",
"react-native-orientation-locker": "^1.7.0",
"react-native-quick-crypto": "^0.7.11",
"react-native-randombytes": "^3.6.1",
"react-native-safe-area-context": "^4.11.1",
"react-native-screens": "^3.34.0",
"react-native-vector-icons": "^10.2.0"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@babel/plugin-transform-export-namespace-from": "^7.25.9",
"@babel/preset-env": "^7.20.0",
"@babel/runtime": "^7.20.0",
"@react-native/babel-preset": "0.75.4",
"@react-native/eslint-config": "0.75.4",
"@react-native/metro-config": "0.75.4",
"@react-native/typescript-config": "0.75.4",
"@types/react": "^18.2.6",
"@types/react-test-renderer": "^18.0.0",
"babel-jest": "^29.6.3",
"eslint": "^8.19.0",
"jest": "^29.6.3",
"prettier": "2.8.8",
"react-test-renderer": "18.3.1",
"typescript": "5.0.4"
},
"engines": {
"node": ">=18"
}" what i miss thank you.
Metadata
Metadata
Assignees
Labels
No labels