Links
ℹ️

Device

🧋 Bubble.io Plugin

[Element] Natively - Device

Initialize:
  • Refresh App Info action will be called on element load, so you can access it asap.
Make sure to not add a lot of 'Natively - Device' elements because it will send a request to a device each time on load.
Events:
  • App Info received
  • App went foreground - User opened the app - available starting from v2.12.2
  • App went background - User minimized the app (closed without exiting) - available starting from v2.12.2
States:
  • Device - Device model (iOS can be decoded with this list)
  • OS Version - Android/iOS version
  • App Version
  • Build Number
  • Natively SDK Version
  • OS Name - "Android" / "iOS"
  • isDarkMode - Yes / No
  • Orientation - "PORTRAIT" / "LANDSCAPE"

Actions:

  • Refresh App Info

🛠 JavaScript SDK

Device App Info

1
const info = new NativelyInfo()
2
const app_info_callback = function (resp) {
3
console.log(resp.device); // iPhone14,2
4
console.log(resp.osVersion); // 15.6
5
console.log(resp.osName); // iOS / Android
6
console.log(resp.buildVersion); // 1.0.0
7
console.log(resp.buildNumber); // 1
8
console.log(resp.sdkVersion); // 3
9
console.log(resp.isDarkMode); // true/false
10
};
11
info.getAppInfo(app_info_callback);
12
// available starting from v2.12.2
13
const app_state_callback = function (resp) {
14
if (resp.state) {
15
// User opened the app (iOS "active", android "resume")
16
console.log("App went foreground")
17
} else {
18
// User minimized the app (closed without exiting)
19
// (iOS "inactive", android "pause")
20
console.log("App went background")
21
}
22
}
23
info.app_state(app_state_callback);
resp.device value for iOS can be decoded with this list​
​