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
To obtain the device id, call the
getDeviceId method. This method will be useful for device specific operations such as deletion.
denyRequest to handle approval requests.
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.
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:
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.
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