LootLocker Unreal SDK 11.1.0
Game backend SDK for Unreal Engine
Loading...
Searching...
No Matches
Surveys

Detailed Description

Show in-game surveys to players and record their completion.

Surveys are authored in the Web Console as a set of typed questions. A survey without segments is visible to every player; with segments it is only returned to players that match them. List the surveys a player can see with ListSurveys(), render the questions, submit the answers with SubmitSurveyAnswers(), then record the completion with CompleteSurvey(). Answers are stored as player metadata, keyed by each question's metadata_key, and the completion is stored separately, so Completed and Completed_at tell you whether a player has already responded.

Typedef Documentation

◆ FLootLockerCompleteSurveyResponseDelegate

typedef void(* FLootLockerCompleteSurveyResponseDelegate) (FLootLockerCompleteSurveyResponse)

C++ response delegate for completing a survey.

◆ FLootLockerGetSurveyResponseDelegate

typedef void(* FLootLockerGetSurveyResponseDelegate) (FLootLockerGetSurveyResponse)

C++ response delegate for getting a single survey.

◆ FLootLockerListSurveysResponseDelegate

typedef void(* FLootLockerListSurveysResponseDelegate) (FLootLockerListSurveysResponse)

C++ response delegate for listing surveys.

Function Documentation

◆ CompleteSurvey()

FString ULootLockerSDKManager::CompleteSurvey ( const FString & SurveyId,
const FLootLockerCompleteSurveyResponseDelegate & OnComplete,
const FString & ForPlayerWithUlid = "" )
static

Record a completion of the given survey for the current player.

Answers are submitted separately through the player metadata API using each question's metadata_key. The request fails when a required question has no stored answer.

Parameters
SurveyIdThe ULID of the survey to complete
OnCompleteDelegate for handling the server response
ForPlayerWithUlidOptional: Execute for the specified player ULID (default player if empty)
Returns
A unique id for this request, use this to match callbacks to requests when you have multiple simultaneous requests outbound

◆ GetSurvey()

FString ULootLockerSDKManager::GetSurvey ( const FString & SurveyId,
const FLootLockerGetSurveyResponseDelegate & OnComplete,
const FString & ForPlayerWithUlid = "" )
static

Get a single survey and its questions, if the current player meets the survey's segments.

Parameters
SurveyIdThe ULID of the survey to fetch
OnCompleteDelegate for handling the server response
ForPlayerWithUlidOptional: Execute for the specified player ULID (default player if empty)
Returns
A unique id for this request, use this to match callbacks to requests when you have multiple simultaneous requests outbound

◆ ListSurveys()

FString ULootLockerSDKManager::ListSurveys ( const FLootLockerListSurveysResponseDelegate & OnComplete,
const FString & ForPlayerWithUlid = "" )
static

List the surveys the current player can see, filtered by each survey's segments.

Parameters
OnCompleteDelegate for handling the server response
ForPlayerWithUlidOptional: Execute for the specified player ULID (default player if empty)
Returns
A unique id for this request, use this to match callbacks to requests when you have multiple simultaneous requests outbound

◆ SubmitSurveyAnswers()

FString ULootLockerSDKManager::SubmitSurveyAnswers ( const TArray< FLootLockerSurveyAnswer > & Answers,
const FLootLockerSetMetadataResponseDelegate & OnComplete,
const FString & ForPlayerWithUlid = "" )
static

Submit answers to a survey for the current player.

Survey answers are stored as player metadata, so this writes each answer to the player's own metadata under the question's metadata_key. Call CompleteSurvey afterwards to record the completion.

Parameters
AnswersThe answers to submit, built with FLootLockerSurveyAnswer::FromText and friends
OnCompleteDelegate for handling the server response
ForPlayerWithUlidOptional: Execute for the specified player ULID (default player if empty)
Returns
A unique id for this request, use this to match callbacks to requests when you have multiple simultaneous requests outbound

Data Structures

struct  FLootLockerSurveyQuestion
 A single question in a survey. More...
struct  FLootLockerSurvey
 A survey that a player can see and complete. More...

Typedefs

typedef void(* FLootLockerListSurveysResponseDelegate) (FLootLockerListSurveysResponse)
 C++ response delegate for listing surveys.
typedef void(* FLootLockerGetSurveyResponseDelegate) (FLootLockerGetSurveyResponse)
 C++ response delegate for getting a single survey.
typedef void(* FLootLockerCompleteSurveyResponseDelegate) (FLootLockerCompleteSurveyResponse)
 C++ response delegate for completing a survey.

Functions

static FString ULootLockerSDKManager::ListSurveys (const FLootLockerListSurveysResponseDelegate &OnComplete, const FString &ForPlayerWithUlid="")
 List the surveys the current player can see, filtered by each survey's segments.
static FString ULootLockerSDKManager::GetSurvey (const FString &SurveyId, const FLootLockerGetSurveyResponseDelegate &OnComplete, const FString &ForPlayerWithUlid="")
 Get a single survey and its questions, if the current player meets the survey's segments.
static FString ULootLockerSDKManager::CompleteSurvey (const FString &SurveyId, const FLootLockerCompleteSurveyResponseDelegate &OnComplete, const FString &ForPlayerWithUlid="")
 Record a completion of the given survey for the current player.
static FString ULootLockerSDKManager::SubmitSurveyAnswers (const TArray< FLootLockerSurveyAnswer > &Answers, const FLootLockerSetMetadataResponseDelegate &OnComplete, const FString &ForPlayerWithUlid="")
 Submit answers to a survey for the current player.