As planned in the last post, The time I could allocate in these last 2 weeks has been spent on research. I started off with the WidgetKit API, This led to setting up of the project and conducting other pre-development maintenance. It’s stuff I love to do, even though I always end up redoing it 🤷♂️. So, WidgetKit API seemed straightforward, apart from having to build the widgets with SwiftUI(added to the todo list 😶). I still have to dig deep and pull the levers to understand the possibilities but, Apple’s APIs are usually straightforward and there is a vibrant community to depend upon. I did manage to whip up a dummy widget to get a feel for the flow, the results below 🤭.
Google Analytics Reporting APIs on the other hand are a nightmare. Understanding the features of various analytics APIs and their versions is a tedious task. The developer community support is limited, especially for iOS with libraries and example projects all built using Objective-C (Hello, Swift’s been out for 5 years 🤷♂️). Then there is the task of authentication and authorization, here again, the available libraries are confusing. There are multiple solutions for the same problem and no clear documentation on recommendations for the current use case.
Anyway, I’ve finally managed to track down the libraries necessary for the development and integrated them into my app. I have to implement the authentication in the next step before authorizing and requesting Google Analytics data.
P.S. The stuff of nightmares – Google Analytics Reporting API v4, Google API Client Library for Objective-C for REST, GTMAppAuth for Apple Platforms, Google APIs & Services.