Skip to main content

Installation

Requirements

  • React Native: >= 0.72
  • iOS: >= 15.6
  • Xcode: >= 26
  • Android: minSdkVersion >= 26

Install the package

npm install @bambuser/react-native-commerce-sdk
# or
yarn add @bambuser/react-native-commerce-sdk

iOS

cd ios && pod install

The Bambuser Commerce SDK xcframework is vendored inside the package. No extra source or repository configuration is required.

Important: Add -ObjC Linker Flag

To ensure full functionality of the underlying iOS SDK, you must add the -ObjC flag to your app target.

Android

The Android SDK is published to a Bambuser-hosted Maven repository. Add it to your project's android/settings.gradle:

dependencyResolutionManagement {
repositories {
// ... existing repos
maven { url "https://repo.repsy.io/mvn/bambuser/bambuser-commerce-sdk" }
}
}

The SDK uses Jetpack Compose internally. Add the Compose Kotlin plugin to your root android/build.gradle:

plugins {
id "org.jetbrains.kotlin.plugin.compose" version "2.1.20" apply false
}

Bump minSdkVersion to 26 or higher in your android/build.gradle.

Picture-in-Picture (Android)

Android uses activity-level Picture-in-Picture. To enable it, declare supportsPictureInPicture on your host Activity in AndroidManifest.xml:

<activity
android:name=".MainActivity"
android:supportsPictureInPicture="true"
android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation|keyboard|keyboardHidden"
... />

When the activity enters PiP, the entire activity shrinks (not just the video). Hide non-video UI when onPiPStateChanged fires 'started' and restore it on 'stopped'. See Player API › Picture-in-Picture.

Verify the install

A minimal smoke test. Drop this into a screen and confirm the player loads:

import { BambuserVideoView } from '@bambuser/react-native-commerce-sdk';

export function SmokeTest() {
return (
<BambuserVideoView
style={{ flex: 1 }}
id="your-video-id"
server="US"
configuration={{ autoplay: true }}
/>
);
}

For a full integration walkthrough, continue to Setup.

Troubleshooting

iOS: pod install fails to find the framework. The xcframework is vendored inside the package. If pods can't resolve it, delete ios/Pods and ios/Podfile.lock, then run pod install again.

Android: build fails with a Compose-related error. Make sure the Compose Kotlin plugin is declared in your root build.gradle and that your Kotlin version is compatible (Kotlin >= 2.1 recommended).

Android: minSdkVersion errors. The SDK requires API 26+. Bump minSdkVersion in your project's android/build.gradle.