What is GameInviteTask and why can't I use it?
Join the DZone community and get the full member experience.Join For Free
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"; task.show();
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
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.
Opinions expressed by DZone contributors are their own.