Roblox UtilitiesDevlHub Roblox Documentation

Class

SocialService

NotCreatableServiceNotReplicated
Inherits
Instance › Object
Memory category
Instances

Facilitates social functions that impact relationships made on the Roblox platform.

SocialService facilitates social functions that impact relationships made on the Roblox platform. Its primary usage is to show invite prompts and the phone book to players, allowing them to send invitation requests to their friends through PromptGameInvite() and PromptPhoneBook() respectively. You may leverage signals when such requests are made.

Methods 15#

CanSendCallInviteAsyncIndicates whether the given Player can invite other players to a call.Yields
CanSendGameInviteAsyncIndicates whether the given Player can invite other players.Yields
GetEventRsvpStatusAsyncReturns the local player's RSVP status for the given event.Yields
GetExperienceEventAsyncReturns details for the specified experience event or nil if it is unavailable.Yields
GetPartyAsyncReturns an array of dictionaries containing data for all members of the specified party who are currently in the experience.Yields
GetPlayersByPartyIdReturns a table of all presently connected Player objects whose Player.PartyId property matches the passed partyId.
GetUpcomingExperienceEventsAsyncReturns active and upcoming experience events for the current experience.Yields
HideSelfViewHides the calling player's self view.
PromptFeedbackSubmissionAsyncPrompts the player to submit feedback or a player support ticket about the current experience.Yields
PromptGameInvitePrompts the given Player with the invite screen.
PromptLinkSharingDeprecatedYields
PromptLinkSharingAsyncGenerates an expiring share link and prompts the given Player with the platform share sheet.Yields
PromptPhoneBookPrompts the given Player with the phone book.
PromptRsvpToEventAsyncPrompts the local Player with a prompt to change their RSVP status to the given event.Yields
ShowSelfViewShows the calling player's self view.

CanSendCallInviteAsync(player: Instance): boolean#

Yields

Returns true if the given Player can send a call invite to a friend. You should always use the result of this method before calling PromptPhoneBook() since the ability to open the phone book may vary depending on the player.

NameTypeDefaultDescription
playerInstanceThe Player instance of the player potentially sending a call invite.
Returns
  • boolean — Whether the specified player can send a call invite.

CanSendGameInviteAsync(player: Instance, recipientId: User = U1.AQAAAAAAAAAAAAAAAAAAAAA): boolean#

Yields

CanSendGameInviteAsync() returns true if the given Player can invite other players to the current experience. You should always use the result of this method before calling PromptGameInvite() since the ability to invite players may vary depending on the platform or player.

See Player Invite Prompts for more details on implementing player invite prompts, customizing prompts and notifications, and using launch data.

NameTypeDefaultDescription
playerInstanceThe Player instance of the player potentially sending an invite.
recipientIdUserU1.AQAAAAAAAAAAAAAAAAAAAAAOptional Player.UserId of the potential recipient, used to check whether the sender can invite that specific recipient.
Returns
  • boolean — Whether the specified player can send an invite.

GetEventRsvpStatusAsync(eventId: string): RsvpStatus#

Yields

Returns the local player's RSVP status for the given event. Events must be in the current experience and must not have already started. If the event has already started, this method will return an error.

Use GetUpcomingExperienceEventsAsync() to obtain a valid event ID at runtime rather than hardcoding one. Note that you can use PromptRsvpToEventAsync() to prompt the player to change their RSVP status for the event.

NameTypeDefaultDescription
eventIdstringThe event ID of the event to prompt the player to change their RSVP status for. This must be a valid event ID that exists in the current experience, represented as a string (not a number).
Returns

GetExperienceEventAsync(eventId: string): ExperienceEvent?#

Yields

GetExperienceEventAsync() yields until the request completes and then returns a dictionary describing the requested event. The dictionary contains the following fields:

  • Id (string)
  • Title (string)
  • Subtitle (string)
  • Description (string)
  • DisplayTitle (string)
  • DisplaySubtitle (string)
  • DisplayDescription (string)
  • ThumbnailIds (array of numbers): Asset IDs for the event thumbnails. The first ID is the primary thumbnail.
  • StartTime (dictionary)
    • Day (number)
    • Year (number)
    • Month (number)
    • Minute (number)
    • Millisecond (number)
    • Hour (number)
    • Second (number)
  • EndTime (dictionary)
    • Day (number)
    • Year (number)
    • Month (number)
    • Minute (number)
    • Millisecond (number)
    • Hour (number)
    • Second (number)
  • HasStarted (boolean)
  • HasEnded (boolean)
  • Status (ExperienceEventStatus)
  • UserRsvpStatus (RsvpStatus or nil)

