SocialService:PromptGameInvite()'s LaunchData is unreliable

LaunchData is mostly reliable but is not guaranteed 100% of the time. This issue occurs in this game:

This is the function that we use to prompt the game invites:

function InviteFriendsService.InviteFriendsToGame(player)
    local InviteOptions = Instance.new("ExperienceInviteOptions")
    InviteOptions.PromptMessage = PROMPT_MESSAGE
    InviteOptions.LaunchData = HttpService:JSONEncode({ PlayerWhoInvited = player.UserId })
    InviteOptions.InviteMessageId = INVITE_STRING

    local Success, Result = pcall(function()
        return SocialService:PromptGameInvite(player, InviteOptions)
    end)

    warn(Result)
end

Expected behavior

LaunchData should make it into each and every call from SocialService:PromptGameInvite() without failure. A feature we use for players to invite their friends depends on LaunchData to reference and reward the player who invited them. A workaround is infeasible at the moment because the invite buttons are inaccessible under CoreGui.

4 Likes

Finding someone to take a look at this, thanks for the report!

1 Like

this is still an issue, and it happens when tapping notifications from the website, notifications in-app, and push notifications. i havent had the launchdata work ever

Issues I ran into when using PrompGameInvite are:

  • The prompt message not appearing in the default CoreGui most of the time, seemingly at random (could not figure out why it was working sometimes and not working at other times). I ended up making my own gui for this

  • The launch data gets cut if it contains the “%” character (the % and every character afterwards isn’t retrieved)
    I didn’t test this one in depth. I am compressing some numbers that then goes into a table encoded with json. Removing “%” from the set of characters that are used to compress numbers seems to have fixed my issue

Hi @music_man1996,

There’s been three months since this issue was reported. How has any movement been made on it?

Thanks

Hey! We recently rolled out a fix to the backend systems that should preserve LaunchData more reliably. It should always be included now. Let us know if you still have issues with this!

1 Like