> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XGameInviteUnregisterForEvent (deprecated)

> XGameInviteUnregisterForEvent (deprecated)

# XGameInviteUnregisterForEvent (deprecated)

<Info>This API is now deprecated. Use [XGameActivationUnregisterForEvent](/reference/system/xgameactivation/functions/xgameactivationunregisterforevent) instead.</Info>

Unregisters a callback for a game invite event.

## Syntax

```cpp theme={null}
bool XGameInviteUnregisterForEvent(  
         XTaskQueueRegistrationToken token,  
         bool wait  
)  
```

### Parameters

*token*   \_In\_\
Type: [XTaskQueueRegistrationToken](/reference/system/xtaskqueue/structs/xtaskqueueregistrationtoken)

The token that [XGameInviteRegisterForEvent](/reference/system/xgameinvite/functions/xgameinviteregisterforevent) returns.

*wait*   \_In\_\
Type: bool

Wait for pending event callbacks to complete.

### Return value

Type: bool

Returns false if *wait* is false and the unregister is pending. Returns true otherwise.

## Remarks

<Note>This function isn't safe to call on a time-sensitive thread. For more information, see [Time-sensitive threads](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads).</Note>

To register a callback for a game invite event, call [XGameInviteRegisterForEvent](/reference/system/xgameinvite/functions/xgameinviteregisterforevent). The function uses a pointer to an [XGameInviteEventCallback](/reference/system/xgameinvite/functions/xgameinviteeventcallback) as an argument.

For an example of calling this function, see the remarks section of the [XGameInviteEventCallback](/reference/system/xgameinvite/functions/xgameinviteeventcallback#ID_XGameInviteEventCallback_Remarks) topic.

## Requirements

**Header:** XGameInvite.h

**Library:** xgameruntime.lib

**Supported platforms:** Windows, XBOX One family consoles and XBOX Series consoles

## Conceptual documentation

* [Time-sensitive threads](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)

## See also

[XGameInvite](/reference/system/xgameinvite/xgameinvite_members)

[XGameInviteRegisterForEvent](/reference/system/xgameinvite/functions/xgameinviteregisterforevent)

[XGameInviteEventCallback](/reference/system/xgameinvite/functions/xgameinviteeventcallback)


## Related topics

- [XGameInviteEventCallback (deprecated)](/reference/system/xgameinvite/functions/xgameinviteeventcallback.md)
- [XGameInviteRegisterForEvent (deprecated)](/reference/system/xgameinvite/functions/xgameinviteregisterforevent.md)
- [XGameInvite (deprecated)](/reference/system/xgameinvite/xgameinvite_members.md)
- [Receiving invites](/services/xbox-services/multiplayer/invites/how-to/live-invites-receive.md)
- [XGameActivation](/reference/system/xgameactivation/xgameactivation_members.md)
