I have an app that writes to a secured feature service and once the user signs in I want them to have have the option of staying signed in.
There is no obvious property or method on the UserCredentials object that seems to enable this so figured I'd use a timer. The user's first sign-in works. reliably. When I receive the token after the user signs in, I set the timer interval to half the time until tokenExpiry and set the timer's onTriggered signal to try to log in again by calling ServiceInfoTask.fetchFeatureServiceInfo().
But this doesn't get a new token or change the tokenExpiry. What is a correct method of doing this? Do I need to sign out first? Reinitialize the UserCredentials and/or reassign them to the ServiceInfoTask? Something else?