npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@pod-point/react-native-device-info

v1.0.2

Published

Device information component for React Native

Readme

React Native Device Information Integration

This package provides device information for both Android and iOS devices. If you have push notifications enabled then this package can also provide the device token required to use this feature.

Installation

npm install @pod-point/react-native-device-info --save

iOS Setup Guide

  1. Open up your React Native project in XCode, this is the .xcodeproj file in the ios directory of your React Native project.
  2. Open node_modules/@pod-point/react-native-device-info/ios in Finder and locate the PPTDeviceInfo.xcodeproj package. Drag this file into the XCode project navigator. You can keep this in the Libraries group along with all the other React Native packages.
  3. Click on the root of your project in XCode, then select your project's main target. Click on Build Phases and double check that the libPPTDeviceInfo.a product was added. If not, expand the Products group in PPTDeviceInfo.xcodeproj and drag this file in.

Optional Extras

If you're using push notifications then you'll need to get hold of the device token. This token isn't immediately available to the app and extra configruation is required. If you need the device token, follow these steps:

  1. Click on the root of your project in XCode, then select your project's main target. Select Build Settings and then search for Header Search Paths. Add $(SRCROOT)/../node_modules/@pod-point/react-native-device-info to the header search path list and make sure that it is set to recursive.
  2. Ensure that your app delegate is correctly registering user notifications. You should have already completed this step if you're already using push notifications.
  3. In your didRegisterForRemoteNotificationsWithDeviceToken delegate, add the following line: [PPTDeviceInfoProvider provideDeviceToken:[deviceToken description]];. This assumes that your delegate has called the device token NSObject deviceToken.

Android Setup Guide

  1. Open up your React Native project in Android Studio, this is the android directory in your React Native project.
  2. Expand Gradle Scripts from within the project tree and open settings.gradle. Replace the line in the script which states include ':app' with include ':app', ':pptdeviceinfo' (or append ':pptdeviceinfo' to the end of the include statement if you're already including other modules).
  3. Add the following line to the end of settings.gradle:
project(':pptdeviceinfo').projectDir = new File(rootProject.projectDir, '../node_modules/@pod-point/react-native-device-info/android/library')
  1. Open up your app module build.gradle file and add the following line to the end of your dependancies section:
compile project(path: ':pptdeviceinfo')
  1. You should now be prompted to run a Gradle project sync so press Sync Now in the gold toolbar that should be visible.
  2. Open your projects MainActivity class and import the following package:
import com.podpoint.pptdeviceinfo.PPTDeviceInfoPackage;
  1. Find the line in your main activity class which has the following on it - .addPackage(new MainReactPackage()), add the following line below:
.addPackage(new PPTDeviceInfoPackage())
  1. Hit Ctrl+R and make sure the app runs!

General Usage

Import the package into react native using the following:

import DeviceInfo from '@pod-point/react-native-device-info';

Unfortunately the iOS and Android APIs differ slightly. This is because iOS and Android devices identify themselves differently; however many of the parameters returned are similar.

iOS Usage

The device info object will return the following properties:

{
    appVersion: "1.0",
    buildNumber: "1",
    bundleId: "com.apple.UselessStocksApp",
    deviceId: "iPhone7,2",
    model: "iPhone 6",
    systemManufacturer: "Apple",
    systemName: "iPhone OS",
    systemVersion: "9.1"
}

If you've optionally enabled the device token functionality then you can access it using the following callback. If the transform token parameter is set to true then all whitespace and <> charachters will be removed from the token, if it is set to false then the token is returned in it's raw format.

let transformToken = true;

DeviceInfo.deviceToken(transformToken, (token, error) => {
    console.log(token, error);
});

Should the device token be unavailable, the error object will provide you some useful information as to why. You may need to request the user to enable push notifications - this isn't something which is in the scope of this package so this functionality isn't available here.

Android Usage

Android device info is returned as an object, there are no callbacks when this package runs on Android hardware:

{
    appVersion: "1.0",
    buildNumber: 1,
    bundleId: "com.google.calculator",
    deviceToken: "APA91bFoi3lMMre9G3XzR1LrF4ZT82_15MsMdEICogXSLB8-MrdkRuRQFwNI5u8Dh0cI90ABD3BOKnxkEla8cGdisbDHl5cVIkZah5QUhSAxzx4Roa7b4xy9tvx9iNSYw-eXBYYd8k1XKf8Q_Qq1X9-x-U-Y79vdPq",
    model: "Google Nexus 5 - 5.0.0 - API 21 - 1080x1920",
    systemManufacturer: "Genymotion",
    systemName: "Android",
    systemVersion: "5.0",
    hardwareId: "11bf04d174814945"
}