Natively Docs
Join our community đŸ”Ĩ
  • 👩‍🚀Getting Started
    • What is Natively?
    • Why Natively?
    • FAQ
    • Create Your First App
  • 🚀Natively Platform
    • 🚉Releases
    • đŸ–Œī¸Appearance
      • đŸ˜ŧApp Icon
      • 📱Loading Screen
      • 📱Error Screen
      • 🎨Style
    • đŸŽŦPreview
    • ⭐Features
      • đŸ›ŗī¸Bottom Bar
      • 🚇Deeplinks
        • đŸ”ĨFirebase
        • 🔗Universal Links
        • 🌱Branch.io
      • 📍Geolocation
      • 🔔Notifications
        • 📲OneSignal Notifications
        • đŸ”ĨFirebase Notifications (Advanced)
      • 📒Contacts
      • 👩‍🎨Social Auth
        • 🍏Sign In with Apple
      • 💟HealthKit
      • 💰Purchases
      • 🤑Admob
      • đŸ’ŗNFC
      • 📷Camera
      • 📂Photo Library
      • 🎤Microphone
      • 📈Analytics
        • đŸ•Šī¸AppsFlyer
        • 😛Facebook
    • 🚚Publish
      • 🍏iOS App
      • 🤖Android App
    • âš™ī¸Settings
    • 🙈Subscription Plans
  • Guides
    • 🧋Integration (Native Features)
      • 🏅How to get started?
      • â„šī¸Device
      • â„šī¸Browser Info
      • đŸ›ŗī¸Bottom Bar
      • âœ‚ī¸Clipboard
      • đŸšĻPush Notifications - OneSignal
      • đŸšĻPush Notifications - Firebase (Advanced)
      • 📍Geolocation
      • đŸ“ĻApp Storage
      • đŸ—ī¸Biometrics & Credentials
      • 📧Native SMS/Email
      • 📅Native Date Picker
      • 📸Native Camera
      • đŸŽ™ī¸Native Audio Recorder
      • 🈁Native Scanner (QR/Barcode)
      • 📔Contacts
      • 🍏Apple Sign In
      • â¤ī¸HealthKit
      • 💸In-App Purchases
      • 🤑Admob
      • đŸ’ŗNFC
      • đŸĨ‘Show Toast/Banner
      • âŗShow/Hide Loading Screen
      • đŸĨ‘Haptic Feedback
      • đŸ–ŧī¸Share Media/Files
      • 📱Open an external App/URL
      • âœī¸Request User's review
      • â†”ī¸getInsets
      • 🎨Control Style & Colors
    • 🔍Troubleshooting
    • 🐈Setup RevenueCat App
    • 🚑Setup Admob App
    • đŸšĨSetup One Signal App
    • 🧑‍🤝‍🧑Setup website Universal Links (Deeplinks)
    • 🍕Testing & Submitting your app
    • 🔑Generate iOS Push Key (NEW)
    • 🔑Generate iOS Push Certificate (Legacy)
    • 🤝Affiliate program
    • 📕For Partners: Natively Brand Book.
Powered by GitBook
On this page
  • 🧋 Bubble.io Plugin
  • [Element] Natively - Device
  • 🛠 JavaScript SDK
  • Device App Info

Was this helpful?

  1. Guides
  2. Integration (Native Features)

Device

PreviousHow to get started?NextBrowser Info

Last updated 1 month ago

Was this helpful?

🧋 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

  • Keyboard is visible - User taps an input and keyboard appears - available starting from v. 2.17.0

  • Keyboard is hidden - User closes the keyboard - available starting from v. 2.17.0

States:

  • Device - Device model (iOS can be decoded with this )

  • 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

const info = new NativelyInfo()
const app_info_callback = function (resp) {
        console.log(resp.device); // iPhone14,2
        console.log(resp.osVersion); // 15.6
        console.log(resp.osName); // iOS / Android
        console.log(resp.buildVersion); // 1.0.0
        console.log(resp.buildNumber); // 1
        console.log(resp.sdkVersion); // 3
        console.log(resp.isDarkMode); // true/false
};
info.getAppInfo(app_info_callback);
// available starting from v2.12.2
const app_state_callback = function (resp) {
        if (resp.state) {
                // User opened the app (iOS "active", android "resume")
                console.log("App went foreground")
        } else {
                // User minimized the app (closed without exiting)
                // (iOS "inactive", android "pause")
                console.log("App went background")
        }
};
info.app_state(app_state_callback);
// available starting from v2.15.4
const keyboard_visibility_callback = function (resp) {
        if (resp.visible) {
                // Keyboard is visible
                console.log("Keyboard is visible")
        } else {
                // Keyboard is hidden
                console.log("Keyboard is hidden")
        }
};
info.keyboard_visibility(keyboard_visibility_callback);

resp.device value for iOS can be decoded with this

Need to recognize the app and the web users? Check this out:

🧋
â„šī¸
list
Browser Info
list
Bubble.io Plugin
JavaScript SDK