APIManager

The APIManager class manages requests related to gamification, and invokes the gamification REST APIs. Use this class to interact with the Salesforce gamification APIs and retrieve member games, and game rewards.

The Gamification Mobile iOS SDK requires a valid access token to interact with the Salesforce gamification APIs. To provide a valid access token, pass an instance of GamificationForceAuthenticator protocol in your APIManager class at the time of initialization. The APIManager class manages authentication using the provided instance of GamificationForceAuthenticator.

Use this initializer to initialize the GamificationRemoteRepository class.

ParameterTypeDescription
authGamificationForceAuthenticatorAn instance of the GamificationForceAuthenticator protocol.
instanceUrlStringThe URL of your Salesforce org.
forceClientGamificationForceClientAn instance of the GamificationForceClient class.

Retrieve games for the specified participant ID. This method returns an instance of the GameModel object.

ParameterTypeDescription
participantIdStringThe ID of a loyalty program member, an account, or a contact whose eligible games are to be retrieved.
versionStringThe API version.
mockFileNameStringThe name of the file that has the sample response.
devModeBooleanIndicates whether the method is run in the developer mode (true) or not (false).

Retrieve the details of the reward that’s provided to a participant after the game play. This method returns an instance of the PlayGameModel object.

ParameterTypeDescription
gameParticipantRewardIdStringThe ID of the participant’s game reward won by the participant whose details are to be fetched.
versionStringThe API version.
mockFileNameStringThe name of the file that has the sample response.
devModeBooleanIndicates whether the method is run in the developer mode (true) or not (false).