How to use the expo-constants.linkingUri 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
// $ExpectError
      (Constants.expoRuntimeVersion: 'ups...');
      // $ExpectError
      (Constants.expoVersion: 'ups...');
      // $ExpectError
      (Constants.isDetached: 'ups...');
      // $ExpectError
      (Constants.intentUri: 'ups...');
      // $ExpectError
      (Constants.installationId: 'ups...');
      // $ExpectError
      (Constants.isDevice: 'ups...');
      // $ExpectError
      (Constants.isHeadless: 'ups...');
      // $ExpectError
      (Constants.linkingUri: 'ups...');
      // $ExpectError
      (Constants.sessionId: 'ups...');
      // $ExpectError
      (Constants.statusBarHeight: 'ups...');
      // $ExpectError
      (Constants.systemVersion: 'ups...');
      // $ExpectError
      (Constants.systemFonts: 'ups...');
    });
  });
github alan-ai / alan-sdk-reactnative / testtools / node_modules / expo-linking / src / Linking.ts View on Github external
function getHostUri(): string {
  if (!manifest.hostUri && !usesCustomScheme()) {
    // we're probably not using up-to-date xdl, so just fake it for now
    // we have to remove the /--/ on the end since this will be inserted again later
    return removeScheme(Constants.linkingUri).replace(/\/--($|\/.*$)/, '');
  }
  return manifest.hostUri;
}
github expo / expo / packages / expo / build / Linking / Linking.js View on Github external
import Constants from 'expo-constants';
import qs from 'qs';
import Linking from './LinkingModule';
const { manifest } = Constants;
const USES_CUSTOM_SCHEME = Constants.appOwnership === 'standalone' && manifest.scheme;
let HOST_URI = manifest.hostUri;
if (!HOST_URI && !USES_CUSTOM_SCHEME) {
    // we're probably not using up-to-date xdl, so just fake it for now
    // we have to remove the /--/ on the end since this will be inserted again later
    HOST_URI = _removeScheme(Constants.linkingUri).replace(/\/--($|\/.*$)/, '');
}
const IS_EXPO_HOSTED = HOST_URI &&
    (/^(.*\.)?(expo\.io|exp\.host|exp\.direct|expo\.test)(:.*)?(\/.*)?$/.test(HOST_URI) ||
        manifest.developer);
function _removeScheme(url) {
    return url.replace(/^[a-zA-Z0-9+.-]+:\/\//, '');
}
function _removePort(url) {
    return url.replace(/(?=([a-zA-Z0-9+.-]+:\/\/)?[^/]):\d+/, '');
}
function _removeLeadingSlash(url) {
    return url.replace(/^\//, '');
}
function _removeTrailingSlash(url) {
    return url.replace(/\/$/, '');
}
github expo / expo / packages / expo / src / Linking / Linking.ts View on Github external
import Constants from 'expo-constants';
import qs from 'qs';

import { ParsedURL } from './Linking.types';
import Linking from './LinkingModule';

const { manifest } = Constants;

const USES_CUSTOM_SCHEME = Constants.appOwnership === 'standalone' && manifest.scheme;

let HOST_URI = manifest.hostUri;
if (!HOST_URI && !USES_CUSTOM_SCHEME) {
  // we're probably not using up-to-date xdl, so just fake it for now
  // we have to remove the /--/ on the end since this will be inserted again later
  HOST_URI = _removeScheme(Constants.linkingUri).replace(/\/--($|\/.*$)/, '');
}
const IS_EXPO_HOSTED =
  HOST_URI &&
  (/^(.*\.)?(expo\.io|exp\.host|exp\.direct|expo\.test)(:.*)?(\/.*)?$/.test(HOST_URI) ||
    manifest.developer);

function _removeScheme(url) {
  return url.replace(/^[a-zA-Z0-9+.-]+:\/\//, '');
}

function _removePort(url) {
  return url.replace(/(?=([a-zA-Z0-9+.-]+:\/\/)?[^/]):\d+/, '');
}

function _removeLeadingSlash(url) {
  return url.replace(/^\//, '');
github wheatandcat / Peperomia / PeperomiaNative / src / components / pages / LoginWithAmazon / Connected.tsx View on Github external
onAmazonLogin = () => {
    Linking.addEventListener('url', event => this.redirect(event));
    const url = `https://peperomia.info/login/amazon?aaa=aa12&redirect_uri=${Constants.linkingUri}`;

    Linking.openURL(url);
  };
github janaagaard75 / expo-and-typescript / src / constants / ConstantsScreen.tsx View on Github external
const navigate = this.props.navigation.navigate;

    return (
      
    );
  }