So I had started developing my app on Unity, and began looking into APIs to enhance certain functionalities in the app. The first thing I wanted to do was embed a static Google map as well as Google reviews in my app for new customers looking to visit a place. Through the Google API, integrating a map was a piece of cake, however, the Google Places API was a struggle and there was nothing to refer to in order to implement this besides the official Google documentation. The Places API is amazing, it provides the following requests:
-
Place Search returns a list of places based on a user’s location or search string.
-
Place Details returns more detailed information about a specific place, including user reviews.
-
Place Photos provides access to the millions of place-related photos stored in Google’s Place database.
-
Place Autocomplete automatically fills in the name and/or address of a place as users type.
-
Query Autocomplete provides a query prediction service for text-based geographic searches, returning suggested queries as users type.
There were two ways to get the reviews, either through a place search or by using the place ID, which is how I did it. After creating a developers account and creating a key, I had to create a very specific URL that in turn will retrieve the fields I need. The URL returns information in JSON, and this then needs to “translated” so that it can be viewed. After long hours of watching general YouTube tutorials about this, browsing forums on blogs, I accidentally stumbled across 1 (!!!!) course about it on LinkedIn Learning. Although it was not specific to what I needed, the foundation he taught helped me a lot to get it to work, alongside the Unity and StackOverflow forums. The only issue with this is that it only brings back 5 results unless you’re using a business account. I will be using the same API so that the user can get shisha lounges close them, and then try sort them through popularity.