Rate this page:

Quick Reference

The TwilioAuth SDK has been deprecated. This means that while we will continue to provide maintenance support for existing customers and their usage, we discourage new customers and new usage, as we may shut it down entirely in the future. We strongly recommend using the Verify Push SDK instead, which currently supports the Push channel, and will be enhanced to support the TOTP channel in the future.

For iOS projects, make sure you import the framework in the files in which you will interact with the SDK.


                    Make sure the current device is registered by calling isDeviceRegistered.


                          To obtain the device id, call the getDeviceId method. This method will be useful for device specific operations such as deletion.


                                Approval Requests

                                To create a new approval request, you can follow the instructions here or use the pre-built Authy API scripts available here.

                                Call getApprovalRequests to get the list of approval requests:


                                      Call approveRequest or denyRequest to handle approval requests.


                                            If you configured a callback url in the Dasboard to receive notifications when a user approves/denies a request it will be called after this step. Otherwise you should poll the OneTouch API. For more details go here.

                                            Push notification handling

                                            In order to interact with the request notifications you will need to update the push token every time it changes in the device.


                                                  Once the notification arrives, you will need to pull it from the TwilioAuth API. The reason for this is that it contains sensitive information, so the device must retrieve it through the TwilioAuth SDK instead of having it directly in the notification payload.


                                                        Time-based One Time Passwords (TOTP)

                                                        As a fallback when OneTouch requests aren’t functioning (more specifically, if the user is in Airplane mode, has no Wi-Fi / cell connection, misses the push notification or simply prefers to type the generated code in for validation instead of pushing the Approve/Deny button) you can obtain a TOTP.

                                                        The TOTP will be valid for 30 seconds and you can obtain it as follows:


                                                              Additionally your class must implement the AUTTOTPDelegate protocol (on iOS) or the TOTPCallback interface (on Android) to be able to receive the TOTP:


                                                                    Important note:

                                                                    This delegate/callback listener will receive a TOTP immediately, which will be generated with the local token. Then the SDK will try to sync the token with TwilioAuth API in the background. If that token differs (i.e. digits changed, seed was rotated, or token was removed) your delegate will receive another call with the newest TOTP.

                                                                    Helper methods

                                                                    To delete the device local data you can use the following method:


                                                                          Please note this method doesn't delete the device in the Authy backend, it only clears the data stored locally on the device. For example, you may use this method as a logout option inside your app.


                                                                          If you find any inconveniences while following this guide please file us an issue

                                                                          Android issues on

                                                                          iOS issues on

                                                                          Rate this page:

                                                                          Need some help?

                                                                          We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.


                                                                                Thank you for your feedback!

                                                                                Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

                                                                                Sending your feedback...
                                                                                🎉 Thank you for your feedback!
                                                                                Something went wrong. Please try again.

                                                                                Thanks for your feedback!

                                                                                Refer us and get $10 in 3 simple steps!

                                                                                Step 1

                                                                                Get link

                                                                                Get a free personal referral link here

                                                                                Step 2

                                                                                Give $10

                                                                                Your user signs up and upgrade using link

                                                                                Step 3

                                                                                Get $10

                                                                                1,250 free SMSes
                                                                                OR 1,000 free voice mins
                                                                                OR 12,000 chats
                                                                                OR more