Article From:


Method 1: HTML+ encapsulation method, additional configuration, and use the specified method to pack.


  • imei: Device’s international mobile device identity code
  • imsi: Device’s international mobile user identification code
  • model: Type of equipment
  • vendor: Manufacturer of equipment
  • uuid: The unique identity of the device

Reference address:


Method two: reference plug-in mobile-detect.js can be obtained.

  1. console.log( );          // ‘Sony’  
  2. console.log( );           // ‘Sony’  
  3. console.log( md.tablet() );          // null  
  4. console.log( md.userAgent() );       // ‘Safari’  
  5. console.log( md.os() );              // ‘AndroidOS’  
  6. console.log(‘iPhone’) );      // false  
  7. console.log(‘bot’) );         // false  
  8. console.log( md.version(‘Webkit’) );         // 534.3  
  9. console.log( md.versionStr(‘Build’) );       // ‘4.1.A.0.562’  
  10. console.log( md.match(‘playstation|xbox’) ); // false 

Reference address:

Download address:


Method three: call the native method of app, and jsBrage get the JSON string.

  //appinteractiveVar flag;Var jsBridge = (function () {()Function connectWebViewJavascriptBridge (CALLback) {If (window.WebViewJavascriptBridge) {Callback (WebViewJavascriptBriDGE);} else {Document.addEventListener ('WebViewJavascriptBridgeReady', fun)Ction () {Callback (WebViewJavascriptBridge);}, false)}}ConnectWebViewJavascriptBridge (function (WebViewJavascriptBridge) {WebViewJAvascriptBridge.init (function (message, responseCallback) {});WebViewJavascriPtBridge.registerHandler ("contactsList", function (data, responseCallback) {PhoneNumbeRs= (data);});WebViewJavascriptBridge.registerHandler ("contacts", function (data)ResponseCallback) {Var datas=JSON.parse (data);If (currentNum==1) {;;$("#firstTxtN"Ame ").Val (;$("#firstTxtTel").Val (;}else {;;$("#secondT"XtName ").Val (;$("#secondTxtTel").Val (;}});WebViewJavascriptBridge.callHandler ('getAppVersion', {}, function (response) {Callback (response);});FN & & FN ();})Return {Init: functIon (FN) {ConnectWebViewJavascriptBridge (function (WebViewJavascriptBridge) {WebViewJavascriptBridge.init (function (message, responseCallback) {});FN & & FN ();})},CopyWechat: functiOn (obj) {WebViewJavascriptBridge.callHandler ('copyWechat', {pageID: obj.pageID}, fUnction (response) {});},SaveQR: function (obj) {WebViewJavascRiptBridge.callHandler ('saveQR', {pageID: obj.pageID}, function (response) {});},ShowAppPage: function (obj) {WebViewJavascriptBridge.callHandler ('showAppPage',{pageID: obj.pageID}, function (response) {});},JumpTo: function (obj) {WebViewJavascriptBridge.callHandler ('jumpTo', {}, function (response) {});},ShowWebPage: function (obj) {WebViewJavascriptBridge.callHandler ('showWebPage{title: obj.title, pageUrl: obj.pageUrl}, function (response) {};},GetSId: function (callback) {WebViewJavascriptBridge.callHandler ('getSid', {}, function (Response) {callback (response);});},GetContacts: function (callback) {WebViewJavascriptBridge.callHandler ('getContacts', {}, function (response) {callback(response);});},GetAppVersion: function (callback) {WebVieWJavascriptBridge.callHandler ('getAppVersion', {}, function (response) {Flag=resPonse;Callback (response);});}}}) () ();


Leave a Reply

Your email address will not be published. Required fields are marked *