I would like to know the number of sessions (or logging) that are done through Moodle Mobile (app). Through the table “M_LOGSTORE_STANDARD_LOG” I cannot find enough information to discern if they are made by desktop or by the app.
I have also seen that the tables “M_EXTERNAL_*” are there (EXTERNALSERVICEID = 1). However, I imagine that should be an easier relation than going to query “M_LOGSTORE_STANDARD_LOG” + ACTION = 'loggedin'. Isn't it? (I don't know)
Also, I would like to know the type of device of each session, but I imagine that this information can be obtained by crossing it with the table “M_USER_DEVICES”, is it true?
I would be very grateful if you could help me... thank you very much.
The Moodle version is 3.8.
My recommendation would be to check the lastmodified field of the external_tokens table, it indicates the last time a user accessed via the mobile app (or web services), you should be storing this data periodically, for example, everyday 30 minutes calculate the last access per user and then consolidate the data.