How to use the expo-constants.sessionId 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 dai-shi / react-native-dom-expo / src / ExpoFontLoader.dom.js View on Github external
loadAsync(nativeFontName, resource) {
    // To revert `${Constants.sessionId}-${name}`
    const fontName = nativeFontName.slice(Constants.sessionId.length + 1);
    return new Promise((resolve, reject) => {
      FontLoader.loadFont(fontName, resource, resolve, reject);
    });
  },
};
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 passes when used properly', () => {
      (Constants.debugMode: boolean);
      (Constants.deviceName: ?string);
      (Constants.deviceYearClass: number | null);
      (Constants.experienceUrl: string);
      (Constants.expoRuntimeVersion: string);
      (Constants.expoVersion: string);
      (Constants.isDetached: ?boolean);
      (Constants.intentUri: ?string);
      (Constants.installationId: string);
      (Constants.isDevice: boolean);
      (Constants.isHeadless: boolean);
      (Constants.linkingUri: string);
      (Constants.sessionId: string);
      (Constants.statusBarHeight: number);
      (Constants.systemVersion: ?number);
      (Constants.systemFonts: Array);
    });
github Marwan01 / food-converter / node_modules / expo-font / src / Font.ts View on Github external
export function processFontFamily(name: string | null): string | null {
  if (typeof name !== 'string' || Constants.systemFonts.includes(name) || name === 'System') {
    return name;
  }

  if (name.includes(Constants.sessionId)) {
    return name;
  }

  if (!isLoaded(name)) {
    if (__DEV__) {
      if (isLoading(name)) {
        console.error(
          `You started loading the font "${name}", but used it before it finished loading.\n
- You need to wait for Font.loadAsync to complete before using the font.\n
- We recommend loading all fonts before rendering the app, and rendering only Expo.AppLoading while waiting for loading to complete.`
        );
      } else {
        console.error(
          `fontFamily "${name}" is not a system font and has not been loaded through Font.loadAsync.\n
- If you intended to use a system font, make sure you typed the name correctly and that it is supported by your device operating system.\n
- If this is a custom font, be sure to load it with Font.loadAsync.`
github expo / expo / packages / expo-font / src / FontLoader.ts View on Github external
export function getNativeFontName(name: string): string {
  if (fontFamilyNeedsScoping(name)) {
    return `${Constants.sessionId}-${name}`;
  } else {
    return name;
  }
}
github Marwan01 / food-converter / node_modules / expo-font / build / Font.js View on Github external
function _getNativeFontName(name) {
    if (isWeb) {
        return name;
    }
    return `${Constants.sessionId}-${name}`;
}
if (module && module.exports) {
github Marwan01 / food-converter / node_modules / expo-font / src / Font.ts View on Github external
function _getNativeFontName(name: string): string {
  if (isWeb) {
    return name;
  }
  return `${Constants.sessionId}-${name}`;
}
github expo / expo / packages / expo-font / build / FontLoader.js View on Github external
export function getNativeFontName(name) {
    if (fontFamilyNeedsScoping(name)) {
        return `${Constants.sessionId}-${name}`;
    }
    else {
        return name;
    }
}
//# sourceMappingURL=FontLoader.js.map
github expo / expo / packages / expo-font / src / FontLoader.ts View on Github external
export function fontFamilyNeedsScoping(name: string): boolean {
  return (
    (isInClient || isInIOSStandalone) &&
    !Constants.systemFonts.includes(name) &&
    name !== 'System' &&
    !name.includes(Constants.sessionId)
  );
}