NativeJS - Device info

Get Device Info

If your website defines a function called gonative_device_info, it will get called after every page load as shown below. You may then POST it to your server via AJAX, or do anything else with it.
1
function gonative_device_info(info) {
2
console.log(info);
3
}
4
5
// info will look like
6
{
7
platform: 'ios',
8
appId: 'io.gonative.example',
9
appVersion: '1.0.0',
10
appBuild: '1.0.0' // will be appVersionCode (number) on Android
11
distribution: 'release',
12
hardware: 'armv8',
13
installationId: 'xxxx-xxxx-xxxx-xxxx',
14
language: 'en',
15
model: 'iPhone',
16
os: 'iOS',
17
osVersion: '10.3',
18
timeZone: 'America/New_York',
19
isFirstLaunch: false // first time the app is launched
20
}
Copied!
Last modified 1yr ago
Copy link