0.1.0 • Published 1 year ago

react-native-screen-idle-timer v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

react-native-screen-idle-timer

Prevent screen fron going to sleep on both iOS and Android.

Installation

npm install react-native-screen-idle-timer

Usage

import ScreenIdleTimer from 'react-native-screen-idle-timer';

// Method 1
class MyComponent extends Component {
  render() {
    if (this.props.screenShouldBeAwake) {
      return (
        <View>
          <Text>Screen will be kept awake</Text>
          <ScreenIdleTimer />
        </View>
      )
    } else {
      return (
        <View>
          <Text>Screen can sleep</Text>
        </View>
      );
    }
  }
}

// Method 2
function changeKeepAwake(shouldBeAwake) {
  if (shouldBeAwake) {
    ScreenIdleTimer.activate();
  } else {
    ScreenIdleTimer.deactivate();
  }
}

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

absolute-pathabort-controlleracorn-jsxacceptsadd-streamacornJSONStreamacorn-walkajvaggregate-erroranseragent-baseansi-alignansi-escapesanymatchappdirsjsargargparseansi-regexansi-stylesansi-fragmentsarr-diffarr-flattenarray-includesarray-unionarr-unionarray.prototype.flatmaparrifyarray.prototype.maparray-ifyast-typesastral-regexasapassign-symbolsasync-limiteratobasyncarray-uniquebabel-corebabel-plugin-jest-hoistbabel-jestasynckitbabel-plugin-polyfill-corejs2babel-plugin-syntax-trailing-function-commasbabel-plugin-polyfill-corejs3babel-preset-jestbalanced-matchbasebabel-plugin-istanbulbabel-preset-current-node-syntaxbefore-after-hookbase64-jsbrace-expansionbracesbserblbuffer-fromasync-retrybufferboxencache-basebytescacheable-lookupcaller-callsitecacheable-requestcallsitescaller-pathcall-bindcaniuse-litecamelcasebrowserslistchardetci-infoclass-utilschalkcli-boxeschar-regexcli-spinnerscamelcase-keyscli-cursorclean-stackcloneclone-deepcollect-v8-coveragecollection-visitcolor-namecolor-convertcolorettecombined-streamcli-widthcommondircompare-funccliuicompressiblecomponent-emittercompressionconcat-mapcommand-existsconfig-chaincoconnectconventional-changelogcommanderconventional-changelog-angularconventional-changelog-atomconventional-changelog-conventionalcommitsconventional-changelog-codemirrorconventional-changelog-coreconventional-changelog-emberconventional-changelog-eslintconventional-changelog-expressconventional-changelog-jqueryconfigstoreconventional-changelog-preset-loaderconcat-streamconventional-commits-parserconventional-recommended-bumpconventional-changelog-writercopy-descriptorconventional-commits-filterconvert-source-mapcore-js-compatconventional-changelog-jshintcosmiconfigcosmiconfig-typescript-loadercross-spawncrypto-random-stringdargsdateformatdata-uri-to-buffercsstypecreate-requirecore-util-isdecamelizedecompress-responsedecode-uri-componentdeep-extenddebugdedentdefaultsdeep-isdefer-to-connectdefine-propertiesdeepmergedefine-lazy-propdefine-propertydayjsdelayed-streamdepddeldeprecationdetect-newlinedenodeifydestroydir-globdiffdegeneratoreastasianwidthdecamelize-keysdoctrineee-firstdiff-sequencesencodeurlend-of-streamelectron-to-chromiumdot-propemoji-regexerror-exenvinfoerrorhandleres-abstractes-array-method-boxes-properlyerror-stack-parseres-shim-unscopablesescape-goatescaladeescape-htmles-to-primitiveescape-string-regexpescodegeneslint-plugin-ft-floweslint-plugin-jesteslint-plugin-reacteslint-plugin-eslint-commentses-get-iteratoreslint-plugin-react-native-globalseslint-plugin-react-hookseslint-plugin-react-nativeesprimaeslint-scopeespreeesqueryeslint-utilsestraverseesutilsetagevent-target-shimesrecursebabel-plugin-polyfill-regeneratorexpand-bracketsextend-shallowexecaexternal-editorexpectextglobfast-difffast-deep-equalfast-globfast-json-stable-stringifyfastqfb-watchmanfetch-blobfast-levenshteinemitteryfiguresfill-rangeeslint-visitor-keysfind-cache-dirfinalhandlerfile-entry-cacheflattedfind-upfor-inform-data-encoderflow-parserbabel-preset-fbjsfragment-cachefreshform-dataftpfs.realpathfunction-bindformdata-polyfillfunction.prototype.namegensyncget-caller-filefs-extrafunctions-have-namesget-package-typeget-intrinsicget-valueget-pkg-repoget-urigit-remote-origin-urlget-streamget-symbol-descriptiongit-semver-tagsgit-raw-commitsgitconfiglocalgit-upgit-url-parseglobglobalsglobal-dirsglob-parentgrapheme-splittercjs-module-lexergraceful-fshard-rejectionhandlebarshashas-flaggothas-symbolshas-tostringtaghas-valuehas-valueshas-bigintshermes-estreehermes-profile-transformerhermes-parserhas-property-descriptorshtml-escaperglobbyhttp-cache-semanticshttp-errorshttp2-wrapperfile-uri-to-pathhttp-proxy-agenthas-yarniconv-liteieee754human-signalsimage-sizeignoreimport-lazyinflightindent-stringimurmurhashiniinheritsimport-freshhttps-proxy-agentinternal-slotinvariantipinquireris-accessor-descriptorinterpretis-arrayishis-absoluteis-bufferimport-localis-bigintflat-cacheis-boolean-objectis-descriptoris-core-moduleis-data-descriptoris-ciis-directoryis-extendableis-fullwidth-code-pointis-argumentsis-generator-fnis-date-objectis-extglobis-git-repositoryis-interactiveis-git-dirtyis-globis-mapis-dockeris-npmis-objis-numberis-installed-globallyis-path-insideis-plain-objexitis-number-objectis-relativeis-plain-objectis-shared-array-bufferis-callableis-streamis-path-cwdis-sshis-stringis-text-pathis-typedarrayis-unc-pathis-regexis-unicode-supportedis-windowsis-wslis-setis-yarn-globalis-symbolisexeisobjectistanbul-lib-coverageisarrayistanbul-lib-reportistanbul-reportsis-weakrefiterate-valuejest-configjest-changed-filesiterate-iteratoristanbul-lib-source-mapsistanbul-lib-instrumentjest-circusjest-docblockjest-clijest-haste-mapjest-get-typejest-leak-detectorjest-environment-nodejest-eachjest-message-utiljest-pnp-resolverjest-matcher-utilsjest-regex-utiljest-resolve-dependenciesjest-mockjest-runnerjest-snapshotjest-resolvejest-diffjest-watcherjest-utiljetifierjest-validatejest-workerjs-sdsljs-tokensjoijs-yamljscodeshiftjsescjson-parse-better-errorsjsc-androidjson-parse-even-better-errorsjson-stable-stringify-without-jsonifyjson-stringify-safejson-bufferjsonparsejson5jsonfileklawkind-ofjsx-ast-utilskleurjson-schema-traverselevenjest-serializerlatest-versionlevnlines-and-columnslocate-pathlodash.debouncelodashkeyvlodash.mergeload-json-filelodash.throttleloose-envifyhosted-git-infois-negative-zerolru-cachelodash.ismatchmake-dirmap-cachemake-errormakeerrormemoize-onelogkittymap-visitmacos-releasemerge-streammap-objmerge2metro-babel-transformermetro-cache-keylowercase-keysmetro-configmetro-cachemetro-hermes-compilermetro-coremetro-minify-uglifymeowmetro-inspector-proxymetro-resolvermetro-source-mapmetro-file-mapmetro-runtimelog-symbolsmetro-react-native-babel-presetmetromime-dbmetro-transform-workermetro-transform-pluginsmime-typesmimic-fnminimatchmicromatchmin-indentminimistmixin-deepminimist-optionsmodify-valuesmkdirpmsnanomatchmute-streammimenatural-comparenegotiatorneo-asyncnice-trymetro-react-native-babel-transformernatural-compare-litemimic-responsenode-dirnode-int64new-github-release-urlnode-fetchnocachenode-releasesnetmasknpm-run-pathnormalize-pathnormalize-package-datanode-stream-zipobject-assignob1normalize-urlnullthrowsobject-keysobject-copyobject.assignobject-visitnode-domexceptionobject.fromentriesobject.entriesobject.pickon-finishedon-headersonceonetimeoraobject.hasownopenoptionatoros-tmpdirobject.valuesp-finallyp-limitp-locatep-tryobject-inspectos-namep-cancelablep-mappac-proxy-agentparent-moduleparse-jsonparseurlparse-pathpascalcasepath-existspath-is-absolutepath-keypath-typepath-parsepac-resolverpifypicocolorspkg-dirposix-character-classespicomatchprelude-lspretty-formatprettier-linter-helperspromisepromise.allsettledprocess-nextick-argsparse-urlprop-typesprotocolsproto-listpromptsproxy-from-envpunycodeproxy-agentpumppupapiratesrange-parserpackage-jsonqueue-microtaskquick-lrurcreact-israw-bodyreact-native-gradle-pluginreact-refreshread-pkgreact-devtools-coreqreadable-streamread-pkg-uprechoirreadlinereact-native-codegenredentregeneratejest-runtimeregex-notregenerator-runtimereact-shallow-rendererregexppregexp.prototype.flagsrecastregenerator-transformregistry-urlregjsgenrepeat-stringrepeat-elementrequire-directoryregexpu-corerequire-main-filenamerequire-from-stringresolve-cwdregjsparserresolve-frommetro-symbolicateresolve-globalresolve-urlresolveregistry-auth-tokenresolve-alpnrestore-cursorretresponselikerimrafrun-asyncreusifysafe-regexretryrxjssafer-bufferschedulersafe-regex-testsemverrun-parallelserialize-errorset-blockingset-valuesetprototypeofserve-staticshallow-cloneshebang-commandshebang-regexsafe-buffershelljsshell-quotesisteransisignal-exitregenerate-unicode-propertiesslashsnapdragon-nodesnapdragonsmart-buffersockssnapdragon-utilsource-map-supportsocks-proxy-agentsource-mapside-channelslice-ansispdx-exceptionssendspdx-correctsemver-diffsplitspdx-license-idssprintf-jssplit-stringstatic-extendstack-utilsspdx-expression-parsestatusessource-map-urlstring-lengthstackframestacktrace-parserstring-natural-comparestring-widthstrip-bomstring.prototype.trimendstring.prototype.trimstartstrip-indentstrip-eofstrip-ansistrip-final-newlinesupports-colorsudo-promptstrip-json-commentstempstring.prototype.matchallterminal-linksupports-hyperlinkstext-extensionsthroattext-tabletmpsupports-preserve-symlinks-flagtest-excludeto-object-pathto-fast-propertiessplit2tmplto-regexthrough2trim-newlinesto-regex-rangetr46string_decodertslibtype-detecttoidentifierresolve.exportstypedarray-to-buffertype-festtype-checkuglify-esuglify-jsunc-path-regexunbox-primitiveunicode-match-property-ecmascriptunicode-canonical-property-names-ecmascriptunion-valueuniversalifyunicode-property-aliases-ecmascripttsutilsunicode-match-property-value-ecmascriptts-nodeunpipeunique-stringunset-valueurixuniversal-user-agentupdate-browserslist-dbutil-deprecateuseurl-joinuse-sync-external-storeutils-mergeupdate-notifiervalidate-npm-package-licensevarywalkeruri-jsvm2vlqwebidl-conversionswcwidthv8-to-istanbulv8-compile-cache-libwhatwg-urlwhichwhatwg-fetchwhich-boxed-primitiveword-wrapwildcard-matchwordwrapweb-streams-polyfillwhich-modulewidest-linewrappywrap-ansiwrite-file-atomicxregexpxtendwindows-releasewsyallistthroughyamlyargsyocto-queuetypedarrayyny18nyargs-parserxdg-basedirsource-map-resolve
0.1.0

1 year ago