How to use the expo-constants.manifest 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 dooboolab / hackatalk-mobile / src / components / screen / Login.tsx View on Github external
const facebookLogin = async (): Promise => {
    setSigningInFacebook(true);
    try {
      await Facebook.initializeAsync(
        Constants.manifest.facebookAppId,
        undefined,
      );
      const result = await Facebook.logInWithReadPermissionsAsync({
        permissions: ['email', 'public_profile'],
      });

      if (result.type === 'success') {
        const { token, expires, permissions, declinedPermissions } = result;

        const response = await fetch(
          `https://graph.facebook.com/me?fields=
            id,name,email,birthday,gender,first_name,last_name,picture
            &access_token=${token}`,
        );
        // console.log('success', response);
        const responseObject = JSON.parse(await response.text());
github expo / expo / packages / expo-asset / src / AssetSources.ts View on Github external
const fileExtension = meta.type ? `.${encodeURIComponent(meta.type)}` : '';
  const suffix = `/${encodeURIComponent(
    meta.name
  )}${fileScale}${fileExtension}?platform=${encodeURIComponent(
    Platform.OS
  )}&hash=${encodeURIComponent(meta.hash)}`;

  // For assets with a specified absolute URL, we use the existing origin instead of prepending the
  // development server or production CDN URL origin
  if (/^https?:\/\//.test(meta.httpServerLocation)) {
    const uri = meta.httpServerLocation + suffix;
    return { uri, hash };
  }

  // For assets during development, we use the development server's URL origin
  if (Constants.manifest && Constants.manifest.developer) {
    const baseUrl = new URL(Constants.manifest.bundleUrl);
    baseUrl.set('pathname', meta.httpServerLocation + suffix);
    return { uri: baseUrl.href, hash };
  }

  // Production CDN URIs are based on each asset file hash
  return {
    uri: `https://d1wp6m56sqw74a.cloudfront.net/~assets/${encodeURIComponent(hash)}`,
    hash,
  };
}
github ryanvanderpol / expo-analytics / analytics.js View on Github external
.then(userAgent => {
                this.userAgent = userAgent;

                this.parameters = { 
                    an: Constants.manifest.name, 
                    aid: Constants.manifest.slug, 
                    av: Constants.manifest.version,
                    sr: `${width}x${height}`,
                    ...additionalParameters
                };

                if(this.options.debug){
                    console.log(`[expo-analytics] UserAgent=${userAgent}`);
                    console.log(`[expo-analytics] Additional parameters=`, this.parameters);
                }
            });
    }
github Marwan01 / food-converter / node_modules / expo / build / AuthSession.js View on Github external
function getRedirectUrl() {
    const redirectUrl = `${BASE_URL}/${Constants.manifest.id}`;
    if (__DEV__) {
        _warnIfAnonymous(Constants.manifest.id, redirectUrl);
    }
    return redirectUrl;
}
function getDefaultReturnUrl() {
github expo / expo / packages / expo / src / AuthSession.ts View on Github external
function getRedirectUrl(): string {
  const redirectUrl = `${BASE_URL}/${Constants.manifest.id}`;
  if (__DEV__) {
    _warnIfAnonymous(Constants.manifest.id, redirectUrl);
  }
  return redirectUrl;
}
github codepicks / CodePicks / App.js View on Github external
loadResourcesAsync = async () => Promise.all([
    Asset.loadAsync([
      require('./assets/images/robot-dev.png'),
      require('./assets/images/robot-prod.png'),
    ]),
    twitter.setConsumerKey(
      Constants.manifest.extra.twitter.consumerKey,
      Constants.manifest.extra.twitter.consumerKeySecret,
    ),
  ])
github expo / expo / packages / expo-notifications / src / getDevicePushTokenAsync.web.ts View on Github external
async function _subscribeUserToPushAsync(): Promise {
  if (!Constants.manifest.notification || !Constants.manifest.notification.vapidPublicKey) {
    throw new CodedError(
      'E_NOTIFICATIONS_PUSH_WEB_MISSING_CONFIG',
      'You must provide `notification.vapidPublicKey` in `app.json` to use push notifications on web. Learn more: https://docs.expo.io/versions/latest/guides/using-vapid/.'
    );
  }
  if (!Constants.manifest.notification || !Constants.manifest.notification.serviceWorkerPath) {
    throw new CodedError(
      'E_NOTIFICATIONS_PUSH_WEB_MISSING_CONFIG',
      'You must provide `notification.serviceWorkerPath` in `app.json` to use push notifications on web. Please provide path to the service worker that will handle notifications.'
    );
  }
  guardPermission();

  const registration = await navigator.serviceWorker.register(Constants.manifest.notification.serviceWorkerPath);
  await navigator.serviceWorker.ready;
github expo / expo / packages / expo / build / AuthSession.js View on Github external
function getRedirectUrl() {
    const redirectUrl = `${BASE_URL}/${Constants.manifest.id}`;
    if (__DEV__) {
        _warnIfAnonymous(Constants.manifest.id, redirectUrl);
    }
    return redirectUrl;
}
function getDefaultReturnUrl() {
github expo / expo / apps / native-component-list / src / screens / AuthSessionScreen.tsx View on Github external
render() {
    if (this.state.invalidExperienceId) {
      return (
        
      );
    }
    return (