How to use the react-native-config.GOOGLE_PLACES_API_KEY function in react-native-config

To help you get started, we’ve selected a few react-native-config 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 pjay79 / BarsAppAmplify / app / services / nearbyPlaceDetailsSearch.js View on Github external
export default async (placeId: string) => {
  try {
    const response = await axios.get(
      `https://maps.googleapis.com/maps/api/place/details/json?placeid=${placeId}&fields=name,opening_hours/weekday_text,formatted_phone_number,vicinity,website,reviews,url,type&key=${
        Config.GOOGLE_PLACES_API_KEY
      }`,
    );
    console.log(response);
    return response;
  } catch (error) {
    console.log(error);
    return null;
  }
};
github pjay79 / BarsAppAmplify / app / services / nearbyPlacesSearch.js View on Github external
export default async (latitude: string, longitude: string, pageToken: string) => {
  try {
    const urlFirst = `https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=${latitude},${longitude}&radius=1500&rankBy=distance&type=bar&key=${
      Config.GOOGLE_PLACES_API_KEY
    }`;

    const urlNext = `https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=${latitude},${longitude}&radius=1500&rankBy=distance&type=bar&key=${
      Config.GOOGLE_PLACES_API_KEY
    }&pagetoken=${pageToken}`;

    const url = pageToken === '' ? urlFirst : urlNext;
    const response = await axios.get(url);
    console.log(response);
    return response;
  } catch (error) {
    console.log(error);
    return null;
  }
};
github pjay79 / BarsAppAmplify / app / screens / BarsScreen.js View on Github external
searchBars = async () => {
    try {
      const {
        bars, latitude, longitude, pageToken,
      } = this.state;

      const urlFirst = `https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=${latitude},${longitude}&radius=1500&type=bar&key=${
        Config.GOOGLE_PLACES_API_KEY
      }`;

      const urlNext = `https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=${latitude},${longitude}&radius=1500&type=bar&key=${
        Config.GOOGLE_PLACES_API_KEY
      }&pagetoken=${pageToken}`;

      const url = pageToken === '' ? urlFirst : urlNext;
      const response = await axios.get(url);
      const arrayData = [...bars, ...response.data.results];
      this.setState({
        bars: pageToken === '' ? response.data.results : arrayData,
        refreshing: false,
        pageToken: response.data.next_page_token,
      });
      console.log(response);
    } catch (error) {
github buildreactnative / assemblies / application / components / accounts / Register.js View on Github external
{return '';}}
              GooglePlacesSearchQuery={{rankby: 'distance',}}
              GoogleReverseGeocodingQuery={{}}
              minLength={2}
              nearbyPlacesAPI='GooglePlacesSearch'
              onPress={this.selectLocation}
              placeholder='Your city'
              predefinedPlaces={[]}
              query={{
                key: Config.GOOGLE_PLACES_API_KEY,
                language: 'en',
                types: '(cities)',
              }}
              styles={autocompleteStyles}>
            
          
github buildreactnative / assemblies / application / components / groups / CreateGroup.js View on Github external
title={{ title: 'Create Assembly', tintColor: 'white' }}
          tintColor={Colors.brandPrimary}
          leftButton={}
        />
        
          
           { return ''; }}
            query={{
              key: Config.GOOGLE_PLACES_API_KEY,
              language: 'en',
              types: '(cities)',
            }}
            currentLocation={false}
            currentLocationLabel="Current location"
            nearbyPlacesAPI='GooglePlacesSearch'
            GoogleReverseGeocodingQuery={{}}
            GooglePlacesSearchQuery={{ rankby: 'distance',}}
            filterReverseGeocodingByTypes={['locality', 'administrative_area_level_3']}
            predefinedPlaces={[]}
          />