From 85a7858542c1d18f1aa5ef1e41e91a9db87eea67 Mon Sep 17 00:00:00 2001 From: Tolu Olowu Date: Thu, 27 Jun 2019 22:32:33 +0100 Subject: [PATCH] Support all placeFields when calling lookUpPlaceByID --- README.md | 3 +-- .../reactnative/rngoogleplaces/RNGooglePlacesModule.java | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9ad54c5..4d5aefc 100644 --- a/README.md +++ b/README.md @@ -455,9 +455,8 @@ OR **PLACE FIELDS** - To prevent yourself from incurring huge usage bill, you can select the result fields you need in your application. Pass an *(optional)* `placeFields` as the second param to `lookUpPlaceByID`. -- **placeFields** is an **`Array`** of `String` such as `placeID`, `location`, `name`, `address`, `types`, `openingHours`, `plusCode`, `rating`, `userRatingsTotal`, `viewport`. +- **placeFields** is an **`Array`** of `String` such as `placeID`, `location`, `name`, `address`, `types`, `openingHours`, `plusCode`, `rating`, `userRatingsTotal`, `viewport`, `addressComponents`, `website`, `phoneNumber`, and `phoneNumber`. - Defaults to an empty array which returns every field possible for the particular place. -- Place note that requesting for `website`, `phoneNumber`, `phoneNumber` and `addressComponents` are not supported when calling `lookUpPlaceByID`. #### Example Response from Calling lookUpPlaceByID() diff --git a/android/src/main/java/com/arttitude360/reactnative/rngoogleplaces/RNGooglePlacesModule.java b/android/src/main/java/com/arttitude360/reactnative/rngoogleplaces/RNGooglePlacesModule.java index 2843924..b65868f 100644 --- a/android/src/main/java/com/arttitude360/reactnative/rngoogleplaces/RNGooglePlacesModule.java +++ b/android/src/main/java/com/arttitude360/reactnative/rngoogleplaces/RNGooglePlacesModule.java @@ -287,7 +287,7 @@ public void lookUpPlaceByID(String placeID, ReadableArray fields, final Promise return; } - List selectedFields = getPlaceFields(fields.toArrayList(), true); + List selectedFields = getPlaceFields(fields.toArrayList(), false); FetchPlaceRequest request = FetchPlaceRequest.builder(placeID, selectedFields).build(); diff --git a/package.json b/package.json index e4a4928..96b9823 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "iOS/Android Google Places Widgets (Autocomplete Modals) and API Services for React Native Apps", "main": "index.js", "author": "Tolu Olowu (Arttitude 360) ", - "version": "3.1.0", + "version": "3.1.1", "scripts": {}, "repository": { "type": "git",