SnapOdds Operator provides you with the Snapping UI for Snapping Sport Events and returns you all required information about the sport event. After a successful snap you are free to use the result as you wish and present subsequent functionality to the user.
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
Verify the SDK is initialized by calling the setupWithClientId method.
Present the SnapOdds Operator UI by using presentOperatorFlowWithConfiguration method.
Handle result in the methods' callback
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.
The following code presents the Snap UI and shows the full configuration options.
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.
The navigationBackground and navigationForeground options are ignored on Android and you need to adapt your Android theme accordingly to style the ActionBar.
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.
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)
To customize in the Snap UI use the updateColorConfiguration method provided by our Native Module. The following code snippet shows all available options. Please note that for each color option, you can provide either a single color which is used for both light and dark mode or you can append the suffix -light or -dark to the color name to provide specific colors.
To customize displayed messages in the Snap UI use the updateSnapUIConfiguration method provided by our Native Module. The following code snippet shows all available options:
All desired customizations must be done prior to presenting the Snap UI.
In order to initialize Snapscreen, call the following method when your React Native application starts up:
To improve performance, SnapOdds requires basic locational information to be provided. Set the users country and US state information within the SDK using the parameters country and usState: