Skip to content

Instantly share code, notes, and snippets.

@davidmuzi
Created September 22, 2017 00:36
Android button handler
private void onButtonClick(EmbeddedAppButton button) {
if (button.hasRoutableHref()) {
Router.getInstance().launch(getShopifyActivity(), button.getHref());
} else {
String script = "this[\"__extension\"].send(\"" + button.getPostMessage() + "\");";
webView.evaluateJavascript(script, value -> {});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment