Linker Wrapper Messages Structure

Linker wrapper post-message structure

Linker wrapper post-message must structure into two parts:

  1. Message: It is the unique identifier used to trigger any action on the mobile app side. It should be added to the web application side where the client decides to implement it. Linker's post-messages should be written using kebab-case as a convention.

  2. Payload: It is an optional part of the message that depends on the purpose of the message and is added when the user needs to send any value in the message. It should be written using JSON format.

Structure:

{webMessage:'message-id', payload: {...items}}

Example:

function myFunction() {
  if(window.isReactNativeApp){
      window.ReactNatieWebView.postMessage(webMessage: 'iap-purchase-request', payload: {sku: string});
  }
}

JS Injection Protocol

In the app side, it can inject JavaScript code in the web-view windows. It is a very important feature to...

Last updated