It appears that LaunchData is nil/ blank ‘’ for certain users. I have not made any changes to the code; it works for most users, but there are two users who do not receive any LaunchData. I tested this on a testing server, and the LaunchData when a player joins my invite looks like this:
However, when I join their invite, the LaunchData is completely blank:
There isn’t a consistent step-by-step reproduction. For example, I invited my alt account, and it received the invite correctly. Then, the user experiencing issues invited my alt in a brand new server, but the LaunchData was blank, as shown in the image above. I’ve received two reports of this issue so far, so it seems to affect a very small portion of users. One user also mentioned that it worked flawlessly three times, but afterward, no other invite requests triggered an in-game +1, which must be due to the LaunchData being nil.
Server Code Snippet:
local Player_Debs = {}
local function onPlayerAdded(PlayerWhoJoined)
-- debounce --
if Player_Debs[PlayerWhoJoined.UserId] then
return
end
-- debounce --
-- getIsInvitedData --
local launchData
for i = 1, ATTEMPT_LIMIT do
task.wait(RETRY_DELAY)
local joinData = PlayerWhoJoined:GetJoinData()
if joinData.LaunchData ~= "" then
launchData = joinData.LaunchData
break
end
end
-- getIsInvitedData --
if not launchData then
return
end
-- decode --
local data = HttpService:JSONDecode(launchData)
local PlayerWhoInvited = data.senderUserName and Players:FindFirstChild(data.senderUserName)
-- decode --
end
Client Code:
-------------------- Services --------------------
local HttpService = game:GetService("HttpService")
local SocialService = game:GetService("SocialService")
--
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
-------------------- Services --------------------
local data = {
senderUserName = LocalPlayer.Name,
}
local launchData = HttpService:JSONEncode(data)
-- Construct invite options with launch data --
local inviteOptions = Instance.new("ExperienceInviteOptions")
inviteOptions.LaunchData = launchData
-------------------- Sounds --------------------
local ClickSound1 = script:WaitForChild("ClickSound1")
local ClickSound2 = script:WaitForChild("ClickSound2")
-------------------- Sounds --------------------
script.Parent.MouseButton1Click:Connect(function()
ClickSound1:Play()
ClickSound2:Play()
local success, errorMessage = pcall(function()
SocialService:PromptGameInvite(LocalPlayer, inviteOptions)
end)
end)
Expected behavior
It should always send the LaunchData; maybe there has been a backend change that could’ve broken it for certain Users? Note: The person sent the invite from a mobile device through the ingame invite screen.