Zhiting home cloud – development guide web: extended development [jsbridge use]

Time:2021-11-30

Jsbridge usage

【1】 Overview

Zhiting Web Professional Edition is used as an auxiliary program for zhiting app, so it is inevitable to interact with the app. Jsbridge is our interaction bridge. Through jsbridge, we can interact with the app smoothly.

【2】 WebView UA transformation

Overview: in order to distinguish it from embedding H5 in the app, a unique UA is added to judge whether it is embedded in the app. The string “zhitingua” is added to the original UA
We can judge UA whether our zhiting professional edition is opened in the app

Zhiting home cloud - development guide web: extended development [jsbridge use]

【3】 JS SDK documentation

App directly injects a zhiting global object into WebView and implements the invoke method. We can call the methods provided in app as long as we call this method and pass in the corresponding parameters.

(1) View app networking types

Zhiting home cloud - development guide web: extended development [jsbridge use]

(2) Set Title Properties

Zhiting home cloud - development guide web: extended development [jsbridge use]

(3) Get user information

Zhiting home cloud - development guide web: extended development [jsbridge use]

(4) Is it a professional app

Zhiting home cloud - development guide web: extended development [jsbridge use]

Deploy application

Deploying an application refers to the process of compiling or building code and hosting the generated JavaScript, CSS and HTML on the web server.

Build and host your app

After the development of our project, how to release it must first build our project

 npm run build

After executing this command in the root directory, the project’s build file will be output to the dist folder. Our next step is to host our dist folder on the server and configure the request forwarding and domain name. So far, our application has been successfully deployed.

Recommended Today

On the mutation mechanism of Clickhouse (with source code analysis)

Recently studied a bit of CH code.I found an interesting word, mutation.The word Google has the meaning of mutation, but more relevant articles translate this as “revision”. The previous article analyzed background_ pool_ Size parameter.This parameter is related to the background asynchronous worker pool merge.The asynchronous merge and mutation work in Clickhouse kernel is completed […]