How to use the react-native-device-info.getBundleId function in react-native-device-info

To help you get started, we’ve selected a few react-native-device-info examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mattermost / mattermost-mobile / app / utils / push_notifications.js View on Github external
onRegisterDevice = (data) => {
        const {dispatch, getState} = this.store;
        let unsubscribeFromStore = null;

        let prefix;
        if (Platform.OS === 'ios') {
            prefix = General.PUSH_NOTIFY_APPLE_REACT_NATIVE;
            if (DeviceInfo.getBundleId().includes('rnbeta')) {
                prefix = `${prefix}beta`;
            }
        } else {
            prefix = General.PUSH_NOTIFY_ANDROID_REACT_NATIVE;
        }

        EphemeralStore.deviceToken = `${prefix}:${data.token}`;

        // TODO: Remove when realm is ready
        const waitForHydration = () => {
            if (getState().views.root.hydrationComplete && !this.configured) {
                this.configured = true;
                dispatch(setDeviceToken(EphemeralStore.deviceToken));
                unsubscribeFromStore();
            }
        };
github sishuguojixuefu / react-native-template-sishu-0.59 / app / utils / getDeviceInfo.ts View on Github external
const getDeviceInfo = () => ({
  apiLevel: Platform.OS === 'ios' ? '' : DeviceInfo.getAPILevel(),
  appName: DeviceInfo.getApplicationName(),
  brand: DeviceInfo.getBrand(),
  buildNumber: DeviceInfo.getBuildNumber(),
  bundleId: DeviceInfo.getBundleId(),
  deviceCountry: DeviceInfo.getDeviceCountry(),
  deviceId: DeviceInfo.getDeviceId(),
  deviceLocale: DeviceInfo.getDeviceLocale(),
  deviceName: DeviceInfo.getDeviceName(),
  firstInstallTime: Platform.OS === 'ios' ? '' : DeviceInfo.getFirstInstallTime(),
  freeDiskStorage: DeviceInfo.getFreeDiskStorage(),
  referrer: Platform.OS === 'ios' ? '' : DeviceInfo.getInstallReferrer(),
  instanceId: Platform.OS === 'ios' ? '' : DeviceInfo.getInstanceID(),
  lastUpdateTime: Platform.OS === 'ios' ? '' : DeviceInfo.getLastUpdateTime(),
  manufacturer: DeviceInfo.getManufacturer(),
  maxMemory: DeviceInfo.getMaxMemory(),
  model: DeviceInfo.getModel(),
  phoneNumber: Platform.OS === 'ios' ? '' : DeviceInfo.getPhoneNumber(), // 权限http://t.cn/EP3kKhY
  readableVersion: DeviceInfo.getReadableVersion(),
  serialNumber: Platform.OS === 'ios' ? '' : DeviceInfo.getSerialNumber(),
  systemName: DeviceInfo.getSystemName(),
github textileio / photos / ignite / DevScreens / DeviceInfoScreen.js View on Github external
{title: 'Device Unique ID', info: DeviceInfo.getUniqueID()},
  {title: 'Device Locale', info: DeviceInfo.getDeviceLocale()},
  {title: 'Device Country', info: DeviceInfo.getDeviceCountry()},
  {title: 'User Agent', info: DeviceInfo.getUserAgent()},
  {title: 'Screen Width', info: Metrics.screenWidth},
  {title: 'Screen Height', info: Metrics.screenHeight}
]

const OS_DATA = [
  {title: 'Device System Name', info: DeviceInfo.getSystemName()},
  {title: 'Device ID', info: DeviceInfo.getDeviceId()},
  {title: 'Device Version', info: DeviceInfo.getSystemVersion()}
]

const APP_DATA = [
  {title: 'Bundle Id', info: DeviceInfo.getBundleId()},
  {title: 'Build Number', info: DeviceInfo.getBuildNumber()},
  {title: 'App Version', info: DeviceInfo.getVersion()},
  {title: 'App Version (Readable)', info: DeviceInfo.getReadableVersion()}
]

export default class DeviceInfoScreen extends React.Component {
  constructor (props) {
    super(props)

    this.state = {
      isConnected: false,
      connectionInfo: null,
      connectionInfoHistory: []
    }
  }
github guardian / editions / projects / Mallard / src / authentication / services / cas.ts View on Github external
const fetchCASSubscription = async (
    subscriberID: string,
    password: string,
): Promise> => {
    const appId = DeviceInfo.getBundleId()
    const deviceId = DeviceInfo.getUniqueId()

    const res = await fetch(CAS_ENDPOINT_URL, {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
        },
        body: JSON.stringify({
            appId,
            deviceId,
            subscriberId: subscriberID,
            password: password,
        }),
    })

    return fromResponse(res, {
github Bruno-Furtado / fastbuy-app / src / screens / index.js View on Github external
function screenUniqueName(name) {
  return `${DeviceInfo.getBundleId()}.${name}`;
}
github guardian / editions / projects / Mallard / src / services / content-auth-service.ts View on Github external
const fetchCasSubscription = async (
    subscriberID: string,
    password: string,
): Promise => {
    const appId = DeviceInfo.getBundleId()
    const deviceId = DeviceInfo.getUniqueId()

    const res = await fetch(CAS_ENDPOINT_URL, {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
        },
        body: JSON.stringify({
            appId,
            deviceId,
            subscriberId: subscriberID,
            password: password,
        }),
    })

    const json = await res.json()
github newsuk / times-components / packages / ad / src / dom-context.android.js View on Github external
componentDidMount() {
    this.deviceInfo = {
      applicationName: DeviceInfo.getApplicationName(),
      buildNumber: DeviceInfo.getBuildNumber(),
      bundleId: DeviceInfo.getBundleId(),
      deviceId: DeviceInfo.getDeviceId(),
      readableVersion: DeviceInfo.getReadableVersion(),
      version: DeviceInfo.getVersion()
    };
  }
github berty / berty / client / react-native / common / update / update.js View on Github external
export const getInstalledVersion = async context => {
  const bundleId = RNDeviceInfo.getBundleId()

  if (!updateApiSources.hasOwnProperty(bundleId)) {
    return null
  }

  const { channel } = updateApiSources[bundleId]
  const deviceData = await DeviceInfos(context).fetch()
  const [rawVersionInfo] = deviceData.infos
    .filter(d => d.key === 'versions')
    .map(d => d.value)

  const {
    Core: { GitSha: hash, GitBranch: branch, CommitDate: rawCommitDate },
  } = JSON.parse(rawVersionInfo)

  return {
github berty / berty / client / react-native / app / update / update.js View on Github external
export const getInstalledVersion = async context => {
  const bundleId = RNDeviceInfo.getBundleId()

  if (!updateApiSources.hasOwnProperty(bundleId)) {
    return null
  }
  const channel = updateApiSources[bundleId].channel
  const deviceData = await context.node.service.deviceInfos({})

  const [rawVersionInfo] = deviceData.infos
    .filter(d => d.key === 'versions')
    .map(d => d.value)

  const {
    Core: { GitSha: hash, GitBranch: branch, CommitDate: rawCommitDate },
  } = JSON.parse(rawVersionInfo)

  return {