Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
bce1b51
Initial Adscript commit
tvanlaerhoven Aug 4, 2025
192b393
Add android module
tvanlaerhoven Aug 4, 2025
329c75e
Add local native adscript connector
tvanlaerhoven Aug 4, 2025
506441b
Initial gemius connector commit
tvanlaerhoven Aug 4, 2025
df20b40
Add Android module
tvanlaerhoven Aug 4, 2025
e539dea
Add gemius to e2e
tvanlaerhoven Aug 5, 2025
b336199
Update dependencies
tvanlaerhoven Aug 7, 2025
b61b8c4
Fix package version
tvanlaerhoven Aug 7, 2025
2db0813
Fix types
tvanlaerhoven Aug 7, 2025
fed4d22
Add readme
tvanlaerhoven Aug 7, 2025
31b0ba8
Remove unused repo
tvanlaerhoven Aug 7, 2025
072bd48
Fix aar dependencies
tvanlaerhoven Aug 7, 2025
4840075
Add readme entries
tvanlaerhoven Aug 7, 2025
6c04852
Update docs
tvanlaerhoven Aug 7, 2025
46f3e8b
Fix exports
tvanlaerhoven Aug 7, 2025
12e8560
Add acra dependency
tvanlaerhoven Aug 7, 2025
d4a936c
Update gemius dependencies
tvanlaerhoven Aug 7, 2025
18a8d33
Catch adapter errors
tvanlaerhoven Aug 7, 2025
7ddfee8
Update adscript metadata
tvanlaerhoven Aug 8, 2025
feaf953
Update module dependency
tvanlaerhoven Aug 8, 2025
12c35b5
Update readme
tvanlaerhoven Aug 8, 2025
d5b8203
Add updateUser method
tvanlaerhoven Aug 8, 2025
806ad5c
Update docs
tvanlaerhoven Aug 8, 2025
eb8e76f
Fix formatting
tvanlaerhoven Aug 8, 2025
b2136a6
Fix export
tvanlaerhoven Aug 8, 2025
e9ce519
Add Gemius connector for iOS
tvanlaerhoven Aug 12, 2025
557c3d2
Update docs
tvanlaerhoven Aug 12, 2025
cb1f677
Add AdScript iOS module
tvanlaerhoven Aug 13, 2025
6f779d2
Fix gemius bridge
tvanlaerhoven Aug 13, 2025
f83582f
Fix types
tvanlaerhoven Aug 13, 2025
77daa75
Rename AdScript
tvanlaerhoven Aug 13, 2025
147d419
Update docs
tvanlaerhoven Aug 13, 2025
0a9de71
Update docs
tvanlaerhoven Aug 13, 2025
9073bb4
Fix case
tvanlaerhoven Aug 13, 2025
52d1ce4
Fix manifest warning
tvanlaerhoven Aug 13, 2025
56baefa
Add namespace
tvanlaerhoven Aug 13, 2025
be23a3c
Fix module name
tvanlaerhoven Aug 13, 2025
7dde812
Fix kotlin version
tvanlaerhoven Aug 13, 2025
248bd4a
Fix int mapping
tvanlaerhoven Aug 14, 2025
1ad5e10
Fix build config
tvanlaerhoven Aug 14, 2025
baac273
Update iOS project
tvanlaerhoven Aug 14, 2025
c0cd4a3
Fix ios e2e dependency update
tvanlaerhoven Aug 14, 2025
5d70b84
Remove unused dependencies
tvanlaerhoven Aug 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pr_ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
- name: Run pod install & update dependencies
working-directory: apps/e2e/ios
run: |
RCT_NEW_ARCH_ENABLED=${{ matrix.newArchEnabled }} bundle exec pod install
RCT_NEW_ARCH_ENABLED=${{ matrix.newArchEnabled }} bundle exec pod update

- name: Start iOS simulator
uses: futureware-tech/simulator-action@v4
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ the official THEOplayer React Native video player.
| Content protection (DRM) | [![%40theoplayer/react-native-drm](https://img.shields.io/npm/v/%40theoplayer%2Freact-native-drm?label=%40theoplayer/react-native-drm)](https://www.npmjs.com/package/%40theoplayer%2Freact-native-drm) | [`DRM`](https://github.com/THEOplayer/react-native-connectors/tree/main/drm) |
| Conviva analytics | [![%40theoplayer/react-native-analytics-conviva](https://img.shields.io/npm/v/%40theoplayer%2Freact-native-analytics-conviva?label=%40theoplayer/react-native-analytics-conviva)](https://www.npmjs.com/package/%40theoplayer%2Freact-native-analytics-conviva) | [`Conviva`](https://github.com/THEOplayer/react-native-connectors/tree/main/conviva) |
| Engage | [![%40theoplayer/react-native-engage](https://img.shields.io/npm/v/%40theoplayer%2Freact-native-engage?label=%40theoplayer/react-native-engage)](https://www.npmjs.com/package/%40theoplayer%2Freact-native-engage) | [`Engage`](https://github.com/THEOplayer/react-native-connectors/tree/main/engage) |
| Gemius | [![%40theoplayer/react-native-analytics-gemius](https://img.shields.io/npm/v/%40theoplayer%2Freact-native-analytics-gemius?label=%40theoplayer/react-native-analytics-gemius)](https://www.npmjs.com/package/%40theoplayer%2Freact-native-analytics-engage) | [`Gemius`](https://github.com/THEOplayer/react-native-connectors/tree/main/engage) |
| Mux analytics | [![%40theoplayer/react-native-analytics-mux](https://img.shields.io/npm/v/%40theoplayer%2Freact-native-analytics-mux?label=%40theoplayer/react-native-analytics-mux)](https://www.npmjs.com/package/%40theoplayer%2Freact-native-analytics-mux) | [`Mux`](https://github.com/THEOplayer/react-native-connectors/tree/main/mux) |
| Nielsen analytics | [![%40theoplayer/react-native-analytics-nielsen](https://img.shields.io/npm/v/%40theoplayer%2Freact-native-analytics-nielsen?label=%40theoplayer/react-native-analytics-nielsen)](https://www.npmjs.com/package/%40theoplayer%2Freact-native-analytics-nielsen) | [`Nielsen`](https://github.com/THEOplayer/react-native-connectors/tree/main/nielsen) |
| Nielsen AdScript analytics | [![%40theoplayer/react-native-analytics-adscript](https://img.shields.io/npm/v/%40theoplayer%2Freact-native-analytics-adscript?label=%40theoplayer/react-native-analytics-adscript)](https://www.npmjs.com/package/%40theoplayer%2Freact-native-analytics-adscript) | [`AdScript`](https://github.com/THEOplayer/react-native-connectors/tree/main/adscript) |
| Yospace SSAI | [![%40theoplayer/react-native-yospace](https://img.shields.io/npm/v/%40theoplayer%2Freact-native-yospace?label=%40theoplayer/react-native-yospace=)](https://www.npmjs.com/package/%40theoplayer%2Freact-native-yospace) | [`Yospace`](https://github.com/THEOplayer/react-native-connectors/tree/main/yospace) |
| Youbora analytics | [![%40theoplayer/react-native-analytics-youbora](https://img.shields.io/npm/v/%40theoplayer%2Freact-native-analytics-youbora?label=%40theoplayer/react-native-analytics-youbora=)](https://www.npmjs.com/package/%40theoplayer%2Freact-native-analytics-youbora) | [`Youbora`](https://github.com/THEOplayer/react-native-connectors/tree/main/youbora) |

Expand Down
70 changes: 70 additions & 0 deletions adscript/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# OSX
#
.DS_Store

# XDE
.expo/

# VSCode
.vscode/
jsconfig.json

# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
project.xcworkspace

# Android/IJ
#
.classpath
.cxx
.gradle
.idea
.project
.settings
local.properties
android.iml

# Cocoapods
#
example/ios/Pods

# Ruby
example/vendor/

# node.js
#
node_modules/
npm-debug.log
yarn-debug.log
yarn-error.log

# BUCK
buck-out/
\.buckd/
android/app/libs
android/keystores/debug.keystore

# Expo
.expo/

# Turborepo
.turbo/

# generated by bob
lib/
7 changes: 7 additions & 0 deletions adscript/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# @theoplayer/react-native-analytics-adscript

## 1.0.0

### ✨ Features

- Initial release
123 changes: 123 additions & 0 deletions adscript/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
# THEOplayer React-Native AdScript Connector

A [Nielsen AdScript](https://adscript.admosphere.cz/) analytics connector for `@theoplayer/react-native`.

## Installation

```sh
npm install @theoplayer/react-native-analytics-adscript
```

[//]: # (npm install @theoplayer/react-native-analytics-adscript)

## Prerequisites

### Android

On Android, the connector requires downloading the private
[AdScript client library](https://adscript.admosphere.cz/download/AdScriptApiClient_v1.0.10.aar.gz)
module into the app's `libs/` folder. Pass the SDK location to the connector
by setting the `adScriptSdkDir` in your app's `gradle.properties` file:

```bash
# Location of the AdScript SDK
adScriptSdkDir=./app/libs/
```

### iOS & tvOS

On Apple platforms, the connector requires downloading the private `AdScriptAPIClient` archive.

Create a `Frameworks` folder in your app's `ios` folder, copy the Adscript SDK XCFramework in it
and add this `AdScriptApiClient.podspec` file inside, which describes the structure and metadata of Adscript's CocoaPod:

```ruby
Pod::Spec.new do |spec|
spec.name = "AdScriptApiClient"
spec.version = "1.0.8"
spec.summary = "The Adscript Api Client for iOS"

spec.homepage = 'https://github.com/THEOplayer/iOS-Connector'
spec.license = { :type => 'MIT', :file => 'LICENSE' }
spec.author = "THEO technologies"
spec.source = { :git => 'https://github.com/THEOplayer/iOS-Connector.git', :tag => spec.version.to_s }

spec.source_files = "Classes", "Classes/**/*.{h,m}"
spec.ios.vendored_frameworks = "AdScriptApiClient.xcframework"
end
```

To enable IDFA (Identifier for Advertisers), replace the framework reference:

```
spec.ios.vendored_frameworks = "AdScriptApiClient.xcframework"
```

with

```
spec.ios.vendored_frameworks = "AdScriptApiClient_withidfa.xcframework"
```

Finally, include the AdScript SDK as dependency in your app's `Podfile`:

```ruby
pod 'AdScriptApiClient', :path => 'Frameworks/'
```

## Usage

### Configuring the connector

Create the connector by providing the `THEOplayer` instance, an `implementationId`, and a `metadata` object.

```tsx
import { useAdScript, AdScriptMetadata } from '@theoplayer/react-native-analytics-adscript';

const adscriptImplementationId = "myImplementionId";
const adscriptContentMetadata: AdScriptMetadata = {
assetId: "abc98731568435405",
type: "content"
};

const App = () => {
const [adscript, initAdScript] = useAdScript(adscriptImplementationId, adscriptContentMetadata, true /*debug*/);

const onPlayerReady = (player: THEOplayer) => {
// Initialize AdScript connector
initAdScript(player);
};

return <THEOplayerView config={playerConfig} onPlayerReady={onPlayerReady} />;
};
```

### Passing metadata dynamically

The connector allows passing or updating the current asset's metadata at any time:

```typescript
const onUpdateMetadata = () => {
adscript.current?.updateMetadata({
assetId: 'updatedId',
type: "content",
// ...
});
}
```

### Passing additional information

Additional information about the logged-in user from the client database:

```typescript
const onUpdateUser = () => {
adscript.current?.updateUser([
"866d3a3c-aa87-4fe7-9066-8286641edd17", // client-side user identifier (customerId)
"cf895a00-a987-4501-ac00-6adb57014129", // client-side user device identifier (Android_ID)
"9530321a-d3d0-4bda-8704-1eb94a5940c3", // client-side profile identifier of the logged-in user (profileId)
"jsg75682-k276t-kw82-k8d5-8926sh6528j2", // optional - SW device identifier for a situation where there are multiple device IDs in the client DB (typically a) HW ID - fill in i2, b) SW ID - fill in i4).
"ef3c6dc72a26912f07f0e733d51b46c771d807bf" // fingerprint of the user's email address
]);
}
```
125 changes: 125 additions & 0 deletions adscript/android/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
import java.util.zip.GZIPInputStream

buildscript {
// Buildscript is evaluated before everything else so we can't use getExtOrDefault
def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : '1.9.10'

repositories {
google()
mavenCentral()
}

dependencies {
classpath "com.android.tools.build:gradle:7.2.2"
// noinspection DifferentKotlinGradleVersion
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

def isNewArchitectureEnabled() {
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
}

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

if (isNewArchitectureEnabled()) {
apply plugin: "com.facebook.react"
}

def safeExtGet(prop, fallback) {
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}

android {
namespace = "com.theoplayer.reactnative.adscript"
compileSdkVersion safeExtGet("THEOplayerAdScript_compileSdkVersion", 35)

defaultConfig {
minSdkVersion safeExtGet("THEOplayerAdScript_minSdkVersion", 21)
targetSdkVersion safeExtGet("THEOplayerAdScript_targetSdkVersion", 35)
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
versionCode 1
versionName "1.0"
}

buildTypes {
release {
minifyEnabled false
}
}

lintOptions {
disable "GradleCompatible"
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

repositories {
mavenLocal()
google()
mavenCentral()
// Local Maven repo
maven { url("local") }
maven { url "https://maven.theoplayer.com/releases" }
}

rootProject.allprojects {
repositories {
maven { url("$rootDir/../node_modules/@theoplayer/react-native-analytics-adscript/android/local") }
}
}

// The AdScript connector requires at least THEOplayer SDK v5.11.0.
def theoplayer_sdk_version = safeExtGet('THEOplayer_sdk', '[5.11.0, 10.0.0)')
def kotlin_version = safeExtGet("THEOplayerAdScript_kotlinVersion", "1.9.10")
def adscript_version = safeExtGet("THEOplayerAdScript_adscriptVersion", "1.0.10")

dependencies {
// For < 0.71, this will be from the local maven repo
// For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.lifecycle:lifecycle-process:2.5.1'

// THEOplayer dependencies
compileOnly "com.theoplayer.theoplayer-sdk-android:core:$theoplayer_sdk_version"
compileOnly "com.theoplayer.theoplayer-sdk-android:integration-ads-ima:$theoplayer_sdk_version"
implementation project(':react-native-theoplayer')

// TEMP: replace this once the native connector has been published
// implementation "com.theoplayer.android-connector:adscript:$adscript_version"
implementation files("./libs/adscript.aar")
def aarFileName = "AdScriptApiClient_v${adscript_version}.aar"
def adScriptSdkDir = rootProject.properties['adScriptSdkDir']
if (!adScriptSdkDir) {
logger.warn("⚠️ WARNING: adScriptSdkDir not set.")
} else if (!rootProject.file(adScriptSdkDir).exists()) {
logger.warn("⚠️ WARNING: adScriptSdkDir does not exist at: ${adScriptSdkDir}")
} else {
def aarFile = new File(adScriptSdkDir, aarFileName)

// The AdScript aar file is typically provided as .gz, check if we still need to extract.
def gzFile = new File("${aarFile}.gz")
if (!aarFile.exists() && gzFile.exists()) {
new FileInputStream(gzFile).withCloseable { fis ->
new GZIPInputStream(fis).withCloseable { gis ->
new FileOutputStream(aarFile).withCloseable { fos ->
fos << gis
}
}
}
}
dependencies {
implementation fileTree(dir: "${rootProject.file(adScriptSdkDir)}/$aarFileName", include: ['*.aar', '*.jar'], exclude: [])
}
}

// Align the Kotlin SDK libraries with the same version.
implementation(platform("org.jetbrains.kotlin:kotlin-bom:$kotlin_version"))
}
Binary file not shown.
5 changes: 5 additions & 0 deletions adscript/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading
Loading