Start a Project

Integrate AccountKit in iOS App to verify email address or mobile number through SMS

Dear Folks,

I hope you are doing well. Today I am going to explain each the process of integration of AccountKit in iOS App. Account Kit lets people quickly register for and log in to your app by using just their phone number or email address — no password needed. It’s reliable, easy to use.

Step 1: Just create an app in Facebook Developer account and register your app bundle id there. Fill Privacy Url -> Save Changes –> Publish App and make it available for public use.

Step 2:  Add the following to your Podfile and install the library using Cocoapod


If your system doesn’t have Cocoapod install then follow this official guideline for installing -> https://guides.cocoapods.org/using/getting-started.html

Step 3: Add both your Facebook App ID and Account Kit Client Token to your fileInfo.plist as strings. Make sure you have enabled Account Kit in the App Dashboard. You’ll find the Account Kit client token in the Account Kit section of the App Dashboard. The application name will be used in the UI of the login screen.

Remember to fill in your app ID for both the FacebookAppID and CFBundleURLSchemes keys.

Step 4: Add below Singleton class anywhere in your XCode Project.

Step 5: Now Move to that particular class in which you want to add a button for email verification and SMS verification. Here I have added a notification observer to check whether the user has logged out after verification or not. If you have to perform any task just after his logging out, this will be helpful.

Add below line wherever you want to add an observer, Here I have added it in viewDidLoad() method.

Step 6: Now create a class property for MobikulAccountKit Class.

Step 7: Add below the line for a method in which you want to write code for email verification.

 

Step 8: Add below the line for a method in which you want to write code for SMS verification.

Step 9: Add these methods also to handle errors or success.

I hope you enjoyed this AccountKit tutorial, and if you have any questions just comment below. Thanks for reading. Keep coding!!

 

Exit mobile version