Skip to content

Commit

Permalink
Fix framework crash
Browse files Browse the repository at this point in the history
  • Loading branch information
pmerlet-at-didomi committed Dec 5, 2024
1 parent 68a6f42 commit 3a2025e
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import io.didomi.sdk.functionalinterfaces.DidomiEventListener
import io.flutter.plugin.common.EventChannel
import org.json.JSONObject
import io.didomi.sdk.models.CurrentUserStatus.VendorStatus
import android.os.Handler
import android.os.Looper

/**
* Handler for SDK events
Expand Down Expand Up @@ -255,7 +257,9 @@ class DidomiEventStreamHandler : EventChannel.StreamHandler, DidomiEventListener
private fun sendEvent(eventType: String, arguments: Map<String, *>? = null) {
val event = mutableMapOf<String, Any?>("type" to eventType)
arguments?.also { event.putAll(it) }
this.eventSink?.success(event)
Handler(Looper.getMainLooper()).post {
this.eventSink?.success(event)
}
}

// Request to execute a specific syncAcknowledged callback. It returns **true** if the API Event was sent, **false** otherwise.
Expand Down

0 comments on commit 3a2025e

Please sign in to comment.