CONNECT Player React Native SDK (Deprecated)
1.15.x 1.14.x 1.13.x 1.12.x 1.11.x 1.10.x 1.9.x 1.8.x 1.7.x 1.6.x 1.5.x 1.4.x 1.3.x 1.2.x 1.1.x
1.15.x 1.14.x 1.13.x 1.12.x 1.11.x 1.10.x 1.9.x 1.8.x 1.7.x 1.6.x 1.5.x 1.4.x 1.3.x 1.2.x 1.1.x

Integrating the plugin for Apple and Android

Setting up a new project

Unless you have react-native installed globally, NAGRA recommends you use npx to run react-native. 

iOS

For iOS only, use:

JavaScript
npx react-native init $1 [email protected]
JavaScript
npx react-native init $1 [email protected]

tvOS/iOS

For tvOS support use:

JavaScript
npx react-native init $1 [email protected]

This command will also build for iOS.

RN version 0.67.4 does not have support for [email protected]

Typescript templating

To generate a project with typescript templating (and compatible version of React Native), use:

JavaScript
npx react-native init $1 --template [email protected]

See also https://reactnative.dev/docs/environment-setup for details on how to set up a React Native project.

Adding dependencies

To add the plug-in as a dependency to an existing project:

  1. Extract the plug-in from the opy-react-native-1.13.x-react-otvplayer.zip file.

  2. Add the extracted plug-in as a dependency in the project folder.

    yarn add file:/path/to/plug-in/folder
    

Apple iOS/tvOS

For Apple iOS/tvOS, take the following extra steps:

  1. Open the basicPlaybackApp/ios/Podfile, change the platform :ios, '10.0' to "platform :ios, '12.0'.

  2. Add React-otvplayer into <project_folder>/ios/Podfile for both iOS and tvOS.

    Ruby
    config = use_native_modules!
    # Add react-otvplayer podspec here:
    pod 'React-otvplayer', :path => './node_modules/@nagra/react-otvplayer/React-otvplayer.podspec' , :modular_headers => true
    use_react_native!(
    ...
    
  3. Run pod install:

    • cd basicPlaybackApp/ios pod install

    • Open <project_folder> /ios/<project>.xcworkspace

    • Select the build TARGET and change the Signing & Capabilities with your Team and Bundle Identifier.

  4. Build and deploy the iOS or tvOS Target and run the app on your device.