4

这个 repo ( https://github.com/rebeccahughes/react-native-device-info#usage ) 看起来它有一些通过 react native 访问设备信息的方法。

有人有来自实际设备的一些示例输出数据吗?

无需在一堆设备上编译和运行数据,就可以了解数据的样子,这将是一件好事。

4

1 回答 1

4

这是我在多个设备和模拟器上运行它所得到的。

以下是来自 DeviceInfo 的特定方法调用以及结果输出。我更改了一些识别值,但每个值的格式与设备输出的格式完全相同。我没有输出 DeviceInfo 上可用的所有方法,只输出目前对我有用的方法。希望这可以帮助某人:

(点燃火)

getDeviceName:  Name of My Kindle Fire
getUniqueID:    123ba45a678901a2
getManufacturer:    Amazon
getModel:   KFAUWI
getSystemName:  Android
getSystemVersion:   5.1.1
getBrand:   Amazon
getAPILevel:    22
getUserAgent:   Mozilla/5.0 (Linux; Android 5.1.1; KFAUWI Build/LVY48F; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/59.0.3071.125 Safari/537.36
isTablet:   true
getApplicationName: My Awesome App
getBundleId:    com.app.awesome
getBuildNumber: 1
getVersion: 0.0.0
getReadableVersion: 0.0.0.1

(三星 Galaxy S8)

getDeviceName:  Name of My Phone
getUniqueID:    f12edc3b4af56e78
getManufacturer:    samsung
getModel:   SM-G950U
getSystemName:  Android
getSystemVersion:   8.0.0
getBrand:   samsung
getAPILevel:    26
getUserAgent:   Mozilla/5.0 (Linux; Android 8.0.0; SM-G950U Build/R16NW; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/68.0.3440.70 Mobile Safari/537.36
isTablet:   false
getApplicationName: My Awesome App
getBundleId:    com.app.awesome
getBuildNumber: 1
getVersion: 0.0.0
getReadableVersion: 0.0.0.1

(运行 Pixel C 平板电脑的 avd 模拟器)

getDeviceName:  Unknown
getUniqueID:    9a876b5432109cde
getManufacturer:    unknown
getModel:   Android SDK built for x86
getSystemName:  Android
getSystemVersion:   5.1.1
getBrand:   Android
getAPILevel:    22
getUserAgent:   Mozilla/5.0 (Linux; Android 5.1.1; Android SDK built for x86 Build/LMY48X) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/39.0.0.0 Safari/537.36
isTablet:   true
getApplicationName: My Awesome App
getBundleId:    com.app.awesome
getBuildNumber: 1
getVersion: 0.0.0
getReadableVersion: 0.0.0.1

(一个 iPhone 模拟器,从 xCode 启动)

getDeviceName:  nameofmyapplemachine
getUniqueID:    48FC4A5D-D189-6623-6DB2-B28CCC88D10D
getManufacturer:    Apple
getModel:   iPhone 6
getSystemName:  iOS
getSystemVersion:   11.4
getBrand:   Apple
getAPILevel:    not available
getUserAgent:   Mozilla/5.0 (iPhone; CPU iPhone OS 11_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15F79
isTablet:   false
getApplicationName: My Awesome App
getBundleId:    com.app.awesome
getBuildNumber: 11
getVersion: 0.0.11
getReadableVersion: 0.0.11.11

(一个 iPad 模拟器,从 xCode 启动)

getDeviceName:  nameofmyapplemachine
getUniqueID:    DA6BEB1C-7C8D-9DD3-CA46-C06AD59E55DF
getManufacturer:    Apple
getModel:   iPad Air 2
getSystemName:  iOS
getSystemVersion:   11.4
getBrand:   Apple
getAPILevel:    not available
getUserAgent:   Mozilla/5.0 (iPad; CPU OS 11_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15F79
isTablet:   true
getApplicationName: My Awesome App
getBundleId:    com.app.awesome
getBuildNumber: 11
getVersion: 0.0.11
getReadableVersion: 0.0.11.11

(一台 iPad 2 物理设备)

getDeviceName:  Name of My iPad
getUniqueID:    AD059D5A-E0D4-3326-6F0C-B8DAB8A5CA6F
getManufacturer:    Apple
getModel:   iPad 2
getSystemName:  iPhone OS
getSystemVersion:   9.3.5
getBrand:   Apple
getAPILevel:    not available
getUserAgent:   Mozilla/5.0 (iPad; CPU OS 9_3_5 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Mobile/13G36
isTablet:   true
getApplicationName: My Awesome App
getBundleId:    com.app.awesome
getBuildNumber: 11
getVersion: 0.0.11
getReadableVersion: 0.0.11.11
于 2018-08-07T19:48:19.023 回答