Sharing on Windows
Callbacks
Add the following callbacks for the sharing feature.
- Unity
- Unreal Engine
API | Function |
---|---|
AddFriendBaseResultObserver | Adds the BaseResult callback to manage SendMessage and Share callbacks. |
RemoveFriendBaseResultObserver | Delete the BaseResult callback. |
API | Function |
---|---|
SetFriendBaseResultObserver | Sets BaseResult callback for SendMessage and Share. |
GetFriendBaseResultObserver | Gets BaseResult callback for SendMessage and Share. |
OnFriendBaseResult_Implementation | Implements BaseResult callbacks for SendMessage and Share. |
Sharing by channels
Follow the instructions for each channel to implement the sharing feature.
Steam
The sharing feature for Steam supports invite friends to the current game using a special invite string. When the target friend accepts the invite, pchConnectString
is added to the connand line when starting the gamel.
To invite a friend, get the friend's OpenID for the Steam channel by calling 'QueryFriends', and then pass the OpenID to the user
property of the FriendRequestInfo
data structure while calling SendMessage
.
To invite a friend using the special invite string, add the special invite string pchConnectString
to the description
property of the FriendRequestInfo
data structure when calling SendMessage
.
- Unity
- Unreal Engine
var friendInfo = new INTLFriendReqInfo();
friendInfo.Type = INTLFriendReqType.Friend_REQ_INVITE;
friendInfo.User = "123214"; //The OpenID of the friend to invite;
friendInfo.Description = "abc"; //Special invitation string, invite friends or group members to join the current game, if the target user accepts the invitation, pchConnectString will be added to the command line when starting the game
INTLAPI.SendMessage(friendInfo, INTLChannel.Steam);
FINTLFriendReqInfo friendReqInfo;
friendReqInfo.Type = EINTLFriendReqType::kReqInvite;
friendReqInfo.User = "123214"; //The OpenID of the friend to invite;
friendReqInfo.decription = "abc"; //Special invitation string, invite friends or group members to join the current game, if the target user accepts the invitation, pchConnectString will be added to the command line when starting the game
UINTLSDKAPI::SendMessage(friendReqInfo, EINTLLoginChannel::kChannelSteam);
Error codes
The following table shows some common error codes in the Steam channel.
ErrorCode | Description |
---|---|
1031 | Steam DLL failed to load |
1032 | Need to pull the game from the Steam platform |
1033 | Steam initialization failed Usually because steam_appid.txt is not placed in the same directory as the executable .exe file, or the Steam software did not start. |