preface

More and more H5 front-end interaction in the project and more and more knowledge points are used today to record how to interact with the H5 front-end data

Let’s just say that when we call the H5 link we need data on the H5 side so what data do we need according to the H5 front end

implementation

You can pass the parameters that H5 needs in the form of a concatenated Url. In this method, userName and userId are the parameters that H5 needs to pass in the concatenated Url

if (UserUtils.getUserInfo() ! = null) { String userName = UserUtils.getUserInfo().getUsername(); String userId = UserUtils.getUserInfo().getId() + ""; mWebView.loadUrl("http://brilliant.natapp1.cc? tel=" + userName + "&" + "id=" + userId); }Copy the code