Google Maps Integration data - > google pub sub integration

Hi All,

I found some talk of this in other posts, but nothing that answers my question, but apologies if I missed the answer or if this is considered duplication.

I have a product fleet that I am hoping to use the google maps geolocation integration with. The ideal scenario, is that periodically the particle calls the geolocate integration, and then the location data from the response is then passed a google pub/sub integration along with the devices id. I will then take the data from there and get it into Firestore. The particle does not need to listen to the response from the geolocate hook.

My question is, short of receiving the data from the response directly on our device and republishing from the device as a fresh event, is there anyway to catch the Google API response, add in the device id and hand over the the gcloud integration?


As is always the case, as soon as I post I find something relevant. Google Maps Device Locator does not provide a callback

So I suppose it is best to receive the response on the particle and then republish this in a fresh event?

Since you cannot have a webhook response trigger another webhook, there a few possibilities:

  1. Have the response go all the way back to the device and have the device trigger a new event with the location data for your server to respond to using a webhook.

  2. Monitor the server sent events stream from your server for the location response messages instead of using a webhook.

  3. Instead of triggering the location lookup from a webhook, have the location request sent to your own service using a webhook. Using something like Google cloud functions or Amazon lambda, send the request to Google Geolocation and then the response will go back to you, instead of the device.

1 Like

Thanks @rickkas7 .

As we do not expect our devices to be moved often, Iā€™m currently implementing option 1 as we will not be checking the location very often.

I read earlier that LTE devices do not have the functionality to use the Geolocate API due to cell tower restrictions, is this still the case?

Thanks again.

LTE M1 devices can use tower location since google-maps-device-locator 0.0.6 (2019-10-03); requires Device OS 1.2.1 or later.

1 Like

Perfect, thanks again.