Hello.
Let me explain how my Standalone (mobile only) reporting works:
1 - The app collect user analytics in a global array and save them locally using
Code: Select all
command SaveTheArray
put base64Encode(arrayEncode(gTempArray)) into tArray
put tArray into URL ("binfile:" & sLogPath) --save to file
end SaveTheArray
sLogPath is something like specialFolderPath(tFolder) & "/SegnaPunto/_MicAn.log" where, on mobile, tFolder is "cache"
2 - the gTempArray analytics are sent to my Filemaker server (using its API) creating a new recod at each restart of the App. The data are those of the previous session. This is done this way since on mobile it is almost impossible to intercept when the App gets closed and, often enough, the devices are not online (for several reasons)
3 - the reason of the base64Encode choice was to save to a local file that was not easily messed up by the user and that could be transmitted from the App at a user request (in the App there is a card to allow the user to email the last user data).
I could probably just do a textEncode, but after many published version, it would be hard to change to a new method.
Note that data to FM server are only Jsonized and textencoded.
4 - the gTempArray contains info on:
-how log the user stay on each card
-what kind of device is running on
-version of app
-etc.
5 - When the App intercepts en error (using "on errorDialog") it advices the user if he is willing to share the error and, if yes, it put the LC error detail in the gTempArray. The user see only a "an error occurred". The developer receives all the data in the FM server record.
6 - when there is an error reported on my FM server, I can see where it happened and, using the "LC error lookup" plugin I can try to understand what went wrong.
7 - the reading of the gTempArray, happens on startup using:
Code: Select all
put URL ("binfile:" & sLogPath) into tTempArray--load the pref file
put arrayDecode(base64Decode(tTempArray)) into gTempArray --holds all the data to be updated local save
the second line is the one when the error of this post has been catch (no, I haven't reported it since I cannot reproduce it)
After the reading, the gTempArray is sent to my FM server, as I said Jsonized and textencoded.
Then the gTempArray is emptied and the App start again collecting data and writin them to gTempArray
8 - On "errorDialog" I cannot collect all the values of global and local vars,. Mostly because the App spans on multiple substacks and cards and it would be too much time consuming. In this case I could not know that I had to collect and send the same value of gTempArray that generated the error.
I did a test stack (see attachment) that approximately reproduce the write and read of all the special chars I could think off. It works, so I assume that special chars on encoding is not the culprit.