Snapping Games and Presenting Odds
Implementation
Verify the SDK is initialized.
Retrieve an instance of
SnapViewController
with your desired (or the default)SnapConfiguration
Present the
SnapViewController
(the recommended presentation is modally in aUINavigationController
)
Live Game Capture And Odds Display Code Example
The following code illustrates a SnapViewController
with the default configuration.
If you do not want or need to customize the snapping configuration, you can also omit the configuration
parameter.
Once a sporting event is successfully snapped, the OddsResultsViewController
is automatically pushed in the UINavigationController
and the odds for the snapped game are presented.
If the sporting event is not successfully snapped, an error message will appear in the viewfinder: "Your snap returned no results. Make sure your TV is visible in the viewfinder"
Camera Permissions Required before Presenting Snap
Applications must request user permission for camera access, and camera access is required for the app to function. For this reason, your application should be set to ask permission from the user to access the camera, and to receive said permission, before presenting the Snap UI. The following code will set your application to request and receive permission prior to opening Snap UI:
Recommendations
Present Snap in a UINavigationController
SnapOdds recommends presentingSnapViewController
in a UINavigationController
. Please note that SnapViewController itself does not present any cancellation item within the UI. The developer of the application is responsible for configuring a cancel item on the presented UINavigationController
.
Limit to portrait
Currently, Snap UI is optimized only for portrait orientation. We recommend that you limit the supported interface orientations for the presented UINavigationController to portrait only.
Last updated