Hi Charles,
nice reading from you - although in a semi-negative context
Lets see if I can explain this so it makes sense:
The problem you face is because you don't use the facade as component but basically import the functions/ use the functions.
Due to this we have a sort of broken backwards comparability.
Generally speaking the whole 'licensing' process consists of two steps:
- Login via TMM which
- gives you the user (and some other optional things)
- Load the subscription from TMM which
- Downloads your app license to the device
- Loads the license from the device
The
loadSubscriptionFromTrimbleMobileManager
function takes care about part 2.
Because of Android 10 and data sandboxing we can't access the SD card anymore - which was where the license file was stored before.
Therefore we introduced the
ITMMLicenseServiceConnector serviceConnector = TMMLicenseServiceConnectorInstanceFactory.getInstance(context);
object - which basically bridges to TMM again. So TMM will download the license file, store it in the TMM data sandbox; the ServiceConnector funnels the content of the license then through to your application.
So instead of deserializing the license file directly from the SD card we read it now from the app data place (SDCard/android/com.trimble.trimblemobilemager/files/Trimble/EMS) and funnel it through.
Afterwards everything is back to default - so no change after the ServiceConnector.
The ITrimbleUser object is in this context not super relevant. An ITrimbleUser instance contains next to the TID also access- and refresh tokens for web service calls. So if you do more web service interactions with Trimble services (like TerraFlex and Penmap are doing) this object is more useful; in your specific case there is no major need other then the TID which gets also returned from the login intent (so the callback onActivityResult).
As for the mix of iOS, Android and Xamarin language - we're trying to merge documentation as best as possible... So although we have platform or dev language specific parts more and more things go into 'shared'... Which can lead to bad and unclear documentation in certain areas. I'll try to clean things up here.
Hope this helps a little.
I would propose to just use the loadSubscriptionFromTrimbleMobileManager implementation as found in the facade. This is the easiest/ simplest approach.
Regards
Nico