Activities
Description
Activities in r4nkt are key. Your app will report your player activities, which is how r4nkt knows what actions your players have performed. You do this via API.
Whenever your player performs a given action, you report this to r4nkt. The player activity is recorded and r4nkt goes into action. Among other things, it triggers any defined reactions, it determines whether any achievements have been earned, it updates leaderboards, if necessary, and it notifies you if anything interesting has taken place.
Properties
Actions have the following properties:
UUID
This is a universally unique identifier for the individual activity. You may provide your own UUID when reporting a new activity, otherwise r4nkt will automatically generate one.
Custom Action ID
This is the custom ID for the action that the player has performed. This must match an existing action within your game.
Custom Player ID
This is the player's custom ID.
If this custom ID is new to r4nkt, then a new player will be automatically created with this custom ID.
Custom Session ID
@todo 🤓
Amount
This is the number of times the player has performed the specified action.
Sometimes it makes sense that the player has performed something more than once at a given moment. Consider, for example, that you have an action for archiving documents. If the player archives a single document, then you could not send this field and r4nkt will default it to 1. Alternatively, you can send the field and the explicit value of 1. But, if your app supports a bulk archive function, then you would send this field with the amount of files that are bulk archived.
Date/Time
If this field is not sent, then r4nkt assumes that the player has just performed this action. If you choose to send this data, however, it must be a date/time in the past.
The date/time is always interpreted as belonging to the UTC time zone. You must remember to convert the date/time from any non-UTC time zone before reporting the player activity.
The date/time must have the following format: 2021-03-14 12:34:56
Custom Data
You can pass custom data whenever player activity is reported. Taking advantage of this feature opens up a great deal of possibilities when it comes to defining interesting and unique-to-your-app achievement criteria. Please read about custom data references for more information.
Last updated