Front end – Daily learning log

2021.3.10 – JSBridge learning

Learning Record:

  • Purpose of existence: to solve Web and Native communication problems

  • Native tuning Web- Executes js methods directly

    • Through the android webview. EvaluateJavascript (js), invoke the web method
    • IOS WKWebview through [the webview evaluateJavascript], perform js method
  • Web tune Native implementation

    • Obtain URL parameters through the URL and Schema protocols
    • And Native convention methods, Native implementation methods, Web calls
      • Android defines showDialog in NativeBridge by addJavascriptInterface(new NativeBridge(this),’NativeBridge’)
      • IOS provides methods via UIWebView or WKWebView
      • Web calling convention methods window. NativeBridge. ShowDialog
  • Open source three parties: DSBridge, jsBridge

Learning links:Juejin. Cn/post / 693681…