LogoLogo
  • Welcome!
  • MOBILE SDK
    • iOS
      • SnapOdds Operator
        • Installation
        • Initialization
        • Snapping Games
        • Customization
        • API documentation
      • SnapOdds Sport Media
        • Installation
        • Initialization
        • Snapping Games and Presenting Odds
        • Customization
        • API documentation
    • Android
      • SnapOdds Operator
        • Installation
        • Initialization
        • Permissions
        • Snapping Games
        • Customization
        • API documentation
      • SnapOdds Sport Media
        • Installation
        • Initialization
        • Permissions
        • Snapping Games and Presenting Odds
        • Customization
        • API documentation
    • React Native
      • iOS Installation
      • Android Installation
      • SnapOdds Operator
        • Initialization
        • Snapping Games
        • Customization
      • SnapOdds Sport Media
        • Initialization
        • Snapping Games and Presenting Odds
        • Customization
  • Web SDK
    • JavaScript
      • SnapOdds Operator
        • Installation
        • Access Token Handling
        • Snapping Games
        • Customization
        • API documentation
      • SnapOdds Sport Media
        • Installation
        • Access Token Handling
        • Snapping Games and Presenting Odds
        • Customization
        • API documentation
      • Implementation Errors
  • Integration Guide
    • SnapOdds as Button
    • SnapOdds as Banner
Powered by GitBook
On this page
  • Implementation
  • Live Game Capture And Odds Display Code Example
  • iOS Camera Permissions Required before Presenting Snap
  • iOS Camera Permission Configuration

Was this helpful?

Export as PDF
  1. MOBILE SDK
  2. React Native
  3. SnapOdds Sport Media

Snapping Games and Presenting Odds

Implementation

  1. Verify the SDK is initialized by calling the setupWithClientId method.

  2. Present the SnapOdds Operator UI by using presentSportMediaFlowWithConfiguration method.

Live Game Capture And Odds Display Code Example

The following code presents the Snap UI and automatically the Odds Display UI afterwards and shows the full configuration options.

SnapscreenSDKModule.presentSportMediaFlowWithConfiguration({ 
  "automaticSnap": false,
  "autosnapTimeoutDuration": 30,
  "autosnapIntervalInSeconds": 0.5,
 
  "navigationBackground": "#FFFFFF",
  "navigationForeground": "#2DD4BF",
  
  "or",
  
  "navigationBackground-light": "#FFFFFF",
  "navigationBackground-dark": "#2DD4BF",
  "navigationForeground-light": "#2DD4BF",
  "navigationForeground-dark": "#000000"
});

After a successful snap (and call of the callback) the Odds Display UI is automatically presented.

The navigationBackground and navigationForeground options are ignored on Android and you need to adapt your Android theme accordingly to style the ActionBar.

iOS Camera Permissions Required before Presenting Snap

Although the SnapOdds Sport Media UI flow asks for camera permissions we recommend doing this in your React Native application before you present the Sport Media 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 Sport Media 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)

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

Last updated 2 years ago

Was this helpful?