Beamable SDK
Public Member Functions | Properties | List of all members
Beamable.Api.Events.EventsService Class Reference

This type defines the Client main entry point for the Events feature. More...

Inheritance diagram for Beamable.Api.Events.EventsService:
Inheritance graph
[legend]
Collaboration diagram for Beamable.Api.Events.EventsService:
Collaboration graph
[legend]

Public Member Functions

 EventsService (IPlatformService platform, IBeamableRequester requester, IDependencyProvider provider)
 
async Promise< TryEventClaimResponseTryClaim (string eventId)
 Try to claim the earned rewards for an event. The claim could fail due to a variety of reasons, but this method will safely return even if an error occured. In that event, the response's TryEventClaimResponse.isClaimed will be false to let you know the claim didn't happen. If you want to see the exact failure of the claim, use Claim instead. More...
 
override async Promise< EventClaimResponseClaim (string eventId)
 Claim the earned rewards for an event. This method will an exception if the player has never submitted a score to the event. For a safer Claim method, use TryClaim More...
 
override Promise< EventsGetResponseGetCurrent (string scope="")
 
- Public Member Functions inherited from Beamable.Common.Api.Events.AbsEventsApi
virtual Promise< UnitSetScore (string eventId, double score, bool incremental=false, IDictionary< string, object > stats=null)
 Submit a score for the current player. Note that this is only allowed if the event has the write_self permission. More...
 
- Public Member Functions inherited from Beamable.Common.Api.ISupportsGet< EventsGetResponse >
Promise< TData > GetCurrent (string scope="")
 Manually fetch the available data. If the server hasn't delivered a new update, this method will not return the absolute latest data unless you pass forceRefresh as true. More...
 

Properties

EventSubscription Subscribable [get]
 
- Properties inherited from Beamable.Common.Api.Events.AbsEventsApi
IBeamableRequester Requester [get]
 
IUserContext Ctx [get]
 
- Properties inherited from Beamable.Api.IHasPlatformSubscriber< EventSubscription, EventsGetResponse, EventsGetResponse >
TPlatformSubscriber Subscribable [get]
 Allows scopes to consume fresh data when available.
 

Additional Inherited Members

- Static Public Attributes inherited from Beamable.Common.Api.Events.AbsEventsApi
const string SERVICE_NAME = "event-players"
 
- Protected Member Functions inherited from Beamable.Common.Api.Events.AbsEventsApi
 AbsEventsApi (IBeamableRequester requester, IUserContext ctx)
 

Detailed Description

This type defines the Client main entry point for the Events feature.

Related Links

img beamable-logo

Member Function Documentation

◆ Claim()

override async Promise< EventClaimResponse > Beamable.Api.Events.EventsService.Claim ( string  eventId)
inlinevirtual

Claim the earned rewards for an event. This method will an exception if the player has never submitted a score to the event. For a safer Claim method, use TryClaim

Parameters
eventIdThe runtime id of the event you'd like to claim
Returns
A promise representing the rewards the player earned
Exceptions
PlayerNotInEventExceptionIf the player has never submitted a score for this event, you'll get an error
PlatformRequesterExceptionIf you pass a bad eventId, you'll get an exception with "EventNotFound"
PlatformRequesterExceptionIf there are no pending claims, you'll get an exception with "NoPendingClaims"

Reimplemented from Beamable.Common.Api.Events.AbsEventsApi.

◆ GetCurrent()

override Promise< EventsGetResponse > Beamable.Api.Events.EventsService.GetCurrent ( string  scope = "")
virtual

◆ TryClaim()

async Promise< TryEventClaimResponse > Beamable.Api.Events.EventsService.TryClaim ( string  eventId)
inline

Try to claim the earned rewards for an event. The claim could fail due to a variety of reasons, but this method will safely return even if an error occured. In that event, the response's TryEventClaimResponse.isClaimed will be false to let you know the claim didn't happen. If you want to see the exact failure of the claim, use Claim instead.

Parameters
eventIdThe runtime id of the event you'd like to claim
Returns
A TryEventClaimResponse containing the claim response, and a boolean flag to let you know if the claim was successful.

The documentation for this class was generated from the following file: