Please follow the below steps to integrate this control in your next project.
- Ability to customize according to your requirement.
- Ability send or resend SMS for a verification code. If SMS is not delivered to your device then you can perform skip.
- Easy to integrate.
- Fully customized design layout with theme support.
To use this component in your project you need to perform below steps:
- Configure Google Firebase and Google Console Application to get API Key & Plist file from below URL.
- Install below list of CocoaPods in your application.
pod 'Firebase/Auth'
pod 'SVProgressHUD'
- Add ‘GoogleService-Info.plist’ in your project and you will get this file from Google Firebase Console.
Note: If you not add ‘GoogleService-Info.plist’ file in your application then application will crash.
- Configure firebase in
didFinishLaunchingWithOptions
method.
// Configure Firebase
FirebaseApp.configure()
-
Copy ‘MobileVerification’ folder and add it to your project and make sure you have checked “Copy if needed” option.
-
Import '#import "MobileVerification.h"' where you want to use. If you are using swift then import this file into Bridging-Header file.
-
Configure Firebase Phone Verification theme.
// Set Firebase Auth Layout Theme.
let theme = MVTheme()
theme.backgroundColor = UIColor.white
theme.textColor = UIColor.black
theme.bodyFontName = "HelveticaNeue"
theme.topbarColor = UIColor.black
theme.topbarTextColor = UIColor.white
theme.titleFontName = "HelveticaNeue-Medium"
MobileVerification.shared().theme = theme
- Implement Firebase Phone Verification from below code.
MobileVerification.verifyNumber("", title: "Firebase", withRootViewController: self) { (phoneNumber, error, isVerified) in
if error == nil {
print("Status: \(isVerified ? "Verified" : "Not Verified")\n\nPhone Number: \(phoneNumber ?? "-")")
}
else {
print("Error: \(error?.localizedDescription ?? "-")")
}
}
Copyright (c) 2018 INTUZ
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.