{"id":15740552,"url":"https://github.com/mortada-codes/react-native-otp","last_synced_at":"2026-01-19T22:31:49.925Z","repository":{"id":123186286,"uuid":"176927929","full_name":"mortada-codes/react-native-otp","owner":"mortada-codes","description":null,"archived":false,"fork":false,"pushed_at":"2023-02-28T23:33:34.000Z","size":125,"stargazers_count":1,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-07T08:38:40.581Z","etag":null,"topics":["react-native-otp"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mortada-codes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-21T11:05:45.000Z","updated_at":"2023-03-07T02:12:33.000Z","dependencies_parsed_at":"2023-05-26T07:15:58.788Z","dependency_job_id":null,"html_url":"https://github.com/mortada-codes/react-native-otp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mortada-codes/react-native-otp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mortada-codes%2Freact-native-otp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mortada-codes%2Freact-native-otp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mortada-codes%2Freact-native-otp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mortada-codes%2Freact-native-otp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mortada-codes","download_url":"https://codeload.github.com/mortada-codes/react-native-otp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mortada-codes%2Freact-native-otp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28587241,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T20:45:59.482Z","status":"ssl_error","status_checked_at":"2026-01-19T20:45:41.500Z","response_time":67,"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":["react-native-otp"],"created_at":"2024-10-04T02:22:01.798Z","updated_at":"2026-01-19T22:31:49.907Z","avatar_url":"https://github.com/mortada-codes.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# react-native-react-native-otp\n\n## Getting started\n\n`$ npm install react-native-autodetect-otp --save`\n\n###  follow play servies docs to generate hash\n https://developers.google.com/identity/sms-retriever/verify\n### Manual installation\n\n\n#### Android\n\n1. Open up `android/app/src/main/java/[...]/MainActivity.java`\n  - Add `import com.reactlibrary.RNReactNativeOtpPackage;` to the imports at the top of the file\n  - Add `new RNReactNativeOtpPackage()` to the list returned by the `getPackages()` method\n2. Append the following lines to `android/settings.gradle`:\n  \t```\n  \tinclude ':react-native-react-native-otp'\n  \tproject(':react-native-react-native-otp').projectDir = new File(rootProject.projectDir, \t'../node_modules/react-native-react-native-otp/android')\n  \t```\n3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:\n  \t```\n      compile project(':react-native-react-native-otp')\n  \t```\n4. add this code to manifest\t\t\n```\n\t\t\u003creceiver android:name=\".SmsBroadcast\" android:exported=\"true\"\u003e\n  \t  \u003cintent-filter\u003e\n        \u003caction android:name=\"com.google.android.gms.auth.api.phone.SMS_RETRIEVED\"/\u003e\n    \t\u003c/intent-filter\u003e\n\t\t\u003c/receiver\u003e\n```\n\n## Usage\n```javascript\nimport { NativeEventEmitter, NativeModules } from 'react-native';\nimport RNReactNativeOtp from 'react-native-autodetect-otp';\n\nconst { ModuleWithEmitter } = NativeModules;\n\nconst eventEmitter = new NativeEventEmitter(ModuleWithEmitter);\n\nconst onReceiveOTP = ({otp}) =\u003e {\n  console.log(otp);\n}\n\nconst onOTPTimeout = (event) =\u003e {\n  console.log(event);\n}\n\nclass VerifyOTP extends Component{\n\n\tasync componentDidMount(){\n\tconst result = await \tRNReactNativeOtp.requestSMS();\nthis.unsubscribe =    ReactNativeOtp.detectorEmitter((result)=\u003e{\n            // you will get the sms message here\n          })    \n          })\n}\n\ncomponentWillUnmout(){\n\tthis.unsubscribe()\n\ttimeoutSubscription.remove();\n}\n}\n\n\n```\n  \n  ```\n  result object properties:\n  result.otp : the sms message\n  result.status : fail || success\n  ```\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmortada-codes%2Freact-native-otp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmortada-codes%2Freact-native-otp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmortada-codes%2Freact-native-otp/lists"}