The Mini App can receive events from the mini-app SDK, onto which a handler can be attached using the OpenWeb3.WebApp.onEvent(eventType, eventHandler) method. Inside eventHandler the this object refers to OpenWeb3.WebApp, the set of parameters sent to the handler depends on the event type. Below is a list of possible events:
EventType | Description |
---|---|
themeChanged | Occurs whenever theme settings are changed in the user's app (including switching to night mode). |
viewportChanged | Occurs when the visible section of the Mini App is changed. eventHandler receives an object with the single field isStateStable. If isStateStable is true, the resizing of the Mini App is finished. If it is false, the resizing is ongoing (the user is expanding or collapsing the Mini App or an animated object is playing). The current value of the visible section’s height is available in this.viewportHeight. |
mainButtonClicked | Occurs when the main button is pressed. |
backButtonClicked | Occurrs when the back button is pressed. |
popupClosed | Occurrs when the opened popup is closed. |
qrTextReceived | Occurs when the QR code scanner catches a code with text data. |
scanQrPopupClosed | Occurs when the QR code scanner popup is closed by the user. |
clipboardTextReceived | Occurrs when the readTextFromClipboard method is called. |
writeAccessRequested | Occurs when the write permission was requested.
|
contactRequested | Occurrs when the user's phone number was requested.
|
biometricManagerUpdated | Occurs whenever BiometricManager object is changed. |
biometricAuthRequested | Occurs whenever biometric authentication was requested. |
biometricTokenUpdated | Occurs whenever the biometric token was updated. |