Reputation: 829
I am new to Google Cloud Platforms
and not quite sure with the whole architecture but what I am trying to achieve is to save some data to Google Cloud
from an iOS application
and do some analytics work on this data using Google Cloud Products
, such as: Dataproc
and Datalab
. From what I read so far I would need to create a dataset in Google Cloud BigQuery
and create a table in it. I have done this using the Google Cloud Web UI
but now I want to populate the table from my iOS app
. I can't seem to find how to do that.
Upvotes: 1
Views: 2605
Reputation: 36143
The most painless route would be to wire up Firebase Analytics and then turn on its daily log export to Big Query, as described by Google in the walkthrough Importing Firebase Analytics Data into BigQuery. Google maintains the entire analytic export stack for you then, seeing as they also maintain Firebase. The downside is that the analytics export happens only daily.
Alternatively, you'd be looking at using the Big Query REST API to upload data, as documented by Google in their Loading Data with a POST Request how-to guide. The iOS tooling for that would be your usual NSURLSession
and NSURLDataTask
APIs, or whatever abstraction you prefer that's built atop them.
Google does maintain a collection of iOS-native APIs, but unfortunately, Big Query is not included amongst the supported APIs as of May 2017. There are native Big Query clients for Go, C#, and Java, amongst others. So you could use your own API for upload to a server you control, and then use one of those client APIs serverside to implement the actual Big Query integration, if you wished.
Upvotes: 4