set Initial Context
Sets the initial context to pass to the web view.
Example usage (kotlin):
val map: Map<String, Any> = mapOf(
"foo" to "bar",
"ionic" to "portals"
"num" to 42
)
portal.setInitialContext(map)
Content copied to clipboard
Example usage (java):
Map<String, Object> map = Map.ofEntries(
new AbstractMap.SimpleEntry<String, @NotNull Object>("foo", "bar"),
new AbstractMap.SimpleEntry<String, @NotNull Object>("ionic", "portals"),
new AbstractMap.SimpleEntry<String, @NotNull Object>("num", 42)
);
portal.setInitialContext(map);
Content copied to clipboard
Parameters
initial Context
A map containing key/pair values that will be converted to a JavaScript object in the web view
Sets the initial context to pass to the web view.
Example usage (kotlin):
portal.setInitialContext("{\"foo\": \"bar\"}")
Content copied to clipboard
Example usage (java):
portal.setInitialContext("{\"foo\": \"bar\"}");
Content copied to clipboard
Parameters
initial Context
a JSON string that will be converted to a JavaScript object in the web view