Backup Options

Password/Pin Backup

Allow customers to create a password/pin. Customers can either remember the password or store it in a password storage manager.

Implementation Requirements

  1. Create a UI for password input.

  2. Enforce password requirements. Customer can choose between password, PIN code, passcode, or any other text-based input.

  3. If user forgets password there are no additional recovery options.


// Imports...

class MainActivity : AppCompatActivity() {
    lateinit var portal: Portal
    lateinit var backupButton: Button
    // Your API instance.
    private val exchangeApi: Api = Api()
    // The user from your API instance.
    lateinit var user: User
    override fun onCreate(savedInstanceState: Bundle?) {
        backupButton = findViewById(
        backupButton.setOnClickListener { handleBackup() }

    private fun handleBackup() {
        CoroutineScope(Dispatchers.IO).launch {
            try {
                val backupConfigs = BackupConfigs(PasswordStorageConfig(password = PASSWORD))
                // Get an encryped client backup share.
                val backupShare = portal.backupWallet(
                                      backupMethod = BackupMethods.Password,
                                      backupConfigs = backupConfigs)  { status ->
                    // Do something with the status, such as update a progress bar
                    // or log the progress
                    Log.println(Log.INFO, "[Portal]", "Backup status: ${status.status} is done: ${status.done}")
                // Send the backup share to your API and store it.
                exchangeApi.storeCipherText(, backupShare)
                // ✅ Notify Portal that the backup share was stored! 🙌
            } catch (err: Throwable) {
                // ❌ Notify Portal that the backup share was not stored.

Google Drive Backup

See the docs on how toConfigure GDrive storage

Note - If you dont pass a backup option into portal.backupWallet() we will default to GDRIVE backup.

Last updated