Over a million developers have joined DZone.

What is GameInviteTask and why can't I use it?

· Mobile Zone

Visually compose APIs with easy-to-use tooling. Learn how IBM API Connect provides near-universal access to data and services both on-premises and in the cloud, brought to you in partnership with IBM.

As I worked with the second Beta of the Windows Phone Mango SDK, I couldn't help but notice that there is a GameInviteTask present. in theory, this should be the class to invite people to join a game session that is currently in progress on a Windows Phone device. If you've ever had an Xbox and player a multiplayer game (e.g. Call of Duty - an obvious example, I know), you probably received a game invitation from a fellow player.

(Image courtesy of Gamasutra)

The GameInviteTask class is used like any other Task-based class - this is not surprising since it implements ChooserBase<TaskEventArgs>. All the user needs to know is the unique session ID that lets one join an active game session. Its invocation goes like this:

GameInviteTask task = new GameInviteTask();
task.SessionId = "mysessionid";

Currently, there is no way to specify recipients in code-behind and each one of them has to be specified by the user. Given that the SDK is still in its beta stage, this is normal and it is safe to assume that maybe in the final release this minor issue will be fixed. The problem lies in the fact that the user can specify contacts by their email address and by the Gamertag (what is it?), so it would be a bit complicated to make sure that a proper form of identification is used (e.g. make sure that a valid Gamertag is used).

This is one of the classes that doesn't behave well inside an emulator. The actual invitation screen shows up just like it should.

Notice how the current active player is simply identified by the alias Player. This is caused by the fact that inside the emulator the user cannot link an active Windows Live (or Xbox Live) account. PhoneApp1 and the associated icon represent the game that is invoking the invitation and cannot be changed.

An email address and a Gamertag can be entered directly in the specified field.

The Gamertag verification seems to be going on post-factum - once sending was attempted. However, when the user clicks the "Add Contact" button, he will be able to see whether the entered Gamertags where valid - if the avatar is set, most likely the user is present in the Xbox Live database.

When you want to choose existing Xbox Live friends, you can click on the appropriate link and the system application will return the list of friends associated with the Xbox Live account. This list is tied to the main Windows Live account that is linked to the phone. If a regular contact is selected, the email will be added.

At this point, it seems like the GameInviteTask capability is disabled even on physical devices. I can only assume that there will be a requirement for the game to be an Xbox Live approved title (just like for any other Gamertag-related capability in the SDK).

The invitation process is referencing a system application that is identified by the following URI:


This URI is only slightly different from the application that was used to share a social status or link. As another confirmation of the assumption that an Xbox Live registration will be required is the fact that there is an internal attempt to read the registered GameID.

For the Beta release, it seems like all that is done is provide dummy data, as getting the current game ID will return 0. With the final release, this might (and will) change.

The Mobile Zone is brought to you in partnership with Strongloop and IBM.  Visually compose APIs with easy-to-use tooling. Learn how IBM API Connect provides near-universal access to data and services both on-premises and in the cloud.


The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}