Not sure if this is helpful but here is a tutorial I wrote the same with Android using Java though: https://www.influxdata.com/blog/building-real-time-android-apps-influxdb-cloud and GitHub project https://github.com/InfluxCommunity/SensorLogger