Configuring your License
Allowlist your Bundle Identifiers
In order to use the player in your app, you have to allowlist the bundle identifier (iOS) and/or Application ID (Android) of your app(s) into which you are integrating the player. This is a security mechanism and protects your license from being used elsewhere.
Allowlisting can be done in the Dashboard under Player > Licenses.
Set your license key
Your license key can either be set via code or by configuring your apps' Info.plist
and AndroidManifest.xml
.
Setting the license key via code
// Simply pass the `licenseKey` property to `PlayerConfig` when instantiating a player.
// With hooks
import { usePlayer } from 'bitmovin-player-react-native';
const player = usePlayer({
licenseKey: '<ENTER-YOUR-LICENSE-KEY>',
});
// Without hooks
import { Player } from 'bitmovin-player-react-native';
const player = new Player({
// Make sure to use React.createRef if instantiating inside a component.
licenseKey: '<ENTER-YOUR-LICENSE-KEY>',
});
Setting the license key through Info.plist (iOS)
Add the following lines to the <dict>
section of your ios/Info.plist
file:
<key>BitmovinPlayerLicenseKey</key>
<string>YOUR-LICENSE-KEY-HERE</string>
Setting the license key through AndroidManifest.xml
Add the following line to the <application>
section of your android/app/src/main/AndroidManifest.xml
:
<meta-data android:name="BITMOVIN_PLAYER_LICENSE_KEY" android:value="ENTER-YOUR-LICENSE-KEY" />
Updated 12 months ago