PICO Unreal Platform SDK
FPicoChallengesInterface Class Reference

PicoChallengesInterface class. More...

#include <Pico_Challenges.h>

Public Member Functions

bool Get (const FString &ChallengeID, FChallengeGet InGetDelegate)
 Gets a specified challenge by ID. More...
 
bool GetEntries (const FString &ChallengeID, int PageIdx, int PageSize, ELeaderboardFilterType Filter, ELeaderboardStartAt StartAt, FChallengeGetEntries InGetEntriesDelegate)
 Gets a list of challenge entries. More...
 
bool GetEntriesAfterRank (ppfID ChallengeID, int PageIdx, int PageSize, unsigned long long AfterRank, FChallengeGetEntriesAfterRank InGetEntriesAfterRankDelegate)
 Gets the challenge entries after a specified ranking. More...
 
bool GetEntriesByIds (const FString &ChallengeID, int PageIdx, int PageSize, ELeaderboardStartAt StartAt, const TArray< FString > &UserIDs, FChallengeGetEntriesByIds InGetEntriesByIdsDelegate)
 Gets the challenge entries for specified user(s). More...
 
bool GetList (FPico_ChallengeOptions ChallengeOptions, int PageIdx, int PageSize, FChallengeGetList InGetListDelegate)
 Gets a list of challenges. More...
 
bool Join (const FString &ChallengeID, FChallengeJoin InJoinDelegate)
 Lets the current user join a challenge. More...
 
bool Leave (const FString &ChallengeID, FChallengeLeave InLeaveDelegate)
 Lets the current user leave a challenge. More...
 
bool Invite (const FString &ChallengeID, const TArray< FString > &UserIDs, FChallengeInvite Delegate)
 Invites user(s) to join a challenge. More...
 
bool LaunchInvitableUserFlow (const FString &ChallengeID, FChallengeLaunchInvitableUserFlow Delegate)
 Launches the invitation flow to let the current user invite friends to a specified challenge. This launches the system default invite UI where the user can select friends to invite and then send invitations to them. Therefore, this is a shortcut if you do not want to build the invite UI by yourself. More...
 

Detailed Description

PicoChallengesInterface class.

Member Function Documentation

◆ Get()

bool Get ( const FString &  ChallengeID,
FChallengeGet  InGetDelegate 
)

Gets a specified challenge by ID.

Parameters
ChallengeIDChallenge ID.
InGetDelegateWill be executed when the request has been completed.
Delegate will contain the requested object class (FChallengeGet, bool, bIsError, const FString&, ErrorMessage, UPico_Challenge *, Challenge).
Returns
Bool:
  • true: success
  • false: failure

◆ GetEntries()

bool GetEntries ( const FString &  ChallengeID,
int  PageIdx,
int  PageSize,
ELeaderboardFilterType  Filter,
ELeaderboardStartAt  StartAt,
FChallengeGetEntries  InGetEntriesDelegate 
)

Gets a list of challenge entries.

Parameters
ChallengeIDChallenge ID.
PageIdxDefines which page of entries to return. The value = (The target page No.)-1. For example, if you want to get the first page of entries, pass 0; if you want to get the second page of entries, pass 1.
PageSizeThe number of entries to return on each page.
FilterRestricts the scope of entries to return:
  • NONE: returns all entries of the specified leaderboard
  • FRIENDS: returns the entries of the friends of the current logged-in user
  • USER_IDS(do not pass this value): returns the entries of specified users
StartAtDefines where to start returning challenge entries, the enumerations are:
  • 0: Top (return entries from top 1)
  • 1: CenteredOnViewer (place the current logged-in user's entry in the middle of the list on the first page. For example, if the total number of entries is 10, pageSize is set to 5, and the user's rank is top 5, the ranks displayed on the first page will be top 3, 4, 5, 6, and 7. Top 1 and 2 will not be displayed, and top 8, 9, and 10 will be displayed on the second page)
  • 2: CenteredOnViewerOrTop (place the current logged-in user's entry on the top of the list on the first page. For example, if the total number of entries is 10, pageSize is set to 5, and the user's rank is top 5, the ranks displayed on the first page will be top 5, 6, 7, 8, and 9. Top 1, 2, 3, and 4 will not be displayed, and top 10 will be displayed on the second page)
InGetEntriesDelegateWill be executed when the request has been completed.
Delegate will contain the requested object class (bool, bIsError, const FString&, ErrorMessage, UPico_ChallengeEntryArray *, ChallengeEntryList).
Returns
Bool:
  • true: success
  • false: failure


◆ GetEntriesAfterRank()

bool GetEntriesAfterRank ( ppfID  ChallengeID,
int  PageIdx,
int  PageSize,
unsigned long long  AfterRank,
FChallengeGetEntriesAfterRank  InGetEntriesAfterRankDelegate 
)

Gets the challenge entries after a specified ranking.

