Instead of Callback<Status> we will pass a lambda function((Status) -> Unit)
The following is the migrated version of above code to SDK 1.17
Basically swap Callback<Status> with a lambda which takes a Status type parameter and returns Unit and remove the .execute call and directly call the lambda.
You could also call the lambda like tripStatusCallback?.invoke(Status.from(tdStatus)) in case if callback is nullable. Below is the example for the same.
Updating ResultCallback interface with a lambda function
Remove the following imports
Update the code to lambda
The following shows typical code from SDK 1.16
Instead of ResultCallback<String> we will pass a lambda (Result<T>) -> Unit)
The following is the migrated version of above code to SDK 1.17
Basically swap ResultCallback<String> with a lambda which takes a Result<String> type parameter and returns Unit and remove the .execute call and directly call the lambda.
You could also call the lambda like callback?.invoke(Result.Success(signedToken)) in case if callback is nullable. Below is the example for the same.
Accessing members from MonitorCallbacks
This only affects you, if you’re inheriting/implementing the MonitorCallbacks interface.
If you are inheriting/implementing the interface MonitorCallbacks , you won't be able to access the following members directly in the child class.
Solution:
import the reference directly
OR
Access using
The following shows typical code from SDK 1.16
The following is the migrated version of above code to SDK 1.17