can pega mobile app run skip OOTB log out confirmation and execute code with or after OOTB logoff functionality
For Apria we are adding credit card payments via a bluetooth device to an offline mobile iPad app. We need to call the device vendor's SDK to deintialize the payment device via a javascript method we are implementing as part of user log out, but only when the user has clicked "Log off" after being asked "Are you sure you want to log off?", and not if they select "Cancel".
The existing code calls pega.control.Actions.prototype.logOff() in pzpega_control_actions_logOff.js which in turn calls the Pega SDK 's pega.mobile.sdk.authentication.invalidate() which appears to display the dialog described above. When we tried to use then() as shown in the commented out part of the screenshot to call the deinitialization method after pega.mobile.sdk.authentication.invalidate() the app appeared to end prior to calling that method. We can't deinitalize prior to calling pega.mobile.sdk.authentication.invalidate() because the user might select "Cancel".
Is there a way to get the same functionality as pega.mobile.sdk.authentication.invalidate() without displaying the dialog? Or some other approach that would achieve the same thing?