Parameters
ChallengeIDChallenge ID.
PageIdxDefines which page of entries to return. The value = (The target page No.)-1. For example, if you want to get the first page of entries, pass 0; if you want to get the second page of entries, pass 1.
PageSizeThe number of entries to return on each page.
AfterRankDefines after which rank to return entries.
InGetEntriesAfterRankDelegateWill be executed when the request has been completed.
Delegate will contain the requested object class (bool, bIsError, const FString&, ErrorMessage, UPico_ChallengeEntryArray *, ChallengeEntryList).
Returns
Bool:
  • true: success
  • false: failure


◆ GetEntriesByIds()

bool GetEntriesByIds ( const FString &  ChallengeID,
int  PageIdx,
int  PageSize,
ELeaderboardStartAt  StartAt,
const TArray< FString > &  UserIDs,
FChallengeGetEntriesByIds  InGetEntriesByIdsDelegate 
)

Gets the challenge entries for specified user(s).

Parameters
ChallengeIDChallenge ID.
PageIdxDefines which page of entries to return. The value = (The target page No.)-1. For example, if you want to get the first page of entries, pass 0; if you want to get the second page of entries, pass 1.
PageSizeThe number of entries to return on each page.
StartAtDefines where to start returning challenge entries, the enumerations are:
  • 0: Top (return entries from top 1)
  • 1: CenteredOnViewer (place the current logged-in user's entry in the middle of the list on the first page. For example, if the total number of entries is 10, pageSize is set to 5, and the user's rank is top 5, the ranks displayed on the first page will be top 3, 4, 5, 6, and 7. Top 1 and 2 will not be displayed, and top 8, 9, and 10 will be displayed on the second page)
  • 2: CenteredOnViewerOrTop (place the current logged-in user's entry on the top of the list on the first page. For example, if the total number of entries is 10, pageSize is set to 5, and the user's rank is top 5, the ranks displayed on the first page will be top 5, 6, 7, 8, and 9. Top 1, 2, 3, and 4 will not be displayed, and top 10 will be displayed on the second page)
UserIDsUser ID(s).
InGetEntriesByIdsDelegateWill be executed when the request has been completed.
Delegate will contain the requested object class (bool, bIsError, const FString&, ErrorMessage, UPico_ChallengeEntryArray *, ChallengeEntryList).
Returns
Bool:
  • true: success
  • false: failure


◆ GetList()

bool GetList ( FPico_ChallengeOptions  ChallengeOptions,
int  PageIdx,
int  PageSize,
FChallengeGetList  InGetListDelegate 
)

Gets a list of challenges.

Parameters
ChallengeOptionsRestricts the scope of challenges to return. You can define the start date and end date of challenges, the leaderboard the challenges belong to, etc.
PageIdxDefines which page of entries to return. The value = (The target page No.)-1. For example, if you want to get the first page of entries, pass 0; if you want to get the second page of entries, pass 1.
PageSizeThe number of entries to return on each page.
InGetListDelegateWill be executed when the request has been completed. Delegate will contain the requested object class (bool, bIsError, const FString&, ErrorMessage, UPico_ChallengeArray *, ChallengeList).
Returns
Bool:
  • true: success
  • false: failure


◆ Invite()

bool Invite ( const FString &  ChallengeID,
const TArray< FString > &  UserIDs,
FChallengeInvite  Delegate 
)

Invites user(s) to join a challenge.

Parameters
ChallengeIDChallenge ID.
UserIDsUser ID(s).

<param name="Delegate>Will be executed when the request has been completed.
Delegate will contain the requested object class (bool, bIsError, const FString&, ErrorMessage, UPico_Challenge *, Challenge).

Returns
Bool:
  • true: success
  • false: failure


◆ Join()

bool Join ( const FString &  ChallengeID,
FChallengeJoin  InJoinDelegate 
)

Lets the current user join a challenge.

Parameters
ChallengeIDChallenge ID.
InJoinDelegateWill be executed when the request has been completed.
Delegate will contain the requested object class (bool, bIsError, const FString&, ErrorMessage, UPico_Challenge *, Challenge).
Returns
Bool:
  • true: success
  • false: failure


◆ LaunchInvitableUserFlow()

bool LaunchInvitableUserFlow ( const FString &  ChallengeID,
FChallengeLaunchInvitableUserFlow  Delegate 
)

Launches the invitation flow to let the current user invite friends to a specified challenge. This launches the system default invite UI where the user can select friends to invite and then send invitations to them. Therefore, this is a shortcut if you do not want to build the invite UI by yourself.

Parameters
ChallengeIDChallenge ID.

<param name="Delegate>Will be executed when the request has been completed.
Delegate will contain the requested object class (bool, bIsError, int, ErrorCode, const FString&, ErrorMessage).

Returns
Bool:
  • true: success
  • false: failure


◆ Leave()

bool Leave ( const FString &  ChallengeID,
FChallengeLeave  InLeaveDelegate 
)

Lets the current user leave a challenge.

Parameters
ChallengeIDChallenge ID.
InLeaveDelegateWill be executed when the request has been completed.
Delegate will contain the requested object class (bool, bIsError, const FString&, ErrorMessage, UPico_Challenge *, Challenge).
Returns
Bool:
  • true: success
  • false: failure