WebApp快捷打包
设备信息

敬告:此 DEMO 演示为开放测试页面,仅用于开发者快速测试体验应用功能,请严格遵守开发者协议,了解更多

JS-SDK 引用方式:

♦ 普通网页 script 方式加载:下载最新版 jsBridge-v20240925.zip,请在页面上调用 jsBridge 接口之前引用 jsbridge-mini.js 库;

♦ js module 方式引用:npm install ym-jsbridge 具体请参考 npm package

deviceInfo 获取设备信息

jsBridge.deviceInfo(function(info) {
  show(info);
});

/*
info 回调参数结构:
{
  os: "android", //操作系统 android 或 ios
  //Android 设备信息示例
  android: {
    brand: "Xiaomi",
    manufacturer: "Xiaomi",
    product: "oxygen,
    board: "msm8953",
    device: "oxygen",,
    hardware: "qcom"
    display: "NMF26F",
    id: "NMF26F",
    fingerprint: "Xiaomi/oxygen/oxygen:7.1.1/NMF26F/V10.3.1.0.NDDCNXM:user/release-keys",
    api_level: 25,
    release: "7.1.1"
  },
  //iOS 设备信息示例
  ios: {
    model: "iPhone",
    //详见下方型号对照表,iPhone9,2 表示 iPhone 7 Plus
    machine: "iPhone9,2",
    nodename: "我的iPhone",
    version": "Darwin Kernel Version 19.5.0: Tue May 26 20:56:17 PDT 2020; root:xnu-6153.122.2~1/RELEASE_ARM64_T8010",
    battery_state: 0,
    localized_model: "iPhone",
    system_version: "13.5.1",
    system_name: "iOS",
    release: "19.5.0",
    sysname: "Darwin",
    battery_level: -1,
    name: "我的iPhone"
  }
}

iOS machine 型号对照表:
如果不全,请自行网上搜索,参考 https://www.theiphonewiki.com/
"iPod5,1"                                  :"iPod touch (5th generation)"
"iPod7,1"                                  :"iPod touch (6th generation)"
"iPod9,1"                                  :"iPod touch (7th generation)"

"iPhone3,1", "iPhone3,2", "iPhone3,3"      :"iPhone 4"
"iPhone4,1"                                :"iPhone 4s"
"iPhone5,1", "iPhone5,2"                   :"iPhone 5"
"iPhone5,3", "iPhone5,4"                   :"iPhone 5c"
"iPhone6,1", "iPhone6,2"                   :"iPhone 5s"
"iPhone7,2"                                :"iPhone 6"
"iPhone7,1"                                :"iPhone 6 Plus"
"iPhone8,1"                                :"iPhone 6s"
"iPhone8,2"                                :"iPhone 6s Plus"
"iPhone8,4"                                :"iPhone SE"
"iPhone9,1", "iPhone9,3"                   :"iPhone 7"
"iPhone9,2", "iPhone9,4"                   :"iPhone 7 Plus"
"iPhone10,1", "iPhone10,4"                 :"iPhone 8"
"iPhone10,2", "iPhone10,5"                 :"iPhone 8 Plus"
"iPhone10,3", "iPhone10,6"                 :"iPhone X"
"iPhone11,2"                               :"iPhone XS"
"iPhone11,4", "iPhone11,6"                 :"iPhone XS Max"
"iPhone11,8"                               :"iPhone XR"
"iPhone12,1"                               :"iPhone 11"
"iPhone12,3"                               :"iPhone 11 Pro"
"iPhone12,5"                               :"iPhone 11 Pro Max"
"iPhone12,8"                               :"iPhone SE (2nd generation)"

"iPad2,1", "iPad2,2", "iPad2,3", "iPad2,4" :"iPad 2"
"iPad3,1", "iPad3,2", "iPad3,3"            :"iPad (3rd generation)"
"iPad3,4", "iPad3,5", "iPad3,6"            :"iPad (4th generation)"
"iPad6,11", "iPad6,12"                     :"iPad (5th generation)"
"iPad7,5", "iPad7,6"                       :"iPad (6th generation)"
"iPad7,11", "iPad7,12"                     :"iPad (7th generation)"
"iPad4,1", "iPad4,2", "iPad4,3"            :"iPad Air"
"iPad5,3", "iPad5,4"                       :"iPad Air 2"
"iPad11,4", "iPad11,5"                     :"iPad Air (3rd generation)"
"iPad2,5", "iPad2,6", "iPad2,7"            :"iPad mini"
"iPad4,4", "iPad4,5", "iPad4,6"            :"iPad mini 2"
"iPad4,7", "iPad4,8", "iPad4,9"            :"iPad mini 3"
"iPad5,1", "iPad5,2"                       :"iPad mini 4"
"iPad11,1", "iPad11,2"                     :"iPad mini (5th generation)"
"iPad6,3", "iPad6,4"                       :"iPad Pro (9.7-inch)"
"iPad7,3", "iPad7,4"                       :"iPad Pro (10.5-inch)"
"iPad8,1", "iPad8,2", "iPad8,3", "iPad8,4" :"iPad Pro (11-inch) (1st generation)"
"iPad8,9", "iPad8,10"                      :"iPad Pro (11-inch) (2nd generation)"
"iPad6,7", "iPad6,8"                       :"iPad Pro (12.9-inch) (1st generation)"
"iPad7,1", "iPad7,2"                       :"iPad Pro (12.9-inch) (2nd generation)"
"iPad8,5", "iPad8,6", "iPad8,7", "iPad8,8" :"iPad Pro (12.9-inch) (3rd generation)"
"iPad8,11", "iPad8,12"                     :"iPad Pro (12.9-inch) (4th generation)"

"AppleTV5,3"                               :"Apple TV"
"AppleTV6,2"                               :"Apple TV 4K"
*/

展示数据: