How to use the expo-constants.deviceName function in expo-constants

To help you get started, we’ve selected a few expo-constants 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 flow-typed / flow-typed / definitions / npm / expo-constants_v4.x.x / flow_v0.69.0-v0.103.x / test_expo-constants.js View on Github external
it('should raise an error when lead to an incompatible type', () => {
      // $ExpectError
      (Constants.debugMode: 'ups...');
      // $ExpectError
      (Constants.deviceName: 'ups...');
      // $ExpectError
      (Constants.deviceYearClass: 'ups...');
      // $ExpectError
      (Constants.experienceUrl: 'ups...');
      // $ExpectError
      (Constants.expoRuntimeVersion: 'ups...');
      // $ExpectError
      (Constants.expoVersion: 'ups...');
      // $ExpectError
      (Constants.isDetached: 'ups...');
      // $ExpectError
      (Constants.intentUri: 'ups...');
      // $ExpectError
      (Constants.installationId: 'ups...');
      // $ExpectError
      (Constants.isDevice: 'ups...');
github expo / expo / packages / expo / src / logs / RemoteLogging.ts View on Github external
async function _sendNextLogBatchAsync(batch: LogEntry[], logUrl: string): Promise {
  let response;

  let headers = {
    'Content-Type': 'application/json',
    Connection: 'keep-alive',
    'Proxy-Connection': 'keep-alive',
    Accept: 'application/json',
    'Device-Id': Constants.installationId,
    'Session-Id': _sessionId,
  };
  if (Constants.deviceName) {
    headers['Device-Name'] = Constants.deviceName;
  }
  try {
    response = await fetch(logUrl, {
      method: 'POST',
      headers,
      body: JSON.stringify(batch),
    });
  } catch (error) {
    _transportEventEmitter.emit('error', { error });
    return;
  }

  let success = response.status >= 200 && response.status < 300;
  if (!success) {
    _transportEventEmitter.emit('error', {
      error: new Error(`An HTTP error occurred when sending remote logs`),
github Marwan01 / food-converter / node_modules / expo / build / logs / RemoteLogging.js View on Github external
async function _sendNextLogBatchAsync(batch, logUrl) {
    let response;
    let headers = {
        'Content-Type': 'application/json',
        Connection: 'keep-alive',
        'Proxy-Connection': 'keep-alive',
        Accept: 'application/json',
        'Device-Id': Constants.installationId,
        'Session-Id': _sessionId,
    };
    if (Constants.deviceName) {
        headers['Device-Name'] = Constants.deviceName;
    }
    try {
        response = await fetch(logUrl, {
            method: 'POST',
            headers,
            body: JSON.stringify(batch),
        });
    }
    catch (error) {
        _transportEventEmitter.emit('error', { error });
        return;
    }
    let success = response.status >= 200 && response.status < 300;
    if (!success) {
        _transportEventEmitter.emit('error', {
            error: new Error(`An HTTP error occurred when sending remote logs`),
github expo / expo / packages / expo / src / logs / RemoteLogging.ts View on Github external
async function _sendNextLogBatchAsync(batch: LogEntry[], logUrl: string): Promise {
  let response;

  let headers = {
    'Content-Type': 'application/json',
    Connection: 'keep-alive',
    'Proxy-Connection': 'keep-alive',
    Accept: 'application/json',
    'Device-Id': Constants.installationId,
    'Session-Id': _sessionId,
  };
  if (Constants.deviceName) {
    headers['Device-Name'] = Constants.deviceName;
  }
  try {
    response = await fetch(logUrl, {
      method: 'POST',
      headers,
      body: JSON.stringify(batch),
    });
  } catch (error) {
    _transportEventEmitter.emit('error', { error });
    return;
  }

  let success = response.status >= 200 && response.status < 300;
  if (!success) {
    _transportEventEmitter.emit('error', {
github Marwan01 / food-converter / node_modules / expo / build / logs / RemoteLogging.js View on Github external
async function _sendNextLogBatchAsync(batch, logUrl) {
    let response;
    let headers = {
        'Content-Type': 'application/json',
        Connection: 'keep-alive',
        'Proxy-Connection': 'keep-alive',
        Accept: 'application/json',
        'Device-Id': Constants.installationId,
        'Session-Id': _sessionId,
    };
    if (Constants.deviceName) {
        headers['Device-Name'] = Constants.deviceName;
    }
    try {
        response = await fetch(logUrl, {
            method: 'POST',
            headers,
            body: JSON.stringify(batch),
        });
    }
    catch (error) {
        _transportEventEmitter.emit('error', { error });
        return;
    }
    let success = response.status >= 200 && response.status < 300;
    if (!success) {
        _transportEventEmitter.emit('error', {
github janaagaard75 / expo-and-typescript / src / constants / ConstantsScreen.tsx View on Github external
public render() {
    const navigate = this.props.navigation.navigate;

    return (