npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@aaxis/react-native-google-places

v0.0.3

Published

Places SDK for React Native

Downloads

8

Readme

@aaxis-internal/react-native-google-places

Places SDK for React Native.

Installation

npm install @aaxis-internal/react-native-google-places

Make sure you have .npmrc configured.

Setup

It need provide your GMSAPIKEY to use this SDK.

for iOS

// AppDelegate.m

@import GooglePlaces;

// ...
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
 // ...
 [GMSPlacesClient provideAPIKey:@"APIKEY"];
}

for Android

// gradle.properties

GOOGLE_PLACES_API_KEY=APIKEY

Usage

Currently, the SDK integrates three methods.

import { findAutocompletePredictions, fetchPlaceFromPlaceID, refreshSessionToken } from "@aaxis-internal/react-native-google-places";

// ...

const predictions = await findAutocompletePredictions("apple park");

const [firstResult] = predictions;

const placeInfo = await fetchPlaceFromPlaceID(firstResult.placeID);

findAutocompletePredictions

findAutocompletePredictions(query: string, filters: GMSAutocompleteFilter): Promise<GMSPrediction[]>;

query

Find Autocomplete predictions from text query.

**filters **

Set up filters for autocomplete requests.

GMSAutocompleteFilter

type: string

The type filter applied to an autocomplete request to restrict results to different types.

It can be one of address, city, establishment, geocode, region, noFilter.

country: string

The country to restrict results to, ignored if the countries property is set.

This should be a ISO 3166-1 Alpha-2 country code (case insensitive). If nil, no country filtering will take place.

countries: string[]

The countries to restrict results to, overrides the country property if that is set.

origin: Coordinate

The straight line distance origin location for measuring the straight line distance between the origin location and autocomplete predictions.

locationBias: GMSCoordinateBounds

The optional location bias to prefer place results near the location.

locationRestriction: GMSCoordinateBounds

The optional location restriction to limit the place results to.

fetchPlaceFromPlaceID

fetchPlaceFromPlaceID(placeID: string,placeFields: GMSPlaceField[]): Promise<GMSPlace>

placeID

The place ID to lookup.

**placeFields **

The fields represent individual information that can be requested for a GMSPlace object.

If no request fields are set, the GMSPlace object will contain all information.

Full type definition

refreshSessionToken

By default, this SDK will automatically generate the SessionToken.

If findAutocompletePredictions is called multiple times to obtain the list but fetchPlaceFromPlaceID method is not called to obtain the details, a new SessionToken will not be generated. You need to manually call this method to create a new SessionToken.

More information about [SessionToken](Session Tokens | Places SDK for iOS | Google Developers).

Basic SDK Documentation

iOS documentation

Android documentation