🖥️
PLAY SDK Documentation
v0.13.0-dev (Obsolete)
v0.13.0-dev (Obsolete)
  • 🛠️ENVIRONMENT SETUP
    • Overview
    • PLAY Sample Package
  • 🖥️SDK Integration Guides
    • Getting Started
      • Unity
        • Tech Requirements
        • Step 1 - Import packages
        • Step 2 - Import credentials
        • Step 3 - Environments
        • Step 4 - Initialization
      • Unreal
        • Tech Requirements
        • Step 1 - Import packages
        • Step 2 - Configure credentials
        • Step 3 - Environments
        • Step 4 - Initialization
    • Authentication
      • Unity
      • Unreal
    • User Profile
      • Unity
      • Unreal
    • Virtual Items
      • Unity
      • Unreal
    • Inventory
      • Unity
      • Unreal
    • Store
      • Unity
      • Unreal
    • Currency (IAP)
      • Unity
      • Unreal
    • Achievements
      • Unity
      • Unreal
    • Game Progress
      • Unity
      • Unreal
    • Leaderboards
      • Unity
      • Unreal
    • Matchmaking
      • Unity
      • Unreal
    • Wallets
      • Unity
      • Unreal
    • Analytics
      • Unity
      • Unreal
    • Notifications
      • Unity
      • Unreal
    • Module Requests
  • 🎲Game Design Guides
    • Overview
    • User Authentication
    • User Profile
    • Game (Progression + Rewards)
    • Virtual Items
    • Currency (IAP)
    • Store
    • Inventory
    • Achievements
    • NFT Purchase Flow & Wallets
    • Limited-Time Offers
    • NFT Passes
  • 📌Links
    • PLAY Whitepaper
    • PLAY Postman API Doc
    • PLAY Dev Dashboard
    • PLAY Example Repository Dev
    • PLAY Example Repository Prod
    • API Endpoints
    • Report an Issue
    • Discord dev-chat
    • Telegram Community Channel
    • Social Links
Powered by GitBook
On this page
  • Introduction
  • Load User Profile
  • Update UserName/Display Name
  • Update User Bio
  • Retrieve User Currencies
  • "rgn-coin" Currency

Was this helpful?

Export as PDF
  1. SDK Integration Guides
  2. User Profile

Unity

Unity integration

Introduction

The user profile module is used to store user specific data related to his identity.

UserProfileData
  • userId (string): Unique READYgg ID for a user. Authenticated user has the same ID accross applications using READYgg.

  • email (string): Email of the authenticated user.

  • displayName (string): Authenticated user share the same display name accross applications using READYgg.

  • profilePicture (userProfilePicture): Authenticated user share the same profile picture accross applications using READYgg.

  • bio (string): Authenticated user share the same bio accross applications using READYgg.

  • currencies (List<Currency>): Contains all the currencies user collected for your application.

UserProfileData class methods

  • GetRGNCoinBalance();

    • Return the amount of rgn-coin for this user.

  • GetCustomCoinBalance(string currencyName);

    • Return the amount of your custom currency for this user.

Load User Profile

using RGN;
using RGN.Modules.UserProfile;
using UnityEngine;

public class UserProfileExample : MonoBehaviour
{
    public async void LoadUserProfileDataAsync()
    {
        string userId = RGNCore.I.MasterAppUser.UserId;
        UserProfileData userProfileData = await UserProfileModule.I.GetFullUserProfileAsync<UserProfileData>();
        Debug.Log($"Display name : {userProfileData.displayName} \n" +
            $"Bio : {userProfileData.bio} \n" +
            $"Email : {userProfileData.email} \n");
    }
}

Update UserName/Display Name

using UnityEngine;
using RGN.Modules.UserProfile;

public class UserProfileExamples : MonoBehaviour
{
    private async void UpdateDisplayName()
    {
        string newDisplayName = await UserProfileModule.I.SetDisplayNameAsync("New display name");
        Debug.Log($"Display name : {newDisplayName}");
    }
}

Update User Bio

using UnityEngine;
using RGN.Modules.UserProfile;

public class UserProfileExamples : MonoBehaviour
{
    private async void UpdateUserBio()
    {
        string newBio = await UserProfileModule.I.SetBioAsync("This is my user description");
        Debug.Log($"Bio : {newBio}");
    }
}

Retrieve User Currencies

using UnityEngine;
using System.Collections.Generic;
using RGN.Modules.UserProfile;
using RGN.Modules.Currency;

public class UserProfileExamples : MonoBehaviour
{
    private async void GetUserCurrencies()
    {
        List<Currency> currencies = await UserProfileModule.I.GetUserCurrenciesAsync();
        foreach (Currency currency in currencies)
        {
            Debug.Log($"Type : {currency.name} Quantity : {currency.quantity}");
        }
    }
}

"rgn-coin" Currency

PreviousUser ProfileNextUnreal

Last updated 1 year ago

Was this helpful?

Similar to other in-game currencies but it can only be obtained by making In-App Purchases - it cannot be earned or given as a reward to players. It is consumed to purchase NFT . For more details about the rgn-coin, please refer to the .

🖥️
Currency module
#virtual-items