Interface DittoAuthenticationCallback
public interface DittoAuthenticationCallback
Provides feedback to the developer about Ditto authentication status.
-
Method Summary
Modifier and TypeMethodDescriptionvoidonAuthenticationExpiringSoon(@NonNull DittoAuthenticator authenticator, long secondsRemaining) Warns that the Ditto authentication token is getting old.voidonAuthenticationRequired(@NonNull DittoAuthenticator authenticator) There is no Ditto authentication token or it has expired.default voidonAuthenticationStatusDidChange(@NonNull DittoAuthenticator authenticator) Notifies the callback object that the authentication status did change.
-
Method Details
-
onAuthenticationRequired
There is no Ditto authentication token or it has expired. Sync will not work until there is a successful login using one of the login methods onDittoAuthenticator. -
onAuthenticationExpiringSoon
Warns that the Ditto authentication token is getting old. Ditto will attempt to refresh tokens periodically, starting from halfway through the token's validity period. This reduces the risk of authentication expiring while the user is offline. The refresh will happen automatically if Ditto has a suitable refresh token. If new credentials are required, such as a third-party token or a username/password, then Ditto does not cache that information and you must submit it again using one of theloginmethods onDittoAuthenticator. -
onAuthenticationStatusDidChange
Notifies the callback object that the authentication status did change. Use theauthenticators propertystatusto query for the current authentication status. This method is optional, the default implementation does nothing.
-