Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
ManishThapa's avatar
ManishThapa
Honored Guest
3 years ago

Quick Invite link not working

I have tried implementing quick invite link but it shows User cannot other invite other, set the group presence to be at Destination, lobby session id and join able to be true. Even though user presence is set and this works with the oculus invite panel that overlays over the game. Here is the code snippet: 

 

public void LaunchInvitePanel()
{
SetPresence();
//ErrorMessage.text = "Launching Invite Panel...";
var options = new InviteOptions();
/*if (SuggestedUserID != 0)
{
options.AddSuggestedUser(SuggestedUserID);
}*/

//this works
GroupPresence.LaunchInvitePanel(options);
//this doesn't work
GroupPresence.SendInvites(SuggestedUserID).OnComplete(invitesent);
}

public void invitesent(Message<SendInvitesResult> msg)
{
//ErrorMessage.text = "";

if (!msg.IsError)
{
foreach (var invite in msg.Data.Invites)
{
//Text just to show return message
AchievementText.text = AchievementText.text + invite.RecipientOptional.OculusID;
}
}
else
{
// Text just to show error from the callback
AchievementText.text = msg.GetError().Message;
}
}

 

public IEnumerator set(String dest, string lobbyID, string matchID, bool joinable)
{
bool setError = true;
GroupPresenceOptions groupPresenceOptions = new GroupPresenceOptions();
groupPresenceOptions.SetDestinationApiName(dest);
groupPresenceOptions.SetLobbySessionId(lobbyID);
groupPresenceOptions.SetMatchSessionId(matchID);
groupPresenceOptions.SetIsJoinable(joinable);

while (setError)
{
bool setCompleted = false;

GroupPresence.Set(groupPresenceOptions).OnComplete(message =>
{
setError = message.IsError;

if (setError)
{
ErrorMessage.text = setError.ToString();
}
else
{
ErrorMessage.text ="Group Presence set successfully";
}
setCompleted = true;
presenceset = true;
});

yield return new WaitUntil(() => setCompleted);
}
}

void SetPresence()
{
StartCoroutine(set("Invite", "Lobby", "", true));
}

Replies have been turned off for this discussion