If the event cannot be found, belongs to a different experience, or the response is malformed, this method returns nil. Requests may also fail with a HttpError message if the service returns an unexpected error code.

NameTypeDefaultDescription
eventIdstringThe string identifier of the event to retrieve. Must correspond to an event in the current experience.
Returns
  • ExperienceEvent? — A dictionary describing the event, or nil if the event does not exist, belongs to another experience, or is otherwise unavailable.

GetPartyAsync(partyId: string): Array#

Yields

Returns an array of dictionaries containing data for all members associated with the given partyId. The returned array reflects the current state of the party across all active server instances within the experience and it is ordered by the time each party member accepted the party invite. This means the first element in the array is the earliest to accept and the last is the most recent.

This method is useful for retrieving up-to-date information about all party members currently in the experience and across different servers, enabling coordinated group behavior such as teleportation, matchmaking, or party-based gameplay logic.

Each dictionary in the returned array contains the following fields:

Key Value Type Description
UserId number The player's Class.Player.UserId property.
PlaceId number The Class.DataModel.PlaceId of the place the party member is currently in.
JobId string The Class.DataModel.JobId of the server instance the user currently resides in.
PrivateServerId string If applicable, the Class.DataModel.PrivateServerId when the party member is in a private or reserved server.
ReservedServerAccessCode string If applicable, the access code for the reserved server that the user currently resides in. Useful for teleporting party members to each other using Class.TeleportService:TeleportAsync().

To test this service in your experience, use the Party Simulator in Roblox Studio or publish the experience and play it in the Roblox application.

NameTypeDefaultDescription
partyIdstringThe unique identifier of the party to retrieve member data for, corresponding to a Player.PartyId value.
Returns
  • Array — An array of dictionaries representing the members of the specified party who are currently in the experience.

GetPlayersByPartyId(partyId: string): List<Player>#

Returns a table of all presently connected Player objects whose Player.PartyId property matches the provided partyId. This method behaves similarly to Players:GetPlayers() but filters the results to include only those players belonging to the specified party.

To test this service in your experience, use the Party Simulator in Roblox Studio or publish the experience and play it in the Roblox application.

NameTypeDefaultDescription
partyIdstringThe unique identifier of the party to filter players by, corresponding to a Player.PartyId value.
Returns
  • List<Player> — A table of Player objects whose Player.PartyId property matches the passed partyId.

GetUpcomingExperienceEventsAsync(): List<ExperienceEvent>#

Yields

GetUpcomingExperienceEventsAsync() yields while the client requests data for the current experience and then returns an array of dictionaries, each with the same structure described in GetExperienceEventAsync(). The array includes only events that are currently active or have not yet ended, excluding cancelled, moderated, or unpublished events. Results are sorted so the soonest start time appears first.

Use this method to discover valid event IDs at runtime rather than hardcoding them; hardcoded IDs become stale when events end and cause RSVP prompts to fail until the experience is republished.

If the service indicates there are no matching events, this method returns an empty array. Requests may raise a HttpError message if the service returns an unexpected error code.

Returns
  • List<ExperienceEvent> — An array of dictionaries describing each active or upcoming event in the current experience, ordered by soonest start time first.

HideSelfView(): ()#

Hides the calling player's self view. If this method is called while the self view is already hidden, it does nothing.

Returns
  • ()

PromptFeedbackSubmissionAsync(options: Dictionary?): ()#

Yields

Displays a dialog to the player, allowing them to provide feedback about their experience or submit a player support ticket.

  • The submitted feedback becomes available to developers in the Creator Dashboard under the Audience > Feedback section.
  • The submitted player support requests become available to developers in the Creator Dashboard under the Audience > Player Support section. The Player Support flow is currently in alpha and is only available to select experiences.

This method yields until the player either submits feedback, dismisses the dialog, or a timeout is reached. As an asynchronous operation, it should be called using task.spawn() or within a coroutine.

Feedback Types#

