In Java:

new

Handler

Looper

getMainLooper

()).

post

new

Runnable

()

@Override

public

void

run

()

// Call the desired channel message here.

});

In Kotlin:

Handler

Looper

getMainLooper

()).

post

// Call the desired channel message here.

Jumping to the main thread in iOS

To comply with channel’s main thread requirement,
you might need to jump from a background thread to
iOS’s main thread to execute a channel method.
You can accomplish this in iOS by executing a
block on the main dispatch queue: