postMessage method

Future<CustomTabsPostMessageResultType> postMessage(
  1. String message
)

Sends a postMessage request using the origin communicated via requestPostMessageChannel. Fails when called before PlatformChromeSafariBrowserEvents.onMessageChannelReady event.

message – The message that is being sent.

Returns an integer constant about the postMessage request result. Will return CustomTabsPostMessageResultType.SUCCESS if successful.

Officially Supported Platforms/Implementations:

Parameters - Officially Supported Platforms/Implementations:

  • message: all platforms

Use the PlatformChromeSafariBrowser.isMethodSupported method to check if this method is supported at runtime.

Implementation

Future<CustomTabsPostMessageResultType> postMessage(String message) =>
    platform.postMessage(message);