The game invite task is used to show a game invite screen that enables the user to invite players to a multiplayer game session that is in progress on a Windows Phone device. The invitation is sent asynchronously.
The game invite task works only when called from within a game that is approved for release on Xbox LIVE on Windows Phone.
When the user finishes sending the invite, cancels out of the task, or an error occurs, the task’s
Completed event is raised.
GameInviteTask should be defined as a field in your class, like so:
readonly GameInviteTask gameInviteTask = new GameInviteTask();
Subscribe to the
GameInviteTask.Completed event within your class constructor, as shown: