-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathOSIABFlowHelperInterface.kt
More file actions
26 lines (23 loc) · 1.1 KB
/
OSIABFlowHelperInterface.kt
File metadata and controls
26 lines (23 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package com.outsystems.plugins.inappbrowser.osinappbrowserlib.helpers
import com.outsystems.plugins.inappbrowser.osinappbrowserlib.OSIABEvents
import com.outsystems.plugins.inappbrowser.osinappbrowserlib.RequiresEventBridgeRegistration
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Job
interface OSIABFlowHelperInterface {
/**
* Launches a CoroutineScope to collect events from SharedFlow in OSIABEvents.
* Then, it simply sends the collected event in the onEventReceived callback.
* @param browserId Identifier for the browser instance to emit events to
* @param scope CoroutineScope to launch
* @param onEventReceived callback to send the collected event in
*
* @note For Android API 28+, you must call [OSIABEvents.registerReceiver] once during your application
* or activity lifecycle to ensure events from the isolated browser process are correctly received and bridged.
*/
@RequiresEventBridgeRegistration
fun listenToEvents(
browserId: String,
scope: CoroutineScope,
onEventReceived: (OSIABEvents) -> Unit
): Job
}