Replace $drivekit_version with the DriveKit version you are using in your app
Initialization
If you have disabled the SDK auto-initialization, an initialization phase is required to use the functions offered by the Challenge component. To initialize Challenge component in your app, you must call the initialization method in onCreate method of your application class.
funinitialize()
Synchronize list of challenges
To synchronize the list of challenges, call the following method:
Take a look at the open-source code of our DriveKit Demo App to see how it is implemented.
Retrieve local challenge list
You can retrieve the list of challenges stored in the DriveKit local database by calling the previous method but with the SynchronizationType parameter to CACHE.
Synchronize challenge detail
You need to call the following method if you want to get more details and statistics about a defined challenge:
This method have the following parameters:
Field
Type
Description
challengeId
String
Unique identifier of the challenge
synchronizationType
SynchronizationType
Can be DEFAULT or CACHE.
- DEFAULT will synchronize the challenge detail by calling the DriveQuant servers
- CACHE will retrieve the challenge detail already synchronized in the local database.
Take a look at the open-source code of our DriveKit Demo App to see how it is implemented.
Retrieve local challenge detail data
You can retrieve the details of a given challenge stored in the DriveKit local database by calling the previous method but with the SynchronizationType parameter to CACHE.
Join a challenge
To be able to join a given challenge, you can call the following method: