Before you begin
- Your product uses the full XBOX services feature set. New products start with limited XBOX services, and achievements and gamerscore aren’t available until your product is onboarded. For more information, see Request product onboarding to enable full XBOX services.
- You configured the event, stat rules, and achievement in Partner Center and published the XBOX services configuration to your development sandbox.
- Your dev kit or Windows PC uses the same development sandbox, and you sign in with a test account that has access to that sandbox. For more information, see XBOX services sandboxes overview.
- Your game initialized the Gaming Runtime and then called XblInitialize with an XblInitArgs structure whose
scidmember contains your Service Configuration ID (SCID). The SCID is case-sensitive. For more information, see How to use XBOX services APIs. - You signed in a user and created an
XblContextHandlefor that user by calling XblContextCreateHandle.
Write the event
The following example uses the flat C API.LogToScreen represents your app’s logging function.
Troubleshooting
- The call returns
E_INVALIDARG. xboxLiveContext or the event name is null. - The call returns
E_XBL_NOT_INITIALIZED. CallXblInitializebefore you write events. - The call returns
E_NOTIMPL. The XGameEvent feature of the Gaming Runtime isn’t available. On a Windows PC, the installed Gaming Runtime Services must include the XGameEvent feature. - The call succeeds, but the stat or achievement doesn’t change. The event name and the names of the event fields must match the names in your title’s service configuration. Names are case-insensitive. If the event name doesn’t match an event in the service configuration, the service drops the event without notifying your game.
- Field values are in the wrong place. Put fields that have a finite set of numeric or string values, such as difficulty level or game mode, in the dimensions. Put scalar numeric metrics, such as score, time, or position, in the measurements.
- Updates take time. Events are written locally on the device, even when the device is offline, and are uploaded when the device is online. If the device is online, event-based stats typically update 5 to 20 seconds after the event is written.
