{"id":23536611,"url":"https://github.com/mockingbot/react-native-immersive","last_synced_at":"2025-10-11T00:35:53.422Z","repository":{"id":57337662,"uuid":"63313953","full_name":"mockingbot/react-native-immersive","owner":"mockingbot","description":"Add Toggle for Android Immersive FullScreen Layout","archived":false,"fork":false,"pushed_at":"2019-11-19T03:31:45.000Z","size":21,"stargazers_count":133,"open_issues_count":3,"forks_count":24,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-10-02T01:41:22.669Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mockingbot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-14T07:43:14.000Z","updated_at":"2025-09-09T08:27:55.000Z","dependencies_parsed_at":"2022-08-29T21:11:45.380Z","dependency_job_id":null,"html_url":"https://github.com/mockingbot/react-native-immersive","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/mockingbot/react-native-immersive","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mockingbot%2Freact-native-immersive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mockingbot%2Freact-native-immersive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mockingbot%2Freact-native-immersive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mockingbot%2Freact-native-immersive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mockingbot","download_url":"https://codeload.github.com/mockingbot/react-native-immersive/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mockingbot%2Freact-native-immersive/sbom","scorecard":{"id":655771,"data":{"date":"2025-08-11","repo":{"name":"github.com/mockingbot/react-native-immersive","commit":"698e7a31ca423fe9b7aff125cc8ea6f1f47b121f"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.3,"checks":[{"name":"Code-Review","score":2,"reason":"Found 3/15 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 6 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-21T14:36:26.272Z","repository_id":57337662,"created_at":"2025-08-21T14:36:26.272Z","updated_at":"2025-08-21T14:36:26.272Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279005651,"owners_count":26083942,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-26T02:29:43.462Z","updated_at":"2025-10-11T00:35:53.395Z","avatar_url":"https://github.com/mockingbot.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-native-immersive \n\n[![i:npm]][l:npm]\n[![i:npm-dm]][l:npm]\n\n* [Installation Process](#installation-process)\n* [Basic Usage](#basic-usage)\n* [Restore Immersive State](#restore-immersive-state)\n* [Sample Component](#sample-component)\n* [Common Problem](#common-problem)\n  - [Unified Compile Version](#unified-compile-version)\n  - [Packages missing from JCenter](#packages-missing-from-jcenter)\n\nAdd Toggle for Android Immersive FullScreen Layout\n\n\nNote:\n- this package is Android only, and Immersive Full-Screen Mode is first introduced since [Android 4.4 (API Level 19)][l:immersive]\n- check [release][l:release] for ChangeLog\n- `v2.0.0` and above will build with `gradle@\u003e=3`\n- `v1.0.0` and above should be used with `react-native@\u003e=0.47`\n- `v0.0.5` should be used with `react-native@\u003c=0.46`\n\n\n## Installation Process\n\nDownload from npm: `npm i react-native-immersive`\n\nRun `react-native link` to automatically link the library.\n\n#### manual link process\n\nEdit `android/settings.gradle`:\n\n```diff\n+ include ':react-native-immersive'\n+ project(':react-native-immersive').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-immersive/android')\n```\n\nEdit `android/app/build.gradle`: (for versions before `v2.0.0`, use `compile` instead of `implementation` for `gradle@\u003c=2`)\n\n```diff\ndependencies {\n  implementation fileTree(dir: \"libs\", include: [\"*.jar\"])\n  implementation \"com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}\"\n  implementation \"com.facebook.react:react-native:+\"  // From node_modules\n+ implementation project(':react-native-immersive')\n}\n```\n\nEdit `android/app/src/main/java/.../MainApplication.java`:\n\n```diff\n+ import com.rnimmersive.RNImmersivePackage;\n\n...\n\n  @Override\n  protected List\u003cReactPackage\u003e getPackages() {\n    return Arrays.\u003cReactPackage\u003easList(\n      new MainReactPackage()\n+     , new RNImmersivePackage()\n    );\n  }\n```\n\n\n## Basic Usage\n\n```js\nimport { Immersive } from 'react-native-immersive'\n\n// methods (Android only, will throw Error on iOS in __DEV__ mode)\nImmersive.on()\nImmersive.setImmersive(true)\n\nImmersive.off()\nImmersive.setImmersive(false)\n```\n\n\n## Restore Immersive State \n\nThe Immersive State do not last forever (SYSTEM_UI_FLAG_IMMERSIVE_STICKY is not sticky enough). \nThe Immersive State will get reset when:\n\n- coming back to active AppState\n- after Keyboard opening\n- after Alert opening\n- after Modal opening\n\nTo restore the Immersive State, add an additional listener.\n\n```js\n// listener for Immersive State recover\nconst restoreImmersive = () =\u003e {\n  __DEV__ \u0026\u0026 console.warn('Immersive State Changed!')\n  Immersive.on()\n}\nImmersive.addImmersiveListener(restoreImmersive)\nImmersive.removeImmersiveListener(restoreImmersive)\n```\n\nThe Native Module itself will cover some basic Immersive State change (but not something like Modal + Alert).\nTo get all Immersive State change, edit `android/app/src/main/java/.../MainActivity.java`:\n\n```diff\n+ import com.rnimmersive.RNImmersiveModule;\n...\n\npublic class MainActivity extends ReactActivity {\n  ...\n+ @Override\n+ public void onWindowFocusChanged(boolean hasFocus) {\n+   super.onWindowFocusChanged(hasFocus);\n+\n+   if (hasFocus \u0026\u0026 RNImmersiveModule.getInstance() != null) {\n+     RNImmersiveModule.getInstance().emitImmersiveStateChangeEvent();\n+   }\n+ }\n}\n```\n\n\n## Sample Component\n\nChange the code of `index.js` for testing: \n[example/index.sample.js](example/index.sample.js)\n\n\n## Common Problem\n\n#### Unified Compile Version\n###### solution from SudoPlz [react-native-keychain#68][l:issue68]\n\nWhen compile ReactNative android,\ndifferent package may set different compileSdkVersion and buildToolsVersion.\n\nTo force all the submodules to use the specified compileSdkVersion and buildToolsVersion,\nadd the following code to `android/build.gradle`:\n\n```\nsubprojects {\n    afterEvaluate {project -\u003e\n        if (project.hasProperty(\"android\")) {\n            android {\n                compileSdkVersion 27\n                buildToolsVersion \"27.0.3\"\n            }\n        }\n    }\n}\n```\n\n#### Packages missing from JCenter\n###### solution from kerwin1 [react-native-vector-icons#605][l:issue605]\n\nAround 2018/12/10, \nJCenter received a request from Google, to remove several binaries from their repository.\nBut some repos were removed by mistake, \ncausing error like: `Could not resolve com.android.tools.build:gradle:2.3.+.`.\n\nAs google removed `gradle v2.2.*` from `JCenter`, so many plugins not work.\nTo patch repositories for specific submodules,\nadd the following code to `android/build.gradle`:\n\n```\nbuildscript { ... }\nallprojects { ... }\nsubprojects {\n    if (project.name.contains('react-native-immersive')) {\n        buildscript {\n            repositories {\n                jcenter()\n                maven { url \"https://dl.bintray.com/android/android-tools/\"  }\n            }\n        }\n    }\n}\n```\n\n\n[i:npm]: https://img.shields.io/npm/v/react-native-immersive.svg\n[i:npm-dm]: https://img.shields.io/npm/dm/react-native-immersive.svg\n[l:npm]: https://npm.im/react-native-immersive\n[l:immersive]: https://developer.android.com/training/system-ui/immersive.html\n[l:release]: https://github.com/mockingbot/react-native-immersive/releases\n[l:issue68]: https://github.com/oblador/react-native-keychain/issues/68#issuecomment-304836725\n[l:issue605]: https://github.com/oblador/react-native-vector-icons/issues/605#issuecomment-446195008\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmockingbot%2Freact-native-immersive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmockingbot%2Freact-native-immersive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmockingbot%2Freact-native-immersive/lists"}