Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Places photo request #163

Closed
nickmccomb opened this issue Aug 6, 2018 · 6 comments
Closed

Places photo request #163

nickmccomb opened this issue Aug 6, 2018 · 6 comments

Comments

@nickmccomb
Copy link

nickmccomb commented Aug 6, 2018

Is there any way to use the Google Places Photos service for iOS yet? I can't see any updates for iOS in the Places branch. Any ETA?

@thomasw
Copy link

thomasw commented Aug 14, 2018

Place Photos support is discussed over in #149. There hasn't yet been any work done towards supporting it from the iOS side (at least not that's currently public).

@nickmccomb
Copy link
Author

@thomasw i read something about @tolu360 saying use the JS version of the Places API for now. Have you tried this? Do you know if this is possible?

@thomasw
Copy link

thomasw commented Aug 15, 2018

You can use the Places web service API from an RN app, but you'd need some way of securing your API key. You'd typically use a referrer restriction on such keys, but you won't be able to do that in this context.

Unfortunately, even if you manage that somehow, photo API support is (essentially) free when using the Android SDK but it costs money when using the web service API. See https://developers.google.com/maps/billing/understanding-cost-of-use#places-photo

@nickmccomb
Copy link
Author

Probably best to setup Node.js on a server to do the Places / Photos API requests and pass it back to your app

@nickmccomb
Copy link
Author

nickmccomb commented Aug 29, 2018

For anyone who needs Places Photos working on iOS and Android, here's my Node.js API code for getting places around a lat/lng and then adding a Places Photo to each Place returned in that location (if a photo exists for that place).

Step 1: Setup a server somewhere - I used a Digital Ocean server
Step 2: Install Node.js on the server - Google can show you this
Step 3: Install Express, Axios, body-parser, express-validator/check & cors
Step 4: Get your Google Places API key (server key) - https://console.developers.google.com/apis/
Step 5: Add the code below to your Node code and restart Node (runs on port 3000)
Step 6: Call the API from your React Native app

Feel free to create a public Git repo for it so anyone can contribute to it.

API code: https://pastebin.com/71h2Xv9x
Request example: https://ibb.co/egwmsp

Note: You probably want to authenticate your user in your API before doing any Places requests.

@tolu360
Copy link
Owner

tolu360 commented Mar 11, 2019

This is getting revisited sometime soon with the latest beta release, please see #198

@tolu360 tolu360 closed this as completed Mar 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants