I'm interested in what APIs he used to build this.
It's turned out to be quite robust so far. The only quirks happen when: 1) I forget to close TikTok before turning off the screen on my phone (which incorrectly leaves a log entry that doesn't get closed until the next entry), and 2) if I go into picture-in-picture mode (which incorrectly--IMO--triggers the app closed shortcut). For now I'm avoiding PiP, so that's not a big deal. As for unclosed log entries, I've gotten good about closing the app before turning off the screen, but there's a few entries in the data from before I trained myself (those are adding a small bit of slop to the total).
[1] https://developers.tiktok.com/doc/research-api-get-started