Resume activation after a restart
Check for a saved operation before checking general activation. An existing wallet may still need PIS, and a consumer with an active wallet may have an unfinished attempt to link another bank account.
1. Restore the SDK session
Re-create the SDK with the same configuration. It loads its stored session. If a protected call returns UNAUTHORIZED, use login or apply a renewed host-supplied session, then check progress again.
2. Check for an interrupted operation
val pending = sdk.walletOnboarding.pendingProgress(provider)let pending = try await sdk.walletOnboarding.pendingProgress(provider: provider)A non-null result describes the saved operation's current server state. Continue it with resumePendingRegistration on Android or resumePendingWalletRegistration on iOS. These methods retain the saved AIS consent and do not start a fresh AIS authorisation.
A null/nil result means there is no saved operation to recover, or the SDK has cleared a completed or no-longer-valid record. It does not prove that general wallet activation is complete. Check progress next.
3. Continue from the current state
Use this helper after sign-in and when the consumer taps Continue. It opens UI only if a step is outstanding. Pass a foreground Android activity or a visible iOS view controller.
suspend fun continueWallet(
sdk: WolletteSdk,
activity: Activity,
provider: ApiContextProvider,
): WalletOnboardingProgress {
if (sdk.walletOnboarding.pendingProgress(provider) != null) {
val pendingResult = sdk.walletOnboarding.resumePendingRegistration(activity, provider)
if (pendingResult != WalletOnboardingProgress.Complete) return pendingResult
}
val current = sdk.walletOnboarding.progress(provider)
return if (current == WalletOnboardingProgress.Complete) current
else sdk.walletOnboarding.resumeRegistration(activity, provider)
}@MainActor
func continueWallet(
sdk: WolletteSDK,
presenting viewController: UIViewController,
provider: any ApiContextProvider
) async throws -> WalletOnboardingProgress {
if try await sdk.walletOnboarding.pendingProgress(provider: provider) != nil {
let result = try await sdk.resumePendingWalletRegistration(
presenting: viewController, provider: provider
)
if result != .complete { return result }
}
let current = try await sdk.walletOnboarding.progress(provider: provider)
if current == .complete { return current }
return try await sdk.resumeWalletRegistration(
presenting: viewController, provider: provider
)
}Android imports: android.app.Activity and the com.wollette types shown. iOS imports: UIKit and WolletteApp. The complete helper is also included in the native starters.
Handle Complete, Needs and Griffin as described in Activate the wallet. Fetch the wallet for display after completion. The UI should distinguish a pending review from a failed operation and offer Continue when appropriate.
Which resume method to use
| Situation | Method |
|---|---|
pendingProgress returns a value | resumePendingRegistration / resumePendingWalletRegistration |
| No saved operation; initial activation is incomplete | resumeRegistration / resumeWalletRegistration |
| Consumer deliberately wants to link another bank account | addAccount / addWalletAccount; see Read the wallet, linked accounts and transactions |
start and ordinary resumeRegistration share the general activation state machine. They do not replace the targeted recovery method. Calling targeted recovery without a saved record returns Complete without starting a new flow; that return alone is not a general activation check.
What the SDK saves
Before opening PIS, the SDK stores the consumer ID, AIS consent ID and whether the operation is account linking. Android uses an app-private file excluded from backup; iOS uses Keychain. Server reads still decide whether the step is complete.
The record survives an interrupted flow. The SDK clears it on completion, explicit user cancellation, clear, or a switch to another consumer. It also removes an unusable record when its AIS consent is no longer valid. Your app does not need to store duplicate form data.
Recovery starts at the point where this record exists. An interruption before PIS has been prepared may have no saved record; use general progress and offer the appropriate next action.
Check Griffin status without opening a form
val registration = sdk.walletOnboarding.registrationStatus(provider)let registration = try await sdk.walletOnboarding.registrationStatus(provider: provider)Use registration.mode to show Start, Resume, Verify, Pending, Retry or Accepted. This status concerns Griffin only; it does not confirm AIS, PIS or wallet readiness.
Test recovery
- Close the app after BaaS account creation but before PIS finishes. It must still offer the outstanding step.
- Interrupt PIS while adding another account. Resume the saved consent rather than starting new AIS.
- Return after completion. No recovery form should open.
- Cancel explicitly, then return. The saved operation should be gone; re-check general progress.
- Switch consumers. The previous consumer's saved operation must not appear.