Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
GamificationRemoteRepository
The Gamification Mobile Android SDK requires a valid access token to interact with the Salesforce gamification APIs. To provide a valid access token, implement the GameAuthenticator interface in your GamificationRemoteRepository class at the time of initialization. This class manages authentication using the provided instance of GameAuthenticator.
Use this constructor to initialize the GamificationRemoteRepository class.
1class GamificationRemoteRepository constructor(
2 auth: GameAuthenticator,
3 instanceUrl: String,
4 gameClient: NetworkClient
5)| Parameter | Type | Description | Required or Optional |
|---|---|---|---|
| auth | GameAuthenticator | An instance of the GameAuthenticator interface. | Required |
| instanceUrl | String | The URL of your Salesforce org. | Required |
| gameClient | NetworkClient | An instance of the GameAPIClient class. | Required |
Methods
getGames
Retrieve games for the specified participant ID.
1final Result<Games> getGames(String participantId, String gameParticipantRewardId, Boolean mockResponse)| Parameter | Type | Description | Required or Optional |
|---|---|---|---|
| participantId | String | The ID of a loyalty program member, an account, or a contact whose eligible games are to be retrieved. | Required |
| gameParticipantRewardId | String | The ID of the participant's game reward associated with the game whose details are to be fetched. | Optional |
| mockResponse | Boolean | Indicates whether to include a sample response (true) or not (false). | Optional |
getGameReward
Retrieve the details of the reward that’s provided to a participant after the game play.
1final Result<GameRewardResponse> getGameReward(String gameParticipantRewardId, Boolean mockResponse)| Parameter | Type | Description | Required or Optional |
|---|---|---|---|
| gameParticipantRewardId | String | The ID of the participant's game reward won by the participant whose details are to be fetched. | Required |
| mockResponse | Boolean | Indicates whether to include a sample response (true) or not (false). | Optional |