{"id":49476818,"url":"https://github.com/shimo-react-native/react-native-safe-area-emitter","last_synced_at":"2026-04-30T20:03:31.165Z","repository":{"id":56297419,"uuid":"111870076","full_name":"shimo-react-native/react-native-safe-area-emitter","owner":"shimo-react-native","description":"Safe area event emitter of iOS for react-native","archived":false,"fork":false,"pushed_at":"2020-11-16T09:00:57.000Z","size":182,"stargazers_count":5,"open_issues_count":2,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-10-12T05:13:08.172Z","etag":null,"topics":["iphonex","react-native","safe-area"],"latest_commit_sha":null,"homepage":"","language":"Objective-C","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/shimo-react-native.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":"2017-11-24T03:02:30.000Z","updated_at":"2020-11-23T03:44:26.000Z","dependencies_parsed_at":"2022-08-15T16:10:45.640Z","dependency_job_id":null,"html_url":"https://github.com/shimo-react-native/react-native-safe-area-emitter","commit_stats":null,"previous_names":["shimohq/react-native-safe-area-emitter"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/shimo-react-native/react-native-safe-area-emitter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shimo-react-native%2Freact-native-safe-area-emitter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shimo-react-native%2Freact-native-safe-area-emitter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shimo-react-native%2Freact-native-safe-area-emitter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shimo-react-native%2Freact-native-safe-area-emitter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shimo-react-native","download_url":"https://codeload.github.com/shimo-react-native/react-native-safe-area-emitter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shimo-react-native%2Freact-native-safe-area-emitter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32475193,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"ssl_error","status_checked_at":"2026-04-30T13:12:06.837Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["iphonex","react-native","safe-area"],"created_at":"2026-04-30T20:03:30.228Z","updated_at":"2026-04-30T20:03:31.154Z","avatar_url":"https://github.com/shimo-react-native.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-native-safe-area-emitter\n\nSafe area event emitter of iOS for react-native\n\n## Install\n\n```sh\nnpm i react-native-safe-area-emitter\nreact-native link react-native-safe-area-emitter\n```\n\n## Usage\n\n### Constants\n\n* `rootSafeArea` get initialized safe area for root view\n\n### Method\n\n* `getSafeArea(reactTag)` get fafe area for a view\n* `getRootSafeArea()` get safe area for root view\n* `addListener(eventType, listener, context)` add event listener\n* `addSafeAreaListener(listener, context)` add event listener for all view\n* `addRootSafeAreaListener(listener, context)` add event listener for root view\n\n## Example\n\n```js\nimport {\n  findNodeHandle\n} from 'react-native';\nimport RNSafeArea from 'react-native-safe-area-emitter';\n\nexport default class App extends Component\u003c{}\u003e {\n\n  constructor(props) {\n    super(props);\n    console.log('SafeAreaExample', 'rootSafeArea', RNSafeArea.rootSafeArea);\n    RNSafeArea.getRootSafeArea().then((result) =\u003e {\n      console.log('SafeAreaExample', 'getRootSafeArea', result);\n    });\n  }\n\n  componentDidMount() {\n    const welcomReactTag = this.refs.welcome \u0026\u0026 findNodeHandle(this.refs.welcome);\n    RNSafeArea.getSafeArea(welcomReactTag || 0).then((result) =\u003e {\n      console.log('SafeAreaExample', 'getSafeArea', result);\n    });\n\n    this._rootSafeAreaListener = RNSafeArea.addRootSafeAreaListener((result) =\u003e {\n      console.log('SafeAreaExample', 'listenRootSafeArea', result);\n    });\n    this._safeAreaListener = RNSafeArea.addSafeAreaListener((result) =\u003e {\n      console.log('SafeAreaExample', 'listenSafeArea', result);\n    });\n  }\n\n  componentWillUnmount() {\n    this._safeAreaListener.remove();\n    this._rootSafeAreaListener.remove();\n  }\n\n  _rootSafeAreaListener = null;\n  _safeAreaListener = null;\n\n  render() {\n    return (\n      \u003cView style={styles.container}\u003e\n        \u003cText\n          ref=\"welcome\"\n          style={styles.welcome}\u003e\n          Welcome to React Native!\n        \u003c/Text\u003e\n        \u003cText style={styles.instructions}\u003e\n          To get started, edit App.js\n        \u003c/Text\u003e\n        \u003cText style={styles.instructions}\u003e\n          {instructions}\n        \u003c/Text\u003e\n      \u003c/View\u003e\n    );\n  }\n}\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshimo-react-native%2Freact-native-safe-area-emitter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshimo-react-native%2Freact-native-safe-area-emitter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshimo-react-native%2Freact-native-safe-area-emitter/lists"}