Hi Creators,
We are excited to announce two new APIs that allow you to prompt a user to RSVP to an upcoming experience event (or update) from within your experience.
Experience events and updates are a great way to notify users about upcoming updates to your experience or to highlight live events happening within it. These new APIs have already started rolling out and you can use them in your experience right now!
Here is an example of what this new prompt UI looks like:
We may modify this UI in the future to provide more information about the event, so if you have any feedback, please let us know!
Details
We have added two new methods to SocialService:
Enum.RsvpStatus GetEventRsvpStatusAsync(eventId: string)
- Gets the RsvpStatus of the local player for the given eventId. RsvpStatus is one of Going, NotGoing and None.
Enum.RsvpStatus PromptRsvpToEventAsync(eventId: string)
- Prompts the local player to change their RsvpStatus for the given event. If the user is not following the event, they will be given the option to follow it. If the user is already following the event, they will be given the option to unfollow it.
These methods only work with events and updates in the current universe that have not already started. The eventId should be used as a string - currently, eventIds are random 64-bit ints, and some eventIds do not fit inside the maximum Lua number that can be represented without precision loss. We may also change the eventId to be a UUID in the future.
Sample Code
The following script has RunContext set to Client and is placed in a podium to notify users about the new event, featuring two proximity prompts: one for following the event and one for unfollowing it. The proximity prompts are enabled or disabled based on the player’s RSVP status.
Code Sample
Click here to view a sample of the code!
local SocialService = game:GetService("SocialService")
local EVENT_ID : string = "YOUR_EVENT_ID"
local unFollowPrompt : ProximityPrompt = script.Parent.UnfollowProximityPrompt
local followPrompt : ProximityPrompt = script.Parent.FollowProximityPrompt
local function updatePrompt(rsvpStatus : Enum.RsvpStatus)
if rsvpStatus == Enum.RsvpStatus.Going then
unFollowPrompt.Enabled = true
followPrompt.Enabled = false
else
unFollowPrompt.Enabled = false
followPrompt.Enabled = true
end
end
local success, currentRsvpStatus = pcall(function()
return SocialService:GetEventRsvpStatusAsync(EVENT_ID)
end)
if not success then
-- Could not retrieve RSVP status, don't enable either proximity prompt
warn("Failed to get RSVP status:", currentRsvpStatus)
return
end
print("CurrentRsvpStatus:", currentRsvpStatus)
updatePrompt(currentRsvpStatus)
unFollowPrompt.Triggered:Connect(function(player)
local rsvpStatus = SocialService:PromptRsvpToEventAsync(EVENT_ID)
updatePrompt(rsvpStatus)
end)
followPrompt.Triggered:Connect(function(player)
local rsvpStatus = SocialService:PromptRsvpToEventAsync(EVENT_ID)
updatePrompt(rsvpStatus)
end)
Known Issues
We have noticed a slight issue with the formatting of Event Descriptions. Our team is currently working to address this issue. For now, you are still able to adjust the text how you seem fit, or not use the prompt.
These APIs are currently disabled on console due to a bug with the gamepad button selection there. You can pcall these APIs as shown in the code sample to work around this if you want to use it before it’s available on all platforms.
We will update you once these issues have been fixed.
What’s Next
Our vision for Experience Events & Updates is that it is a premier channel for you to announce upcoming content and features for your experiences, and to build awareness and excitement among your community! We are also working on potential changes to how events and updates are surfaced in the Home and Charts tabs, as well as in Analytics tools, to help you track the effectiveness of each event and understand how to improve them.
Let us know if you have any questions or feedback on other experience events/updates-related APIs that you would like to see!
Thank you.