set Initial Context
Sets the initial context to pass to the web view. You can pass in either a Map or a String that will be parsed into a JSON object.
Example usage with a Map (kotlin):
val map: Map<String, Any> = mapOf(
"foo" to "bar",
"ionic" to "portals"
"num" to 42
)
builder = builder.setInitialContext(map)
Content copied to clipboard
Example usage with a String (kotlin):
builder = builder.setInitialContext("{\"foo\": \"bar\"}")
Content copied to clipboard
Example usage with a Map (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)
);
builder = builder.setInitialContext(map);
Content copied to clipboard
Example usage with a String (java):
builder = builder.setInitialContext("{\"foo\": \"bar\"}");
Content copied to clipboard
Return
the instance of the PortalBuilder with the initial context set
Parameters
initial Context
the initial context to add to the Portal