SocialService Documentation Issues

The following links have a code sample at the bottom which uses block quotes:
https://developer.roblox.com/api-reference/function/SocialService/CanSendGameInviteAsync
https://developer.roblox.com/api-reference/function/SocialService/PromptGameInvite
Both are affected by the same issue.
Picture of the issue:

There also seems to be some other programming mistakes such as this line:

Should be:

local res, canSend = pcall(SocialService:CanSendGameInviteAsync(targetPlayer))

Another line:
Invite%20Error

Should be:

local res, canInvite = pcall(SocialService:PromptGameInvite(targetPlayer))
8 Likes

Even this correction is not the right usage, both of those lines should either be this:

local res, canSend = pcall(function() return SocialService:CanSendGameInviteAsync(targetPlayer) end)

local res, canInvite = pcall(function() return SocialService:PromptGameInvite(targetPlayer) end)

or this:

local res, canSend = pcall(SocialService.CanSendGameInviteAsync, SocialService, targetPlayer)

local res, canInvite = pcall(SocialService.PromptGameInvite, SocialService, targetPlayer)

Also on the SocialService:CanSendGameInviteAsync page, there is a strange denotation of the RBXScriptSignal / Event:


and very similarly on SocialService:PromptGameInvite:

3 Likes

Looks like an engineer wrote this and the publisher forgot to double check the code samples lol.
rbx::signal is the backend object for events.

4 Likes

Oddly enough, still not fixed and it has almost been a year. Was wondering why it kept saying CanSendGameInvite wasn’t a part of SocialService then re-read the docs and saw that it was supposed to be CanSendGameInviteAsync.

3 Likes

I’ve went ahead and fixed these pages (edit: and the code sample), thank you for the bump @DarkViperTV! For the record, the best way to pcall an Instance function is:

local res, canSend = pcall(SocialService.CanSendGameInvite, SocialService, targetPlayer)
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.