[ENABLED as of May 28] SocialService Game Invites are Live

EDIT: Thursday, May 28th


Good evening Robloxia,

Earlier today, we have enabled the SocialService API and its members.

Players have been able to invite their friends into games for a while now through the ESC menu, and now this new API allows you to prompt your players to invite their friends into your games!

But wait; there’s more! You may even connect to the GameInvitePromptClosed event and receive details when users close the invitation dialog.
(Side note: This event will still fire even if the player decides to open the menu themselves from the ESC menu.)


This is the cool Invitation Popup players will see.

29%20PM
And then, the recipients will receive a chat message prompting them to join their game. Sweetness!

With this feature, we hope to encourage our developers to further enhance the social Roblox experience.

Documentation

Documentation is currently pending on the Developer Hub and a link will be posted here once it is available.

Expand Documentation

SocialService facilitates social functions that impact relationships made on the Roblox platform.
Developers are able to prompt their players to send game invitation requests to players’ friends and leverage signals when users invite their friends to their games

Function: SocialService:CanSendGameInviteAsync

Summary: Returns true if the targetPlayer can send chat messages.
This may yield. This function may only be invoked from a LocalScript.

Usage

Use this method to determine if the targetPlayer is able to send game invites. After calling this method, use the result to determine if elements should be disabled or rendered invisible to avoid a poor user experience when SocialService:PromptGameInvite does not do anything.

Since this method is not guaranteed to execute without throwing, it is advised to wrap the usage of this function with a pcall.

Parameter: Player targetPlayer: The player instance of the user used to determine if the client can send a game invite.
Error: Will error if called from a Script. Will error if web response is not successful.

Function: SocialService:PromptGameInvite

Summary: Prompts the targetPlayer with the Game Invite popup. This function may be invoked from a LocalScript or Script. If the player cannot send game invites, this prompt will be ignored by the targetPlayer. See SocialService:CanSendGameInviteAsync

Parameter: Player targetPlayer: This Player will be shown the Game Invite popup.
Error: This will error if called from a LocalScript and the targetPlayer parameter is not the LocalPlayer.

Event: SocialService.GameInvitePromptClosed

Summary: An event invoked when a player has closed the game invite prompt. This prompt can be prompted by the developer using SocialService:PromptGameInvite or accessed by the user from the SettingsHub/Esc menu.
Parameter: Player senderPlayer: The player instance who has closed the prompt.

Demo

Here is an open sourced demo of this new feature. Handle with care!

221 Likes

This seems neat, but it also seems like it could be abused by developers. What’s to stop a developer from inviting everyone’s friends without the user agreeing?

26 Likes

This is a valid concern. This modal works very similarly to the current developer prompted purchase popup.

The developer cannot force the targetPlayer to invite a particular friend exactly the same way that developers now cannot force the targetPlayer to accept a purchase prompt. I’d imagine games that abuse this feature (by showing the prompt far too often) will drive their players away organically.

51 Likes

Is this feature supported in paid games, so that developers can set up an effective viral referral system for their early access game?

30 Likes

Alright, thank you. I thought the developers would be able to send the requests without player input. Glad to hear that’s not the case.

12 Likes

To be clear, this means that people who can’t send chat messages can’t send game invites either, right? Is this the same as CanUserChatAsync or are there situations where someone can chat and not send invites? I’ll definitely use the new function with other SocialService stuff so that I don’t have to define variables for both SocialService and Chat, I’m just curious if there’s any differences on how they act.

8 Likes

There are no limitations against a paid access game. This usecase is totally within reason if you wanted to reward the first player to send an invitation to a user. At this time, we do not have a way to verify which invitation was RSVP’d when a user joins the game, but that should not prevent you from setting up a basic version of this model. :smile:

A very good question. CanUserSendGameInviteAsync is not the same as CanUserChatAsync. The ChatService:CanUserChatAsync tests against the in-game chat setting and the SocialService:CanUserSendGameInviteAsync tests against the app/website chat setting (among other checks).

This is a very important distinction to make and I am happy you brought it up!

25 Likes

Glad to hear that. Developers already have the ability to tell whenever a player joins a game by following another player. Are there plans to expose information to developers for when a player joins via an invite?

17 Likes

I’ve got lots of ideas that I can’t wait to try out with this new feature, I’ve been hyped since i saw its addition in the changelogs.

5 Likes

These are the cutting-edge features we need to power the present and future developers of Roblox. Huge props for releasing this! :+1:

6 Likes

Would it be possible to send an invite to the current place rather than the start place of the universe in the future? I could see that being used for a sort of “Invite to Group” system

16 Likes

This. I have a universe set up where people play ‘rounds’ in groups of four using TeleportToPrivateServer and Reserved Servers. I would like to have users join mid-game in these rounds. SocialService can’t do this right now?

16 Likes

As of now, this is not possible by SocialService alone, but I also would like to push for @Xiousa’s stance on SocialService to be applicable to current places as well. :+1:

4 Likes

Seems that SocialService still makes it impossible for players to follow their friends into a place that’s not the start place.

Perhaps time to get some support behind this feature request: Game Setting To Allow Other Players To Join A Non-Start Place of a Game

14 Likes

Oh bet, this is neat stuff. I’m gonna check this out now.

6 Likes

I’ve just made made a feature request for this.

9 Likes

So, I did some quick testing in my own place on the new API.
I have some suggestions on improved functionality that could benefit developers and users.

Currently, when you invite someone from within the game, and they click the “Play” prompt, it acts as though the player went to the game page and clicked play;

I believe the behavior of the invite should more closely represent that of clicking “Follow” or “Join in Game” on someone’s profile like this;

The reasoning for this is I believe that the intention of inviting someone to a game is to get them to follow you into a specific server in a place, and not just to play the game in general.

This could benefit the developer as well as it’d allow them to easily track successful invites without too much work on their end, it’d also remove the need for Roblox staff to make changes to the back-end to track this info, as it’d use systems already present on the platform.

22 Likes

In addition, this can mean the API could lead to false positives, which can throw off the intention of this API, as well as future use of it by developers.

3 Likes

Useful feature!

But also, can :SetCore(“PromptSendFriendRequest”), :SetCore(“PromptUnfriend”), :SetCore(“PromptBlockPlayer”) and :SetCore(“PromptUnblockPlayer”) be moved to SocialService? I don’t really get why they’d be in :SetCore

30 Likes

Seems like an awesome feature. Will definitely use it for my project!

5 Likes