'How to generate a TOTP code in Swift Automation Testing?

I am new to Swift Automation Testing. I want to pass 2SV using TOTP. Do we have any function which takes the secret key and generates TOTP code.

I have a python script to generate TOTP code. Is there anyway it can be used in Swift?



Solution 1:[1]

No, natively Swift doesn't support generating TOTP.

But you can use this library: https://github.com/mattrubin/OneTimePassword

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Roland T.