Skip to content

Instantly share code, notes, and snippets.

@vizbee
Last active June 15, 2023 13:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vizbee/48815c9cf8f752507b470ef99c6cc090 to your computer and use it in GitHub Desktop.
Save vizbee/48815c9cf8f752507b470ef99c6cc090 to your computer and use it in GitHub Desktop.

To setup the Vizbee React Native Sender SDK,

  • Review the logical steps 1-4 involved in setting up the JS node and native platform specific dependencies.
  • Steps 1 and 2: Perform logical steps 1 and 2 for both platforms with the common command
  • Steps 3 and 4 for iOS: Perform logical steps 3 and 4 for iOS
  • Steps 3 and 4 for Android: Perform logical steps 3 and 4 for Android

There are 4 logical steps involved in downloading and setting up a React Native module that wraps platform specific native SDKs on iOS and Android.

Logical Step JS iOS Android
1 Setup JS module dependency Update package.json. Download react-native-vizbee-sender-sdk module into node_modules folder ...
2 Setup platform specific React module dependency Setup iOS app's dependency on the iOS React module that wraps the native iOS SDK. With Cocoapods, this would setup a pod dependency such as: pod 'react-native-vizbee-sender-sdk', :path => '../node_modules/react-native-vizbee-sender-sdk' and eventually copy the RNVizbeeSenderSDK iOS specific files into the corresponding pod folder. Setup Android app's dependency on the Android React module that wraps the native Android SDK. Typically, this would involve updating the project's settings.gradle and adding a dependency in the app's build.gradle
3 Setup platform specific native SDK dependency Add VizbeeKit dependency to your app's podfile Add Vizbee dependency to your app's build.gradle
4 Update both platform specific dependencies pod install gradle sync

This single command will perform logical steps 1 and 2 for both iOS and Android.

yarn add react-native-vizbee-sender-sdk

Specifically, it performs step 2 with the autolinking feature.

For iOS step 3, include the VizbeeKit dependency in the iOS app's podfile.

# private git repo for VizbeeKit
source 'https://git.vizbee.tv/Vizbee/Specs.git'

# explicitly include standard CocoaPods repo
source 'https://github.com/CocoaPods/Specs.git' 

platform :ios, '9.0'     # or minimum supported iOS greater than 9.0

target 'MyApp' do 
    pod 'VizbeeKit' , '~> 6.3.3'
    pod 'google-cast-sdk-no-bluetooth-dynamic', '~> 4.7.0'
end

For iOS step 4, perform pod update from the folder that contains your iOS app code.

cd ios && pod install && cd ..

For Android step 3, we only need to add the Vizbee repository to the list of app's repository URLs. (Note that we do not need to add the dependency on android-remote-sdk as this is already included in the react native Android module's build.gradle.)

  repositories {
    maven { url 'http://repo.claspws.tv/artifactory/libs'}
  }

For Android step 4, simply sync gradle to download all latest dependencies.

./gradlew build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment