Shared Service

Introduction

WhoAmIShared is a service within WhoAmIService that provides player-related information based on all the data we may have of them across our games portfolio.

Usage

The following helper functions are available, allowing developers to easily access common player attributes without dealing with API requests directly.

Function Name
Description
Return Value

IsPayer

Checks if the player has made any previous purchases in this or any other LionStudio game.

Boolean

Example

bool isPlayerIsPayer = await WhoAmIService.Shared.IsPayer();

Advanced Usage

If developers need additional data beyond the predefined functions, a generic method is available. This method allows retrieving custom values without requiring LionSDK update.

Generic method: The GetValue<T>() function enables fetching custom data based on a specified key. The returned value can be of any primitive data type or a custom class.

  • Code signature

    WhoAmIService.GetValue<T>("key");
  • Full Example:

    bool isPlayerIsPayer = await WhoAmIService.Shared.GetValue<bool>("is_payer");

Key parameter in GetValue<T> function is defined by Lion Studios team.

Last updated

Was this helpful?