My LauncherActivity.java file has the following code:
package in.example.app; import android.content.pm.ActivityInfo; import android.net.Uri; import android.os.Build; import android.os.Bundle; public class LauncherActivity extends com.google.androidbrowserhelper.trusted.LauncherActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Setting an orientation crashes the app due to the transparent background on Android 8.0 // Oreo and below. We only set the orientation on Oreo and above. This only affects the // splash screen and Chrome will still respect the orientation. // See https://github.com/GoogleChromeLabs/bubblewrap/issues/496 for details. if (Build.VERSION.SDK_INT > Build.VERSION_CODES.O) { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); } else { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); } } @Override protected Uri getLaunchingUrl() { // Get the original launch Url. Uri uri = super.getLaunchingUrl(); return uri; } } How can I enable postMessage communication between my TWA & browser? I tried following this guide - https://developer.chrome.com/docs/android/post-message-twa but it is not clear where to put the given code.