Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Steps to initialize SnapscreenFramework functionality.
For any class that requires access to the SnapscreenFramework functionality, add the following line:
In order to initialize Snapscreen, call the following class method in AppDelegate in application:didFinishLaunchingWithOptions:
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:
Once Snapscreen is initialized, it can be retrieved by calling:
Steps to initialize SnapscreenFramework functionality.
For any class that requires access to the SnapscreenFramework functionality, add the following line:
In order to initialize Snapscreen, call the following class method in AppDelegate in application:didFinishLaunchingWithOptions:
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:
Once Snapscreen is initialized, it can be retrieved by calling:
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.
SnapOdds Sports Media provides a complete flow including the Snapping UI for snapping Sport Events and then displaying all available odds for the recognized sport event.
Installing the iOS SDK.
The easiest (and recommended) way to use Snapscreen is to integrate via SwiftPM. To integrate via SwiftPM, add the location of the github repository and the version to your Package.swift file, as shown below:
Snapscreen is provided as an iOS xcframework and bundles everything necessary for it to operate.
Drag the Snapscreenframework.xcframework to your iOS project
Make sure Xcode has added the framework to your project's Framework, Libraries and Embedded Content section in your General Settings
Make sure to change the Embed setting to Embed & Sign.
The snapping functionality relies on permission to access the camera of your iOS device to function. Access to the camera requires developers to provide a description of the camera's usage in the application. To add this camera usage description, add the key NSCameraUsageDescription into your application's Info.plist, and describe how the camera is used for the snapping functionality.
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 Snapping Games and Presenting Odds
Verify the SDK is initialized.
Ensure your class conforms to SnapscreenSnapDelegate
Retrieve an instance of SnapViewController
with your desired (or the default) SnapConfiguration
and your SnapscreenSnapDelegate
Present the SnapViewController (the recommended presentation is modally in a UINavigationController)
Handle result in your delegate implementation
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 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 following method is called in your SnapscreenSnapDelegate
:
After a successful snap (and call of the delegate method) the SnapViewController
automatically stops snapping. If you do not present any follow-up UI and you want to continue snapping, you can call continueSnapping()
on the SnapViewController
.
If the sporting event is not successfully snapped, the delegate method is not called, and an error message will appear in the viewfinder: "Your snap returned no results. Make sure your TV is visible in the viewfinder"
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:
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
.
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.
Installing the iOS SDK.
The easiest (and recommended) way to use Snapscreen is to integrate via SwiftPM. To integrate via SwiftPM, add the location of the github repository and the version to your Package.swift file, as shown below:
Snapscreen is provided as an iOS xcframework and bundles everything necessary for it to operate.
Drag the Snapscreenframework.xcframework to your iOS project
Make sure Xcode has added the framework to your project's Framework, Libraries and Embedded Content section in your General Settings
Make sure to change the Embed setting to Embed & Sign.
The snapping functionality relies on permission to access the camera of your iOS device to function. Access to the camera requires developers to provide a description of the camera's usage in the application. To add this camera usage description, add the key NSCameraUsageDescription into your application's Info.plist, and describe how the camera is used for the snapping functionality.
Customizing displayed messages, colors and fonts.
To customize colors in SnapViewController
, use the SnapscreenUIColorConfiguration
object on the Snapscreen instance.
To customize fonts in SnapViewController
, use the SnapscreenUIFontConfiguration
object on the Snapscreen instance.
To customize displayed messages in the SnapViewController
use the SnapscreenSnapUIConfiguration
object on the Snapscreen instance.
All desired customizations must be done prior to presenting the SnapViewController
. While it is also possible to modify the configuration between presentations of the SnapViewController
, modifications initiated while the ViewController
is present are not guaranteed to be respected.
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 a UINavigationController
)
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"
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:
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
.
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.
Customizing displayed messages. colors and fonts.
To customize colors in SnapViewController
and OddsResultsViewController
, use the SnapscreenUIColorConfiguration
object on the Snapscreen instance.
To customize fonts in SnapViewController
and OddsResultsViewController
, use the SnapscreenUIFontConfiguration
object on the Snapscreen instance.
To customize displayed messages in the SnapViewController
use the SnapscreenSnapUIConfiguration
object on the Snapscreen instance.
All desired customizations must be done prior to presenting the SnapViewController
. While it is also possible to modify the configuration between presentations of the SnapViewController
, modifications initiated while the ViewController
is present are not guaranteed to be respected.
To customize displayed messages in the OddsResultsViewController
use the SnapscreenOddsUIConfiguration
object on the Snapscreen instance.
All desired customizations must be done prior to present the SnapViewController
and subsequently the OddsResultsViewController
. While it is also possible to modify the configuration between presentations of the OddsResultsViewController
, modifications initiated while the ViewController
is present are not guaranteed to be respected.
Documentation for the iOS SDK, configuration steps, and more.
Our iOS SDK is published on and contains the Snapscreen framework, as well as a sample application to demonstrate the framework integration and usage.
This framework can be integrated into:
iOS 13.0 or later
Check out the following video guide to see how easy it is to integrate the iOS SDK.
Starting with 2.3.0 SnapOdds SDK has full support of Apple Silicon and the simulator. We recommend you use the newest SDK version.
Up until version 2.3.0 SnapscreenFramework only includes simulator architecture for i386_x86 and not for arm64. This means you currently cannot run an app with SnapscreenFramework included on iOS simulators on Apple Silicon Macs. As a workaround, either use your app on a physical device or run Xcode via Rosetta to force the simulator to run with i386_x86.
To further our ongoing efforts to improve our product, we are working on an update to the SDK to include support for arm64 architecture for the iOS simulator.
Requirement:
The following license keys used in the video guide are for trial purposes only:
Client ID: u9jYT9g1q6gTxY8i
Client Secret: RMkiJPYCipP5bbG4YbtqzpdYne1b0hPSDItvq3YV
For a working example see our Example project in the SDK repository .
A license key is required to use SnapOdds Sports Operator or Sports Media APIs. You can obtain a license by contacting us at: