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

# XGameInviteUnregisterForEvent (deprecated)

> XGameInviteUnregisterForEvent (deprecated)

> [!NOTE]
>
> This API is now deprecated. Use [XGameActivationUnregisterForEvent](https://docs.xbox.com/reference/system/xgameactivation/functions/xgameactivationunregisterforevent.md) instead.

Unregisters a callback for a game invite event.

## Syntax

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

### Parameters

*token*   \_In\_\
Type: [XTaskQueueRegistrationToken](https://docs.xbox.com/reference/system/xtaskqueue/structs/xtaskqueueregistrationtoken.md)

The token that [XGameInviteRegisterForEvent](https://docs.xbox.com/reference/system/xgameinvite/functions/xgameinviteregisterforevent.md) 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).

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

For an example of calling this function, see the remarks section of the [XGameInviteEventCallback](https://docs.xbox.com/reference/system/xgameinvite/functions/xgameinviteeventcallback.md#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](https://docs.xbox.com/reference/system/xgameinvite/xgameinvite_members.md)

[XGameInviteRegisterForEvent](https://docs.xbox.com/reference/system/xgameinvite/functions/xgameinviteregisterforevent.md)

[XGameInviteEventCallback](https://docs.xbox.com/reference/system/xgameinvite/functions/xgameinviteeventcallback.md)


## Related topics

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