The FeedbackType key in the options dictionary determines which flow is displayed:

  • FeedbackType.Feedback (default) — Displays a general feedback prompt where the player can rate and comment on the experience.
  • FeedbackType.PlayerSupport — (Alpha; select experiences only) Displays a player support flow where the player can submit a categorized support ticket directly to the experience developer. This enables in-experience customer support without requiring players to leave the game.

Feedback Flow#

When FeedbackType is FeedbackType.Feedback (or omitted), the player is shown a general feedback prompt where they can rate and optionally comment on the experience. Submitted feedback appears in the Creator Dashboard under Audience > Feedback. Players can submit feedback once per day per experience.

Player Support Flow (Alpha)#

When FeedbackType is set to FeedbackType.PlayerSupport, the player is guided through a support ticket submission flow. This flow is currently in alpha and is only available to select experiences. The prompt presents a form where the player selects a category, writes a description of their issue, and chooses whether to share their user ID with the developer. The available categories are:

Category Description
Bug Report The player is reporting a bug or technical issue.
Data Restore Request The player is requesting that lost or corrupted data be restored.
Purchasing Issue The player has an issue with an in-experience purchase.
Other A general issue that does not fit the other categories.

The player also chooses whether to share their Player.UserId with the developer as part of the ticket.

Eligibility#

Before showing the prompt, this method performs an eligibility check. The eligibility rules differ depending on the feedback type.

A player is ineligible for the Feedback flow if:

  • The player is the experience owner (developers cannot submit feedback for their own experiences).
  • The player has been rate limited (submitted too many reviews recently).
  • The player does not meet age requirements.

A player is ineligible for the Player Support flow if:

  • The player does not meet age requirements.
  • The player already has 5 in-progress tickets.
  • The player is banned from the experience.

If the player is ineligible, the prompt displays a message indicating that feedback or support is unavailable and the method returns without error.

Notes#

  • This service does not work during playtesting in Roblox Studio. To test the feedback prompt, you must publish the experience and play it in the Roblox application.
  • The method will time out and resume if the player does not interact with the prompt within a reasonable period.
  • If the submission fails due to a text filter violation or network error, the player is notified within the dialog.
NameTypeDefaultDescription
optionsDictionary?Optional Dictionary configuring the prompt. Supported keys: - FeedbackType (FeedbackType). Selects which feedback flow to display. Defaults to FeedbackType.Feedback.
Returns
  • ()

PromptGameInvite(player: Instance, experienceInviteOptions: Instance = nil): ()#

PromptGameInvite() displays an invite prompt to the local player through which they may invite their friends to the current experience. Before calling this method, you should use CanSendGameInviteAsync() to determine whether the player can send an invite, as this ability may vary depending on the platform or player.

See Player Invite Prompts for more details on implementing invite prompts, customizing prompts and notifications, and using launch data.

NameTypeDefaultDescription
playerInstanceThe Player to prompt with the invite popup.
experienceInviteOptionsInstancenilOptional ExperienceInviteOptions object for customizing the prompt.
Returns
  • ()

PromptLinkSharing(player: Player, options: Dictionary = nil): Tuple#

YieldsDeprecatedDeprecated

Deprecated. Use PromptLinkSharingAsync() instead.

NameTypeDefaultDescription
playerPlayerPrompts the given Player with a Roblox platform-level share sheet with a generated share link.
optionsDictionarynil

Dictionary that specifies the configuration for the generated link. It includes the following optional key-value pairs:

  • FallbackLinkId (string). Determines how this share link will direct player to once expired. Default to experience join link.
  • ExpirationSeconds (number). Determines time to expiration once the share link is created. Truncates to nearest integer. Defaults to 86,400.
  • PreviewTitle (string) Preview title of the share link.
  • PreviewDescription (string) Preview description of the share link.
  • PreviewAssetId (number) Image asset ID used for share link preview.
  • LaunchData (string). Used to set a parameter in Player:GetJoinData() when a player joined using the generated share link.
Returns

PromptLinkSharingAsync(player: Player, options: Dictionary = nil): Tuple#

Yields

This call is restricted to server scripts. After a link is successfully generated, the target player will either be prompted to open a share sheet with the generated link, or the link will be copied directly to the clipboard if share sheet functionality is not available to the player.

NameTypeDefaultDescription
playerPlayerPrompts the given Player with a Roblox platform-level share sheet with a generated share link.
optionsDictionarynil

