Event handling
Our Wrapper-plugin exposes a StreamController over which we broadcast the SDK related events that should be handled.
It is up to the user to decide on how to integrate this functionality within their application structure.
Obtaining the StreamController
As we mentioned previously, our plugin exposes one main StreamController over which the different SDK related events will be send.
This controller can be obtained by accessing the variable through:
Example: Listening to Events
A developer can decide to use one listener or add and handle specific listeners for each event based on their preference.
In the following example we will respond to one specific event, the OpenPinCreation
Event, which can occur during the user registration flow as described in Create Pin.
A more elaborate example can be found by looking at out Example app.
Event Overview
Each event that we expose is an extension of an OWEvent
and may contain additional event related information within their attributes:
OWEvent | Attribute(s) | Scenario |
---|---|---|
HandleRegisteredUrlEvent | String url | Registration with browser IdP |
InitCustomRegistrationEvent | OWCustomInfo? customInfo, String providerId | Registration with Custom IdP |
FinishCustomRegistrationEvent | OWCustomInfo? customInfo, String providerId | Registration with Custom IdP |
OpenFingerprintEvent | Authenticate using Fingerprint | |
CloseFingerprintEvent | Authenticate using Fingerprint | |
ShowScanningFingerprintEvent | Authenticate using Fingerprint | |
nextFingerprintAuthenticationAttempt | Authenticate using Fingerprint | |
OpenAuthOtpEvent | String message | Mobile authentication with OTP |
CloseAuthOtpEvent | Mobile authentication with OTP | |
OpenPinCreationEvent | Create Pin | |
ClosePinCreationEvent | Create Pin | |
PinNotAllowedEvent | error | Create Pin |
OpenPinAuthenticationEvent | Authenticate using Pin Flow | |
ClosePinAuthentication | Authenticate using Pin Flow | |
NextPinAuthenticationAttemptEvent | OWAuthenticationAttempt authenticationAttempt | Authenticate using Pin Flow |