Skip to main content

Guide

Overview

PGOS Overlay allows you to display sharing links with custom content, which you can send in any chat. Customizable fields include:

  • Title
  • Content text
  • Button text
  • Additional information in string content

This function can be used in many scenarios, such as to send team invite cards, gift cards, and giveaways to players. Real-time card content updates are not currently supported.

share_link_overview

1. Create and send a card

To create a card, call the API UPgosChatManager::MakeShareLinkDataV1():

/**
* Create ShareLink data
* @param Title title text
* @param Description content text
* @param ButtonTitle button text
* @param Payload (optional) additional information to be provided, generally used to pass interaction specifics to interaction response events
* @param Tag (optional) any string content, often used to distinguish among ShareLinks with different interaction responses
*/
UFUNCTION(BlueprintCallable, BlueprintPure, Category="PGOS Overlay|Chatting|Share Link")
FPgosChatMessageData MakeShareLinkDataV1(FText Title, FText Description, FText ButtonTitle, FString Payload = TEXT(""), FString Tag = TEXT(""));

The return value is sent to the specified channel through the UPgosChatChannel::SendMessageData() API. The following code snippet shows a typical use case:

share_link_sample

2. Response card interaction

When a player clicks a card button in the chat content, this triggers a OnShareLinkClicked event for UPgosChatManager:

// in class UPgosChatManager
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FDelegateOnShareLinkClicked, const FPgosShareLinkData&, ShareLinkData);

UPROPERTY(BlueprintCallable, BlueprintReadWrite, BlueprintAssignable, Category="PGOS Overlay|Chatting")
FDelegateOnShareLinkClicked OnShareLinkClicked;

Listen for this event to provide card interaction responses. The following code snippet shows a typical use case:

share_link_bind

share_link_onclick