After onboarding, the next time users open the mobile app, the restore flow will be started. Basically, the restore flow consists of the screen unlocking the app with either the passcode or biometric information, if enabled. The restore flow will also check whether the passcode is expired based on the setting defined in the passcode policy. If the passcode is expired, the restore flow will ask the user to create a new passcode and launch a “change passcode” flow.
Similar to the onboarding flow, the restore flow will also listen to the flow states and notify corresponding events to the client code.
The flows component will automatically determine whether to use the onboarding or restore flow, so the app can use the same client code for both flows.
-
Open the project you previously created using the SAP BTP SDK Wizard for Android.
-
In Android Studio, on Windows, press Ctrl+N
, or, on a Mac, press command+O
, and type WelcomeActivity
to open WelcomeActivity.java
.
-
On Windows, press Ctrl+F12
, or, on a Mac, press command+F12
, and type startFlow
to move to the startFlow
method. As we mentioned in Get Familiar with the Flows Component by a Wizard Generated Application, this method starts an onboarding flow. After onboarding, the next time the app starts, the same method is called and the Flows component detects that the user is already onboarded and starts the restore flow. The client code does not need handle the logic to explicitly start a restore flow.
-
The restore flow will notify the same events as the onboarding flow and one additional UnlockWithPasscode
event, which is specific to the restore flow. When the app is unlocked using a passcode, the client code can get the passcode from the onUnlockWithPasscode
callback of the FlowStateListener
instance and open the secure store. Customize the Onboarding Flow explains the events notified in the onboarding flow.
-
When the app is put to background, the Flows component will monitor whether the passcode is timed out based on the “Lock Timeout” value defined in the passcode policy. When the passcode is timed out and the app is put to foreground again, a timeout unlock flow will be started. This is the FlowType.TIMEOUT_UNLOCK
flow type, which is used internally by the Flows component for the passcode timeout scenario. This flow’s function is exactly the same as that of the restore flow.