{"id":19312069,"url":"https://github.com/weblineindia/ios-otp-authentication","last_synced_at":"2026-03-11T03:01:49.425Z","repository":{"id":129984735,"uuid":"276647804","full_name":"weblineindia/iOS-OTP-Authentication","owner":"weblineindia","description":"This demo is of iOS based OTP Authentication, used to verify your mobile number with OTP (One Time Password).","archived":false,"fork":false,"pushed_at":"2021-12-10T10:48:01.000Z","size":420,"stargazers_count":13,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-07T22:07:03.489Z","etag":null,"topics":["firebase","firebase-oauth","firebase-otp","ios-demo","ios-developer-tools","ios-otpfield","ios-package","ios-swift","ios-swift-demos","mobile-number-verification","one-time-password","otp-authentication","otp-generator","otp-library","otp-verification","otpauth","swift-components","swift-library","swift-otpauth","swift-packages"],"latest_commit_sha":null,"homepage":"https://www.weblineindia.com/software-development-resources.html","language":"Swift","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/weblineindia.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2020-07-02T13:03:07.000Z","updated_at":"2025-05-28T02:54:16.000Z","dependencies_parsed_at":"2023-04-15T04:15:54.245Z","dependency_job_id":null,"html_url":"https://github.com/weblineindia/iOS-OTP-Authentication","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/weblineindia/iOS-OTP-Authentication","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weblineindia%2FiOS-OTP-Authentication","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weblineindia%2FiOS-OTP-Authentication/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weblineindia%2FiOS-OTP-Authentication/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weblineindia%2FiOS-OTP-Authentication/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/weblineindia","download_url":"https://codeload.github.com/weblineindia/iOS-OTP-Authentication/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weblineindia%2FiOS-OTP-Authentication/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30368540,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T21:41:54.280Z","status":"online","status_checked_at":"2026-03-11T02:00:07.027Z","response_time":84,"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":["firebase","firebase-oauth","firebase-otp","ios-demo","ios-developer-tools","ios-otpfield","ios-package","ios-swift","ios-swift-demos","mobile-number-verification","one-time-password","otp-authentication","otp-generator","otp-library","otp-verification","otpauth","swift-components","swift-library","swift-otpauth","swift-packages"],"created_at":"2024-11-10T00:32:36.421Z","updated_at":"2026-03-11T03:01:49.420Z","avatar_url":"https://github.com/weblineindia.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# iOS OTP Authentication\n\nThis demo is of iOS based OTP Authentication, used to verify your mobile number with OTP (One Time Password).\n\n## Table of contents\n- [iOS Support](#iOS-support)\n- [Demo](#demo)\n- [Features](#features)\n- [Getting started](#getting-started)\n- [Usage](#usage)\n- [Methods](#methods)\n- [Directive options](#directive-options)\n- [Want to Contribute?](#want-to-contribute)\n- [Need Help / Support?](#need-help)\n- [Collection of Components](#collection-of-Components)\n- [Changelog](#changelog)\n- [License](#license)\n- [Keywords](#Keywords)\n\n\n## iOS Support\n\nVersion - iOS 13.x or later\n\nWe have tested our program in above versions, however you can use it in other versions as well\n\n\n## Demo\n[![](OTP_Authentication.png)](https://github.com/weblineindia/iOS-OTP-Authentication/blob/master/OTP_Authentication.png)\n\n------\n\n## Features\n* Select country with flag \u0026 country code\n* Verify mobile number with OTP all over the world\n\n\n## Getting started\nDownload this sample project and import swift utility resource files in your project. \n\n## Usage\nProcess setup is described below to integrate in sample project.\n\nConfigure your required property of  countriesPickerVcObj\nAlso set delegate and implement method for call back selected country details\ne.g. \n\n    extension ViewController: CountriesViewControllerDelegate {   \n    func countriesViewController(_ countriesViewController: CountriesViewController, didSelectCountry country: Country) {\n        //Return last selected country details\n        }}\n\n### Create  CountryModel object for store last selected country details\n    var selectedCountry:CountryModel?\n\n\n## Methods\n\n### PinView Class For OTP(One Time Password)\n- Setup pinview and config validation you want to setup\nbelow field config \n1. Create PinView Outlet of StackView\n2. Access config form Pinview outlet properties\nsetup below validation base on your requirement\n---------------------------------------------------------------------------------------------------------\n        var config:PinConfig!     = PinConfig()\n        // Length of OTP\n        config.otpLength          = .six\n        // Secure text mask color\n        config.dotColor           = .black\n        config.lineColor          = #colorLiteral(red: 0.8265652657, green: 0.8502194881, blue: 0.9000532627, alpha: 1)\n        //Space beetween two text field\n        config.spacing            = 30\n        //set secure text\n        config.isSecureTextEntry  = true\n        //show place hodder\n        config.showPlaceHolder    = true\n---------------------------------------------------------------------------------------------------------\n\n### Setup text field delegate\n like Enter only specify values in textfield\n   \n    func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -\u003e Bool {\n        ///- For Phone number validation\n        if textField == txtPhoneNumberField {\n            let aSet = NSCharacterSet(charactersIn:\"0123456789\").inverted\n            let compSepByCharInSet = string.components(separatedBy: aSet)\n            let numberFiltered = compSepByCharInSet.joined(separator: \"\")\n            return string == numberFiltered\n        }\n        else{\n            return true\n        }\n    }\n    \n### setup OTP view\n    - setUpOTPView: this method provide setup of OTP text field like below\n\n\n### validateOtpAndVerifyViaServer\nvalidate number with server use of below method\n- enter OTP \n- callback response\n    \n      self.countriesPickerVcObj.verifyOTP(otpCode: \"123456\", onSuccess:(authDataResult,bool) , onFailure:(error,isError)\n\n\n ### send OTP to given details\n - enter country code\n - enter phone numner\n - call back validate details information\n \n       self.countriesPickerVcObj.validateContryAndPhoneNumber(contryCode: \"+1\", phoneNumber: \"9XXXXXXXXX\", isValidDetails:(isValid,strMsg)\n\n\n### validatePhoneNumber\n- Param \n  - number\n- callBack\n  - return validationId \u0026 error details\nthis method validate phone number and send OTP\n\n\n### verifyOTPAndSigIn\nParam\n - enter OTP\ncallback\n - AuthDataResult object \u0026 error details\n\n### sendOtpAfterValidatePhonenumber\nParam\n - view: for show indicator\n - phoneNowithCountryCode : for Example \"+919XXXXXXXX\"\n sucesss\n  - return isSendSucessOTP status of send otp or not \n  - return errorMessage show error\ncall this method after check text field details\n\n\n### verifyOTP\n Param\n  - otpCoed\nOnSuccess\n - AuthDataResult : get user data\n - isVarifyOTP : check otp verify or not\nonFailure\n - error : display error\n - isVarifyOTP : check otp verify or not\n\n------\n\n## Directive options\n\n### Firebase project setup steps\nCreate  Project setup in firebase console using below URL\nhttps://console.firebase.google.com/\n\u2028Please Enable Phone Number sign-in for your Firebase project in console    \nhttps://firebase.google.com/docs/auth/ios/phone-auth\n\nDownload GoogleService-Info.Plist file and add into project \ninstall firebase pod and run project \n\n\n### Pod installation process\nThe `OTPAuthentication` demo use in you app then same option as the `\u003cOTPAuthentication\u003e`\ninstall firebase pod\n- pod 'Firebase/Analytics'\n- pod 'Firebase/Auth'\n   \nshow country picker use of below method help of CountriesViewController class object\n- CountriesViewController.show(countriesViewController: self.countriesPickerVcObj, toVar: self)\n \n- select country and Phone number\n\n- Press send button to validate entered details and send OTP help of below mehods\n\n      FirebaseAuthenticate.firSharedInstance.sendOtpAfterValidatePhonenumber\n\n- Verify OTP with below method\n\n      FirebaseAuthenticate.firSharedInstance.verifyOTP\n      \n------\n\n## Want to Contribute?\n\n- Created something awesome, made this code better, added some functionality, or whatever (this is the hardest part).\n- [Fork it](http://help.github.com/forking/).\n- Create new branch to contribute your changes.\n- Commit all your changes to your branch.\n- Submit a [pull request](http://help.github.com/pull-requests/).\n\n------\n\n## Need Help? \nWe also provide a free, basic support for all users who want to use this OTP verification demo in project. In case you want to customize this OTP demo input to suit your development needs, then feel free to contact our [iOS\ndevelopers](https://www.weblineindia.com/hire-ios-app-developers.html).\n\n ------\n \n ## Collection of Components\n We have built many other components and free resources for software development in various programming languages. Kindly click here to view our [Free Resources for Software Development.](https://www.weblineindia.com/software-development-resources.html)\n \n------\n\n## Changelog\nDetailed changes for each release are documented in [CHANGELOG.md](./CHANGELOG.md).\n\n## License\n\n[MIT](LICENSE)\n\n[mit]: https://github.com/weblineindia/iOS-OTP-Authentication/blob/master/LICENSE\n\n## Keywords\nOTP, Firebase Authentication, One Time Password, OTP For iOS, OTP Authentication, Mobile Number Verficiation,\nOTP Verification, Firebase OTP Authentication, weblineindia\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweblineindia%2Fios-otp-authentication","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fweblineindia%2Fios-otp-authentication","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweblineindia%2Fios-otp-authentication/lists"}