Pauses execution if device is locked and informs users they need to unlock their device to continue.
You can allow certain actions to be inaccessible while the device is locked and inform the user to unlock their phone by using this unlock key.
In order to execute any actions while the phone is in the locked state, the proper permissions must be set in the capsule.bxb file.
Using action validation:
collect {
input (input) {
type (InputStruct)
min (Required) max (One)
validate {
unlock {
dialog("Unlock your phone!") // Optional, if not specified a default dialog is shown.
}
}
}
}Catching the error at the output level:
output (Output) {
throws {
error (LockedState) {
on-catch {
unlock {
dialog("Unlock your phone!") // Optional, if not specified a default dialog is shown.
}
}
}
}
}| dialog optional | Dialog used to inform the user that the device needs to be unlocked |
Copyright 2025 Samsung All rights reserved