Dictionary that specifies the configuration for the generated link. It includes the following optional key-value pairs:

  • FallbackLinkId (string). Determines how this share link will direct player to once expired. Default to experience join link.
  • ExpirationSeconds (number). Determines time to expiration once the share link is created. Truncates to nearest integer. Defaults to 86,400.
  • PreviewTitle (string) Preview title of the share link.
  • PreviewDescription (string) Preview description of the share link.
  • PreviewAssetId (number) Image asset ID used for share link preview.
  • LaunchData (string). Used to set a parameter in Player:GetJoinData() when a player joined using the generated share link.
Returns

PromptPhoneBook(player: Instance, tag: string): ()#

Prompts the given Player with the phone book. If the player chooses to call someone, the CallInviteStateChanged event fires. You should use CanSendCallInviteAsync() prior to calling PromptPhoneBook() since the ability to see the phone book may vary depending on the player.

If a player is not eligible to open the phone book, an error dialog is shown.

NameTypeDefaultDescription
playerInstanceThe player to prompt with the phone book.
tagstringString to help differentiate between various phone book "entry points" or similar. For example, you can pass a string defining what region of an experience the calling player's character is currently in.
Returns
  • ()

PromptRsvpToEventAsync(eventId: string): RsvpStatus#

Yields

PromptRsvpToEventAsync() displays a prompt to the local player through which they may change their RSVP status to the given event.

Events must be in the current experience and must not have already started. If the event has already started, this method will return an error.

Note that you can use GetEventRsvpStatusAsync() to check the player's current RSVP status before calling this method.

NameTypeDefaultDescription
eventIdstringThe event ID of the event to prompt the player to change their RSVP status for. This must be a valid event ID that exists in the current experience, represented as a string (not a number).
Returns
  • RsvpStatus — Returns a RsvpStatus indicating the player's new RSVP status after the prompt is closed. If the player closes the prompt without changing their RSVP status, this will return RsvpStatus.None or their old RsvpStatus if they had already selected a status.

ShowSelfView(selfViewPosition: SelfViewPosition = LastPosition): ()#

Shows the calling player's self view. If this method is called while the self view is already visible, it does nothing.

NameTypeDefaultDescription
selfViewPositionSelfViewPositionLastPositionThe position to place the self view .
Returns
  • ()

Events 4#

CallInviteStateChangedFires when a player's call invite state changes.
GameInvitePromptClosedFires when a player closes an invite prompt.
PhoneBookPromptClosedFires when a player closes the phone book prompt.
ShareSheetClosedFires when the player closes the share sheet opened by PromptLinkSharingAsync().

CallInviteStateChanged(player: Instance, inviteState: InviteState)#

This event fires when a player's call invite state changes.

NameTypeDefaultDescription
playerInstanceThe Player instance of the player who had a call invite state change.
inviteStateInviteStateThe new call invite state.

GameInvitePromptClosed(player: Instance, recipientIds: Array)#

This event fires when a player closes an invite prompt.

NameTypeDefaultDescription
playerInstanceThe Player instance of the player who closed the prompt.
recipientIdsArrayNo longer populated; an empty array.

PhoneBookPromptClosed(player: Instance)#

Fires when a player closes the phone book prompt.

NameTypeDefaultDescription
playerInstanceThe Player instance of the player who closed the phone book.

ShareSheetClosed(player: Player)#

Fires on the server when the player closes or dismisses the platform share sheet that was opened as a result of a successful call to PromptLinkSharingAsync(). The player argument is the Player who closed the share sheet.

NameTypeDefaultDescription
playerPlayerThe Player who closed the share sheet.

Callbacks 1#

OnCallInviteInvokedCallback for when a call is placed from the phone book.

OnCallInviteInvoked(tag: string, callParticipantIds: Array): Instance#

A callback to process when a call is placed from the phone book. The tag parameter can be used to differentiate between different "entry points" or similar, as described in PromptPhoneBook(). Only one callback can be set.

NameTypeDefaultDescription
tagstringString to help differentiate between various phone book entry points.
callParticipantIdsArrayArray containing all of the players involved in the call. The caller will always be the first player in the array.
Returns

Inherited members#

Inherited from Instance 58
Inherited from Object 6
Properties (2)

ClassName, className

Events (1)

Changed