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
  • Add Native SDK with Swift Package Manager
  • Add React Native SDK Module
  • Add Objective-C bridging header

Was this helpful?

Export as PDF
  1. MOBILE SDK
  2. React Native

iOS Installation

PreviousReact NativeNextAndroid Installation

Last updated 2 years ago

Was this helpful?

To integrate the SnapOdds SDK in your project, open your iOS project's xcworkspace file with Xcode.

Add Native SDK with Swift Package Manager

To integrate via SwiftPM, add the location of the github repository and the version to your Package.swift file, as shown below:

dependencies: [
    .package(url: "https://github.com/snapodds/sdk-ios.git", .upToNextMajor(from: "2.0.0"))
]

This can also be done by adding the repository and version through the Xcode UI by selecting your project and adding the SwiftPM package under Package Dependencies.

Add React Native SDK Module

Add the files SnapscreenSDKModule.swift and SnapscreenSDKModuleBridge.h from our provided to your Xcode project.

Add Objective-C bridging header

If your project does not yet contain an Objective-C bridging header, you also need to add a bridging header to make our SDK integration work.

To do so, create a new Header File and name it <project-name>-Bridging-Header.h.

Add the following line to the bridging header:

#import <React/RCTBridgeModule.h>

Then open your target's Build Settings (by navigating to your project, then clicking on the application Target and selecting Build Settings from the top menu.

Search for the setting names Objective-C Bridging Header and set it to the name of your newly created header file.

If your newly created header file is not placed in the same folder as your xcworkspace file, you might need to adapt the settings' value to include the full relative path.

sample project here on Github