You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Callback not triggered after connecting device via Settings intent #106
Hi
I'm using the following code to launch the Zettle Settings screen, where the user can connect a payment device. After the device is connected, I expect the result to be returned to the ActivityResultLauncher so I can save the connected device. However, the callback is not triggered after connecting a device. It only triggers (with a cancel state) after the user manually presses the back arrow in the Settings screen.
val connectLauncher =
rememberLauncherForActivityResult(ActivityResultContracts.StartActivityForResult()) { activityResult ->
if (activityResult.resultCode != Activity.RESULT_OK) {
return@rememberLauncherForActivityResult
}
when (activityResult.data?.zettleResult()) {
is ZettleResult.Completed<*> -> {
viewModel.dispatchIntent(ConnectPaymentDeviceIntent.SaveDevice)
}
else -> {}
}
}
val intent = CardReaderAction.Settings.show(context)
connectLauncher.launch(intent)
Expected behavior:
After the user connects a device via the Zettle Settings screen, the result should be returned, triggering the ZettleResult.Completed case.
@aliiraj Thank you for reaching out and good question about the Readers Settings screen. As you pointed out, the CardReaderAction.Settings.show action is designed to only launch the UI screen and does not return data via ActivityResult. I will share your feedback with the team for internal review, and we will keep you informed of any updates.
Hi @aliiraj, we have a follow-up question regarding this function. Could you please provide more details about its intended use cases? If it's not convenient to discuss this here, please open a ticket using this link: Developer Support - SDK payments and refunds Thanks!
Activity
CheZhongSdk commentedon Apr 4, 2025
@aliiraj Thank you for reaching out and good question about the Readers Settings screen. As you pointed out, the
CardReaderAction.Settings.showaction is designed to only launch the UI screen and does not return data via ActivityResult. I will share your feedback with the team for internal review, and we will keep you informed of any updates.CheZhongSdk commentedon Apr 8, 2025
Hi @aliiraj, we have a follow-up question regarding this function. Could you please provide more details about its intended use cases? If it's not convenient to discuss this here, please open a ticket using this link: Developer Support - SDK payments and refunds Thanks!