# Snapping Games

The following section deals primarily with the code used in capture of live game information for SnapOdds Operator. If your use case requires game odds to be presented, the information captured by SnapOdds Operator is fed into SnapOdds Sports Media to correlate the game odds information, as described in

## Implementation

1. Verify the SDK is initialized by calling the setupWithClientId method.
2. Present the SnapOdds Operator UI by using presentOperatorFlowWithConfiguration method.
3. Handle result in the methods' callback

{% hint style="info" %}
The sport event that is returned contains the SportRadar Match ID as the property **externalId**. Several other ID providers like Kambi, Donbest, and more are available on request.
{% endhint %}

## Live Game Capture Code Example

The following code presents the Snap UI and shows the full configuration options.

```javascript
SnapscreenSDKModule.presentOperatorFlowWithConfiguration({ 
  "automaticSnap": false,
  "autosnapTimeoutDuration": 30,
  "autosnapIntervalInSeconds": 0.5,
 
  "navigationBackground": "#FFFFFF",
  "navigationForeground": "#2DD4BF",
  
  "or",
  
  "navigationBackground-light": "#FFFFFF",
  "navigationBackground-dark": "#2DD4BF",
  "navigationForeground-light": "#2DD4BF",
  "navigationForeground-dark": "#000000"
}, (snapResult) => {
  console.log(`Snapped sport event ID ${snapResult.externalId}`);
});
```

The returned snapResult object is a Javascript object containing one string value with the key  `externalId` and another string value with the key `snapResultEntry` which is a stringified JSON of the full response object that is returned by the native SDKs.

After a successful snap (and call of the callback) the SnapOdds Operator UI is automatically dismissed.

{% hint style="info" %}
The navigationBackground and navigationForeground options are ignored on Android and you need to adapt your Android theme accordingly to style the ActionBar.
{% endhint %}

### iOS Camera Permissions Required before Presenting Snap

Although the SnapOdds Operator UI flow asks for camera permissions we recommend doing this in your React Native application before you present the Operator flow to also allow the user to go to the device's system settings in case the permission were denied previously.

### iOS Camera Permission Configuration

In order to be able to ask for the camera permission, your iOS projects needs to define a value for NSCameraUsageDescription in it's Info.plist. Be sure to configure this before using the SnapOdds Operator UI either by modifying your Info.plist manually or by adding the appropriate configuration to your React Native application's configuration (e.g. by adding the following code to your app.json in case you use expo)

```json
{
  "expo": {
    "ios": {
      "infoPlist": {
        "NSCameraUsageDescription": "The camera is used to snap your TV."
      }
    }
  }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.snapodds.com/docs/mobile-sdk/react-native/snapodds-operator/snapping-games.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
