react-native-gemius-plugin 1.7.4 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +20 -0
- package/LRTGemiusPlugin.podspec +21 -0
- package/README.md +23 -30
- package/android/build.gradle +74 -69
- package/android/src/main/AndroidManifest.xml +1 -3
- package/android/src/main/java/com/gemiusplugin/LRTGemiusPluginModule.kt +161 -0
- package/android/src/main/java/com/gemiusplugin/LRTGemiusPluginPackage.kt +31 -0
- package/ios/LRTGemiusPlugin.h +5 -0
- package/ios/LRTGemiusPlugin.mm +179 -0
- package/lib/module/NativeLRTGemiusPlugin.js +5 -0
- package/lib/module/NativeLRTGemiusPlugin.js.map +1 -0
- package/{index.js → lib/module/index.js} +16 -29
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/NativeLRTGemiusPlugin.d.ts +22 -0
- package/lib/typescript/src/NativeLRTGemiusPlugin.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +22 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/package.json +156 -17
- package/src/NativeLRTGemiusPlugin.ts +48 -0
- package/src/index.tsx +105 -0
- package/.gitattributes +0 -1
- package/android/.classpath +0 -6
- package/android/.gradle/9.0.0/checksums/checksums.lock +0 -0
- package/android/.gradle/9.0.0/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/9.0.0/fileChanges/last-build.bin +0 -0
- package/android/.gradle/9.0.0/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/9.0.0/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/9.0.0/fileHashes/resourceHashesCache.bin +0 -0
- package/android/.gradle/9.0.0/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
- package/android/.gradle/config.properties +0 -2
- package/android/.gradle/file-system.probe +0 -0
- package/android/.gradle/gradle.properties +0 -43
- package/android/.gradle/noVersion/buildLogic.lock +0 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.idea/AndroidProjectSystem.xml +0 -6
- package/android/.idea/caches/deviceStreaming.xml +0 -1414
- package/android/.idea/compiler.xml +0 -19
- package/android/.idea/copilot.data.migration.agent.xml +0 -6
- package/android/.idea/gradle.xml +0 -18
- package/android/.idea/jarRepositories.xml +0 -55
- package/android/.idea/kotlinc.xml +0 -6
- package/android/.idea/migrations.xml +0 -10
- package/android/.idea/misc.xml +0 -10
- package/android/.idea/modules/android.androidTest.iml +0 -15
- package/android/.idea/modules/android.iml +0 -21
- package/android/.idea/modules/android.main.iml +0 -15
- package/android/.idea/modules/android.unitTest.iml +0 -15
- package/android/.idea/modules.xml +0 -11
- package/android/.idea/runConfigurations.xml +0 -17
- package/android/.idea/vcs.xml +0 -6
- package/android/.project +0 -34
- package/android/.settings/org.eclipse.buildship.core.prefs +0 -13
- package/android/README.md +0 -14
- package/android/build/reports/problems/problems-report.html +0 -663
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +0 -7
- package/android/gradle.properties +0 -39
- package/android/gradlew +0 -251
- package/android/gradlew.bat +0 -99
- package/android/local.properties +0 -8
- package/android/src/main/java/com/reactlibrary/GemiusPluginModule.java +0 -170
- package/android/src/main/java/com/reactlibrary/GemiusPluginPackage.java +0 -20
- package/index.d.ts +0 -27
- package/ios/GemiusPlugin.h +0 -5
- package/ios/GemiusPlugin.m +0 -163
- package/ios/GemiusPlugin.xcodeproj/project.pbxproj +0 -299
- package/ios/GemiusPlugin.xcodeproj/xcshareddata/xcschemes/GemiusPlugin.xcscheme +0 -67
- package/ios/GemiusPlugin.xcworkspace/contents.xcworkspacedata +0 -7
- package/ios/GemiusPlugin.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/ios/GemiusPlugin.xcworkspace/xcuserdata/kestasvenslauskas.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/GemiusSDK.xcframework/Info.plist +0 -44
- package/ios/GemiusSDK.xcframework/ios-arm64/GemiusSDK.framework/GemiusSDK +0 -0
- package/ios/GemiusSDK.xcframework/ios-arm64/GemiusSDK.framework/Headers/AdData.h +0 -23
- package/ios/GemiusSDK.xcframework/ios-arm64/GemiusSDK.framework/Headers/AdDefine.h +0 -16
- package/ios/GemiusSDK.xcframework/ios-arm64/GemiusSDK.framework/Headers/AdOceanConfig.h +0 -14
- package/ios/GemiusSDK.xcframework/ios-arm64/GemiusSDK.framework/Headers/AudienceConfig.h +0 -19
- package/ios/GemiusSDK.xcframework/ios-arm64/GemiusSDK.framework/Headers/AudienceEvent.h +0 -18
- package/ios/GemiusSDK.xcframework/ios-arm64/GemiusSDK.framework/Headers/BaseConfig.h +0 -19
- package/ios/GemiusSDK.xcframework/ios-arm64/GemiusSDK.framework/Headers/BaseEvent.h +0 -37
- package/ios/GemiusSDK.xcframework/ios-arm64/GemiusSDK.framework/Headers/Config.h +0 -44
- package/ios/GemiusSDK.xcframework/ios-arm64/GemiusSDK.framework/Headers/ContentData.h +0 -15
- package/ios/GemiusSDK.xcframework/ios-arm64/GemiusSDK.framework/Headers/EventAdData.h +0 -7
- package/ios/GemiusSDK.xcframework/ios-arm64/GemiusSDK.framework/Headers/EventData.h +0 -14
- package/ios/GemiusSDK.xcframework/ios-arm64/GemiusSDK.framework/Headers/EventProgramData.h +0 -7
- package/ios/GemiusSDK.xcframework/ios-arm64/GemiusSDK.framework/Headers/GEMBillboardAd.h +0 -43
- package/ios/GemiusSDK.xcframework/ios-arm64/GemiusSDK.framework/Headers/GEMFullScreenAd.h +0 -44
- package/ios/GemiusSDK.xcframework/ios-arm64/GemiusSDK.framework/Headers/GemiusSDK.h +0 -34
- package/ios/GemiusSDK.xcframework/ios-arm64/GemiusSDK.framework/Headers/NetpanelConfig.h +0 -17
- package/ios/GemiusSDK.xcframework/ios-arm64/GemiusSDK.framework/Headers/NetpanelEvent.h +0 -23
- package/ios/GemiusSDK.xcframework/ios-arm64/GemiusSDK.framework/Headers/Player.h +0 -40
- package/ios/GemiusSDK.xcframework/ios-arm64/GemiusSDK.framework/Headers/PlayerData.h +0 -8
- package/ios/GemiusSDK.xcframework/ios-arm64/GemiusSDK.framework/Headers/ProgramData.h +0 -41
- package/ios/GemiusSDK.xcframework/ios-arm64/GemiusSDK.framework/Info.plist +0 -0
- package/ios/GemiusSDK.xcframework/ios-arm64/GemiusSDK.framework/Modules/module.modulemap +0 -6
- package/ios/GemiusSDK.xcframework/ios-arm64/GemiusSDK.framework/PrivacyInfo.xcprivacy +0 -48
- package/ios/GemiusSDK.xcframework/ios-arm64_x86_64-simulator/GemiusSDK.framework/GemiusSDK +0 -0
- package/ios/GemiusSDK.xcframework/ios-arm64_x86_64-simulator/GemiusSDK.framework/Headers/AdData.h +0 -23
- package/ios/GemiusSDK.xcframework/ios-arm64_x86_64-simulator/GemiusSDK.framework/Headers/AdDefine.h +0 -16
- package/ios/GemiusSDK.xcframework/ios-arm64_x86_64-simulator/GemiusSDK.framework/Headers/AdOceanConfig.h +0 -14
- package/ios/GemiusSDK.xcframework/ios-arm64_x86_64-simulator/GemiusSDK.framework/Headers/AudienceConfig.h +0 -19
- package/ios/GemiusSDK.xcframework/ios-arm64_x86_64-simulator/GemiusSDK.framework/Headers/AudienceEvent.h +0 -18
- package/ios/GemiusSDK.xcframework/ios-arm64_x86_64-simulator/GemiusSDK.framework/Headers/BaseConfig.h +0 -19
- package/ios/GemiusSDK.xcframework/ios-arm64_x86_64-simulator/GemiusSDK.framework/Headers/BaseEvent.h +0 -37
- package/ios/GemiusSDK.xcframework/ios-arm64_x86_64-simulator/GemiusSDK.framework/Headers/Config.h +0 -44
- package/ios/GemiusSDK.xcframework/ios-arm64_x86_64-simulator/GemiusSDK.framework/Headers/ContentData.h +0 -15
- package/ios/GemiusSDK.xcframework/ios-arm64_x86_64-simulator/GemiusSDK.framework/Headers/EventAdData.h +0 -7
- package/ios/GemiusSDK.xcframework/ios-arm64_x86_64-simulator/GemiusSDK.framework/Headers/EventData.h +0 -14
- package/ios/GemiusSDK.xcframework/ios-arm64_x86_64-simulator/GemiusSDK.framework/Headers/EventProgramData.h +0 -7
- package/ios/GemiusSDK.xcframework/ios-arm64_x86_64-simulator/GemiusSDK.framework/Headers/GEMBillboardAd.h +0 -43
- package/ios/GemiusSDK.xcframework/ios-arm64_x86_64-simulator/GemiusSDK.framework/Headers/GEMFullScreenAd.h +0 -44
- package/ios/GemiusSDK.xcframework/ios-arm64_x86_64-simulator/GemiusSDK.framework/Headers/GemiusSDK.h +0 -34
- package/ios/GemiusSDK.xcframework/ios-arm64_x86_64-simulator/GemiusSDK.framework/Headers/NetpanelConfig.h +0 -17
- package/ios/GemiusSDK.xcframework/ios-arm64_x86_64-simulator/GemiusSDK.framework/Headers/NetpanelEvent.h +0 -23
- package/ios/GemiusSDK.xcframework/ios-arm64_x86_64-simulator/GemiusSDK.framework/Headers/Player.h +0 -40
- package/ios/GemiusSDK.xcframework/ios-arm64_x86_64-simulator/GemiusSDK.framework/Headers/PlayerData.h +0 -8
- package/ios/GemiusSDK.xcframework/ios-arm64_x86_64-simulator/GemiusSDK.framework/Headers/ProgramData.h +0 -41
- package/ios/GemiusSDK.xcframework/ios-arm64_x86_64-simulator/GemiusSDK.framework/Info.plist +0 -0
- package/ios/GemiusSDK.xcframework/ios-arm64_x86_64-simulator/GemiusSDK.framework/Modules/module.modulemap +0 -6
- package/ios/GemiusSDK.xcframework/ios-arm64_x86_64-simulator/GemiusSDK.framework/PrivacyInfo.xcprivacy +0 -48
- package/ios/GemiusSDK.xcframework/ios-arm64_x86_64-simulator/GemiusSDK.framework/_CodeSignature/CodeDirectory +0 -0
- package/ios/GemiusSDK.xcframework/ios-arm64_x86_64-simulator/GemiusSDK.framework/_CodeSignature/CodeRequirements +0 -0
- package/ios/GemiusSDK.xcframework/ios-arm64_x86_64-simulator/GemiusSDK.framework/_CodeSignature/CodeResources +0 -344
- package/ios/GemiusSDK.xcframework/ios-arm64_x86_64-simulator/GemiusSDK.framework/_CodeSignature/CodeSignature +0 -0
- package/react-native-gemius-plugin.podspec +0 -30
package/LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Kestas Venslauskas
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
in the Software without restriction, including without limitation the rights
|
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
furnished to do so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+
SOFTWARE.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
require "json"
|
|
2
|
+
|
|
3
|
+
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
4
|
+
|
|
5
|
+
Pod::Spec.new do |s|
|
|
6
|
+
s.name = "LRTGemiusPlugin"
|
|
7
|
+
s.version = package["version"]
|
|
8
|
+
s.summary = package["description"]
|
|
9
|
+
s.homepage = package["homepage"]
|
|
10
|
+
s.license = package["license"]
|
|
11
|
+
s.authors = package["author"]
|
|
12
|
+
|
|
13
|
+
s.platforms = { :ios => min_ios_version_supported }
|
|
14
|
+
s.source = { :git => "https://github.com/KestasVenslauskas/react-native-gemius-plugin.git", :tag => "#{s.version}" }
|
|
15
|
+
|
|
16
|
+
s.source_files = "ios/*.{h,m,mm,swift,cpp}"
|
|
17
|
+
s.private_header_files = "ios/*.h"
|
|
18
|
+
s.vendored_frameworks = "ios/Frameworks/GemiusSDK.xcframework"
|
|
19
|
+
|
|
20
|
+
install_modules_dependencies(s)
|
|
21
|
+
end
|
package/README.md
CHANGED
|
@@ -1,44 +1,37 @@
|
|
|
1
1
|
# react-native-gemius-plugin
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
React Native Gemius plugin
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Installation
|
|
6
6
|
|
|
7
|
-
### Mostly automatic installation
|
|
8
7
|
|
|
9
|
-
|
|
8
|
+
```sh
|
|
9
|
+
npm install react-native-gemius-plugin
|
|
10
|
+
```
|
|
10
11
|
|
|
11
|
-
### Manual installation
|
|
12
12
|
|
|
13
|
+
## Usage
|
|
13
14
|
|
|
14
|
-
#### iOS
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
3. In XCode, in the project navigator, select your project. Add `libGemiusPlugin.a` to your project's `Build Phases` ➜ `Link Binary With Libraries`
|
|
19
|
-
4. Run your project (`Cmd+R`)<
|
|
16
|
+
```js
|
|
17
|
+
import { multiply } from 'react-native-gemius-plugin';
|
|
20
18
|
|
|
21
|
-
|
|
19
|
+
// ...
|
|
22
20
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
- Add `new GemiusPluginPackage()` to the list returned by the `getPackages()` method
|
|
26
|
-
2. Append the following lines to `android/settings.gradle`:
|
|
27
|
-
```
|
|
28
|
-
include ':react-native-gemius-plugin'
|
|
29
|
-
project(':react-native-gemius-plugin').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-gemius-plugin/android')
|
|
30
|
-
```
|
|
31
|
-
3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:
|
|
32
|
-
```
|
|
33
|
-
compile project(':react-native-gemius-plugin')
|
|
34
|
-
```
|
|
21
|
+
const result = multiply(3, 7);
|
|
22
|
+
```
|
|
35
23
|
|
|
36
24
|
|
|
37
|
-
##
|
|
38
|
-
```javascript
|
|
39
|
-
import GemiusPlugin from 'react-native-gemius-plugin';
|
|
25
|
+
## Contributing
|
|
40
26
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
27
|
+
- [Development workflow](CONTRIBUTING.md#development-workflow)
|
|
28
|
+
- [Sending a pull request](CONTRIBUTING.md#sending-a-pull-request)
|
|
29
|
+
- [Code of conduct](CODE_OF_CONDUCT.md)
|
|
30
|
+
|
|
31
|
+
## License
|
|
32
|
+
|
|
33
|
+
MIT
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)
|
package/android/build.gradle
CHANGED
|
@@ -1,83 +1,88 @@
|
|
|
1
|
-
// android/build.gradle
|
|
2
|
-
|
|
3
|
-
def safeExtGet(prop, fallback) {
|
|
4
|
-
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
|
|
5
|
-
}
|
|
6
|
-
|
|
7
1
|
buildscript {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
2
|
+
ext.LRTGemiusPlugin = [
|
|
3
|
+
kotlinVersion: "2.0.21",
|
|
4
|
+
minSdkVersion: 24,
|
|
5
|
+
compileSdkVersion: 36,
|
|
6
|
+
targetSdkVersion: 36
|
|
7
|
+
]
|
|
8
|
+
|
|
9
|
+
ext.getExtOrDefault = { prop ->
|
|
10
|
+
if (rootProject.ext.has(prop)) {
|
|
11
|
+
return rootProject.ext.get(prop)
|
|
19
12
|
}
|
|
13
|
+
|
|
14
|
+
return LRTGemiusPlugin[prop]
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
repositories {
|
|
18
|
+
google()
|
|
19
|
+
mavenCentral()
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
dependencies {
|
|
23
|
+
classpath "com.android.tools.build:gradle:8.7.2"
|
|
24
|
+
// noinspection DifferentKotlinGradleVersion
|
|
25
|
+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}"
|
|
26
|
+
}
|
|
20
27
|
}
|
|
21
28
|
|
|
22
|
-
apply plugin: 'com.android.library'
|
|
23
29
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
// https://github.com/facebook/react-native/blob/0.60-stable/template/android/build.gradle#L5-L9
|
|
27
|
-
def DEFAULT_COMPILE_SDK_VERSION = 36
|
|
28
|
-
def DEFAULT_BUILD_TOOLS_VERSION = "36.0.0"
|
|
29
|
-
def DEFAULT_MIN_SDK_VERSION = 24
|
|
30
|
-
def DEFAULT_TARGET_SDK_VERSION = 36
|
|
30
|
+
apply plugin: "com.android.library"
|
|
31
|
+
apply plugin: "kotlin-android"
|
|
31
32
|
|
|
32
|
-
|
|
33
|
-
compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
|
|
34
|
-
buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION)
|
|
35
|
-
defaultConfig {
|
|
36
|
-
minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION)
|
|
37
|
-
targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION)
|
|
38
|
-
versionCode 15
|
|
39
|
-
versionName "1.5"
|
|
40
|
-
}
|
|
33
|
+
apply plugin: "com.facebook.react"
|
|
41
34
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
35
|
+
repositories {
|
|
36
|
+
maven { url 'https://developer.huawei.com/repo/' }
|
|
45
37
|
}
|
|
46
38
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
url 'https://mobilesdk.gemius.com/releases/'
|
|
39
|
+
android {
|
|
40
|
+
namespace "com.gemiusplugin"
|
|
41
|
+
|
|
42
|
+
compileSdkVersion getExtOrDefault("compileSdkVersion")
|
|
43
|
+
|
|
44
|
+
defaultConfig {
|
|
45
|
+
minSdkVersion getExtOrDefault("minSdkVersion")
|
|
46
|
+
targetSdkVersion getExtOrDefault("targetSdkVersion")
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
buildFeatures {
|
|
50
|
+
buildConfig true
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
buildTypes {
|
|
54
|
+
release {
|
|
55
|
+
minifyEnabled false
|
|
65
56
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
lint {
|
|
60
|
+
disable "GradleCompatible"
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
compileOptions {
|
|
64
|
+
sourceCompatibility JavaVersion.VERSION_1_8
|
|
65
|
+
targetCompatibility JavaVersion.VERSION_1_8
|
|
66
|
+
}
|
|
69
67
|
}
|
|
70
68
|
|
|
71
69
|
dependencies {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
70
|
+
implementation "com.facebook.react:react-android"
|
|
71
|
+
|
|
72
|
+
// Gemius SDK (local AAR)
|
|
73
|
+
implementation files('libs/mobile-sdk-2.3.0.aar')
|
|
74
|
+
|
|
75
|
+
// Gemius SDK transitive dependencies
|
|
76
|
+
implementation "com.huawei.hms:ads-identifier:3.4.58.301"
|
|
77
|
+
implementation "com.google.code.gson:gson:2.11.0"
|
|
78
|
+
implementation "com.google.android.gms:play-services-base:18.7.2"
|
|
79
|
+
implementation "com.google.android.gms:play-services-ads:24.5.0"
|
|
80
|
+
implementation "com.google.android.gms:play-services-appset:16.1.0"
|
|
81
|
+
implementation "androidx.core:core:1.17.0"
|
|
82
|
+
implementation "androidx.preference:preference:1.2.1"
|
|
83
|
+
implementation "androidx.lifecycle:lifecycle-process:2.9.1"
|
|
84
|
+
implementation "com.squareup.retrofit2:retrofit:2.11.0"
|
|
85
|
+
implementation "com.squareup.retrofit2:converter-scalars:2.11.0"
|
|
86
|
+
implementation "com.squareup.okhttp3:logging-interceptor:4.12.0"
|
|
87
|
+
implementation "ch.acra:acra-http:5.7.0"
|
|
83
88
|
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
package com.gemiusplugin
|
|
2
|
+
|
|
3
|
+
import android.os.Handler
|
|
4
|
+
import android.os.Looper
|
|
5
|
+
import android.util.Log
|
|
6
|
+
import com.facebook.react.bridge.ReactApplicationContext
|
|
7
|
+
import com.facebook.react.bridge.ReadableMap
|
|
8
|
+
import com.facebook.react.bridge.ReadableType
|
|
9
|
+
import com.gemius.sdk.Config
|
|
10
|
+
import com.gemius.sdk.audience.AudienceConfig
|
|
11
|
+
import com.gemius.sdk.audience.AudienceEvent
|
|
12
|
+
import com.gemius.sdk.audience.BaseEvent
|
|
13
|
+
import com.gemius.sdk.stream.EventProgramData
|
|
14
|
+
import com.gemius.sdk.stream.Player
|
|
15
|
+
import com.gemius.sdk.stream.PlayerData
|
|
16
|
+
import com.gemius.sdk.stream.ProgramData
|
|
17
|
+
|
|
18
|
+
class LRTGemiusPluginModule(private val reactContext: ReactApplicationContext) :
|
|
19
|
+
NativeLRTGemiusPluginSpec(reactContext) {
|
|
20
|
+
|
|
21
|
+
private var player: Player? = null
|
|
22
|
+
|
|
23
|
+
companion object {
|
|
24
|
+
const val TAG = "LRTGemiusPlugin"
|
|
25
|
+
const val NAME = NativeLRTGemiusPluginSpec.NAME
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
override fun setAppInfo(
|
|
29
|
+
app: String,
|
|
30
|
+
version: String,
|
|
31
|
+
gemiusHitCollectorHost: String,
|
|
32
|
+
gemiusPrismIdentifier: String,
|
|
33
|
+
) {
|
|
34
|
+
Log.i(TAG, "Setting app info: app[$app] version[$version]")
|
|
35
|
+
Config.setAppInfo(app, version)
|
|
36
|
+
AudienceConfig.getSingleton().setHitCollectorHost(gemiusHitCollectorHost)
|
|
37
|
+
AudienceConfig.getSingleton().setScriptIdentifier(gemiusPrismIdentifier)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
override fun setPlayerInfo(playerId: String, serverHost: String, accountId: String) {
|
|
41
|
+
Log.w(TAG, "Initialising player...")
|
|
42
|
+
if (player == null) {
|
|
43
|
+
player = Player(playerId, serverHost, accountId, PlayerData())
|
|
44
|
+
player!!.setContext(reactContext)
|
|
45
|
+
} else {
|
|
46
|
+
Log.w(TAG, "Player already initialised")
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
override fun setProgramData(clipId: String, name: String, duration: Double, type: String) {
|
|
51
|
+
val durationInt = duration.toInt()
|
|
52
|
+
Log.d(TAG, "Setting new program data for '$name'")
|
|
53
|
+
val programData = ProgramData()
|
|
54
|
+
programData.setName(name)
|
|
55
|
+
programData.setDuration(durationInt)
|
|
56
|
+
if (type == "audio") {
|
|
57
|
+
programData.setProgramType(ProgramData.ProgramType.AUDIO)
|
|
58
|
+
} else {
|
|
59
|
+
programData.setProgramType(ProgramData.ProgramType.VIDEO)
|
|
60
|
+
}
|
|
61
|
+
player?.newProgram(clipId, programData)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
override fun sendPlay(clipId: String, offset: Double) {
|
|
65
|
+
val offsetInt = offset.toInt()
|
|
66
|
+
Log.d(TAG, "Player PLAY event for '$clipId' offset: $offsetInt")
|
|
67
|
+
val eventProgramData = EventProgramData()
|
|
68
|
+
eventProgramData.setAutoPlay(true)
|
|
69
|
+
player?.programEvent(clipId, offsetInt, Player.EventType.PLAY, eventProgramData)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
override fun sendPause(clipId: String, offset: Double) {
|
|
73
|
+
val offsetInt = offset.toInt()
|
|
74
|
+
Log.d(TAG, "Player PAUSE event for '$clipId' offset: $offsetInt")
|
|
75
|
+
player?.programEvent(clipId, offsetInt, Player.EventType.PAUSE, EventProgramData())
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
override fun sendStop(clipId: String, offset: Double) {
|
|
79
|
+
val offsetInt = offset.toInt()
|
|
80
|
+
Log.d(TAG, "Player STOP event for '$clipId' offset: $offsetInt")
|
|
81
|
+
player?.programEvent(clipId, offsetInt, Player.EventType.STOP, EventProgramData())
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
override fun sendBuffer(clipId: String, offset: Double) {
|
|
85
|
+
val offsetInt = offset.toInt()
|
|
86
|
+
Log.d(TAG, "Player BUFFER event for '$clipId' offset: $offsetInt")
|
|
87
|
+
player?.programEvent(clipId, offsetInt, Player.EventType.BUFFER, EventProgramData())
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
override fun sendClose(clipId: String, offset: Double) {
|
|
91
|
+
val offsetInt = offset.toInt()
|
|
92
|
+
Log.d(TAG, "Player CLOSE event for '$clipId' offset: $offsetInt")
|
|
93
|
+
player?.programEvent(clipId, offsetInt, Player.EventType.CLOSE, EventProgramData())
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
override fun sendSeek(clipId: String, offset: Double) {
|
|
97
|
+
val offsetInt = offset.toInt()
|
|
98
|
+
Log.d(TAG, "Player SEEK event for '$clipId' offset: $offsetInt")
|
|
99
|
+
player?.programEvent(clipId, offsetInt, Player.EventType.SEEK, EventProgramData())
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
override fun sendComplete(clipId: String, offset: Double) {
|
|
103
|
+
val offsetInt = offset.toInt()
|
|
104
|
+
Log.d(TAG, "Player COMPLETE event for '$clipId' offset: $offsetInt")
|
|
105
|
+
player?.programEvent(clipId, offsetInt, Player.EventType.COMPLETE, EventProgramData())
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
override fun sendPageViewedEvent(gemiusPrismIdentifier: String, extraParameters: ReadableMap?) {
|
|
109
|
+
Log.d(TAG, "sendPageViewedEvent() called.")
|
|
110
|
+
Handler(Looper.getMainLooper()).post {
|
|
111
|
+
val event = AudienceEvent(reactContext)
|
|
112
|
+
event.setScriptIdentifier(gemiusPrismIdentifier)
|
|
113
|
+
event.setEventType(BaseEvent.EventType.FULL_PAGEVIEW)
|
|
114
|
+
addParamsToEvent(event, extraParameters)
|
|
115
|
+
event.sendEvent()
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
override fun sendPartialPageViewedEvent(
|
|
120
|
+
gemiusPrismIdentifier: String,
|
|
121
|
+
extraParameters: ReadableMap?,
|
|
122
|
+
) {
|
|
123
|
+
Log.d(TAG, "sendPartialPageViewedEvent() called.")
|
|
124
|
+
Handler(Looper.getMainLooper()).post {
|
|
125
|
+
val event = AudienceEvent(reactContext)
|
|
126
|
+
event.setScriptIdentifier(gemiusPrismIdentifier)
|
|
127
|
+
event.setEventType(BaseEvent.EventType.PARTIAL_PAGEVIEW)
|
|
128
|
+
addParamsToEvent(event, extraParameters)
|
|
129
|
+
event.sendEvent()
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
override fun sendActionEvent(gemiusPrismIdentifier: String, extraParameters: ReadableMap?) {
|
|
134
|
+
Log.d(TAG, "sendActionEvent() called.")
|
|
135
|
+
Handler(Looper.getMainLooper()).post {
|
|
136
|
+
val event = AudienceEvent(reactContext)
|
|
137
|
+
event.setScriptIdentifier(gemiusPrismIdentifier)
|
|
138
|
+
event.setEventType(BaseEvent.EventType.ACTION)
|
|
139
|
+
addParamsToEvent(event, extraParameters)
|
|
140
|
+
event.sendEvent()
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
private fun addParamsToEvent(event: BaseEvent, paramsMap: ReadableMap?) {
|
|
145
|
+
paramsMap?.let {
|
|
146
|
+
val iterator = it.keySetIterator()
|
|
147
|
+
while (iterator.hasNextKey()) {
|
|
148
|
+
val key = iterator.nextKey()
|
|
149
|
+
val value = when (it.getType(key)) {
|
|
150
|
+
ReadableType.Number -> {
|
|
151
|
+
val d = it.getDouble(key)
|
|
152
|
+
if (d == Math.floor(d)) d.toLong().toString() else d.toString()
|
|
153
|
+
}
|
|
154
|
+
ReadableType.Boolean -> it.getBoolean(key).toString()
|
|
155
|
+
else -> it.getString(key) ?: ""
|
|
156
|
+
}
|
|
157
|
+
event.addExtraParameter(key, value)
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
package com.gemiusplugin
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.BaseReactPackage
|
|
4
|
+
import com.facebook.react.bridge.NativeModule
|
|
5
|
+
import com.facebook.react.bridge.ReactApplicationContext
|
|
6
|
+
import com.facebook.react.module.model.ReactModuleInfo
|
|
7
|
+
import com.facebook.react.module.model.ReactModuleInfoProvider
|
|
8
|
+
import java.util.HashMap
|
|
9
|
+
|
|
10
|
+
class LRTGemiusPluginPackage : BaseReactPackage() {
|
|
11
|
+
override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? {
|
|
12
|
+
return if (name == LRTGemiusPluginModule.NAME) {
|
|
13
|
+
LRTGemiusPluginModule(reactContext)
|
|
14
|
+
} else {
|
|
15
|
+
null
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
override fun getReactModuleInfoProvider() = ReactModuleInfoProvider {
|
|
20
|
+
mapOf(
|
|
21
|
+
LRTGemiusPluginModule.NAME to ReactModuleInfo(
|
|
22
|
+
name = LRTGemiusPluginModule.NAME,
|
|
23
|
+
className = LRTGemiusPluginModule.NAME,
|
|
24
|
+
canOverrideExistingModule = false,
|
|
25
|
+
needsEagerInit = false,
|
|
26
|
+
isCxxModule = false,
|
|
27
|
+
isTurboModule = true
|
|
28
|
+
)
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
#import "LRTGemiusPlugin.h"
|
|
2
|
+
#import <GemiusSDK/GemiusSDK.h>
|
|
3
|
+
|
|
4
|
+
@implementation LRTGemiusPlugin {
|
|
5
|
+
GSMPlayer *player;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
- (dispatch_queue_t)methodQueue
|
|
9
|
+
{
|
|
10
|
+
return dispatch_get_main_queue();
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
+ (NSString *)moduleName
|
|
14
|
+
{
|
|
15
|
+
return @"LRTGemiusPlugin";
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
- (void)setAppInfo:(NSString *)app version:(NSString *)version gemiusHitCollectorHost:(NSString *)gemiusHitCollectorHost gemiusPrismIdentifier:(NSString *)gemiusPrismIdentifier
|
|
19
|
+
{
|
|
20
|
+
[[GEMAudienceConfig sharedInstance] setHitcollectorHost:gemiusHitCollectorHost];
|
|
21
|
+
[[GEMAudienceConfig sharedInstance] setScriptIdentifier:gemiusPrismIdentifier];
|
|
22
|
+
[[GEMConfig sharedInstance] setLoggingEnabled:YES];
|
|
23
|
+
[[GEMConfig sharedInstance] setAppInfo:app version:version];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
- (void)sendPageViewedEvent:(NSString *)gemiusPrismIdentifier extraParameters:(NSDictionary * _Nullable)extraParameters
|
|
27
|
+
{
|
|
28
|
+
GEMAudienceEvent *event = [GEMAudienceEvent new];
|
|
29
|
+
[event setEventType:GEM_EVENT_FULL_PAGEVIEW];
|
|
30
|
+
[event setScriptIdentifier:gemiusPrismIdentifier];
|
|
31
|
+
|
|
32
|
+
if (extraParameters != nil) {
|
|
33
|
+
for (NSString *key in extraParameters) {
|
|
34
|
+
id value = extraParameters[key];
|
|
35
|
+
NSString *stringValue = [value isKindOfClass:[NSString class]] ? value : [NSString stringWithFormat:@"%@", value];
|
|
36
|
+
[event addExtraParameter:key value:stringValue];
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
[event sendEvent];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
- (void)sendPartialPageViewedEvent:(NSString *)gemiusPrismIdentifier extraParameters:(NSDictionary * _Nullable)extraParameters
|
|
43
|
+
{
|
|
44
|
+
GEMAudienceEvent *event = [GEMAudienceEvent new];
|
|
45
|
+
[event setEventType:GEM_EVENT_PARTIAL_PAGEVIEW];
|
|
46
|
+
[event setScriptIdentifier:gemiusPrismIdentifier];
|
|
47
|
+
|
|
48
|
+
if (extraParameters != nil) {
|
|
49
|
+
for (NSString *key in extraParameters) {
|
|
50
|
+
id value = extraParameters[key];
|
|
51
|
+
NSString *stringValue = [value isKindOfClass:[NSString class]] ? value : [NSString stringWithFormat:@"%@", value];
|
|
52
|
+
[event addExtraParameter:key value:stringValue];
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
[event sendEvent];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
- (void)sendActionEvent:(NSString *)gemiusPrismIdentifier extraParameters:(NSDictionary * _Nullable)extraParameters
|
|
59
|
+
{
|
|
60
|
+
GEMAudienceEvent *event = [GEMAudienceEvent new];
|
|
61
|
+
[event setEventType:GEM_EVENT_ACTION];
|
|
62
|
+
[event setScriptIdentifier:gemiusPrismIdentifier];
|
|
63
|
+
|
|
64
|
+
if (extraParameters != nil) {
|
|
65
|
+
for (NSString *key in extraParameters) {
|
|
66
|
+
id value = extraParameters[key];
|
|
67
|
+
NSString *stringValue = [value isKindOfClass:[NSString class]] ? value : [NSString stringWithFormat:@"%@", value];
|
|
68
|
+
[event addExtraParameter:key value:stringValue];
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
[event sendEvent];
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
- (void)setPlayerInfo:(NSString *)playerId serverHost:(NSString *)serverHost accountId:(NSString *)accountId
|
|
75
|
+
{
|
|
76
|
+
NSLog(@"Initializing player...");
|
|
77
|
+
if (player == nil) {
|
|
78
|
+
player = [[GSMPlayer alloc] initWithID:playerId withHost:serverHost withGemiusID:accountId withData:nil];
|
|
79
|
+
} else {
|
|
80
|
+
NSLog(@"Player already initialized!");
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
- (void)setProgramData:(NSString *)clipId name:(NSString *)name duration:(double)duration type:(NSString *)type
|
|
85
|
+
{
|
|
86
|
+
NSNumber *durationNumber = [NSNumber numberWithDouble:duration];
|
|
87
|
+
NSLog(@"Setting new program data for %@ with duration %@", name, durationNumber);
|
|
88
|
+
|
|
89
|
+
GSMProgramData *pdata = [[GSMProgramData alloc] init];
|
|
90
|
+
pdata.duration = durationNumber;
|
|
91
|
+
pdata.name = name;
|
|
92
|
+
if ([type isEqualToString:@"audio"]) {
|
|
93
|
+
pdata.programType = GSM_AUDIO;
|
|
94
|
+
} else {
|
|
95
|
+
pdata.programType = GSM_VIDEO;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
[player newProgram:clipId withData:pdata];
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
- (void)sendPlay:(NSString *)clipId offset:(double)offset
|
|
102
|
+
{
|
|
103
|
+
NSNumber *offsetNumber = [NSNumber numberWithDouble:offset];
|
|
104
|
+
NSLog(@"Player PLAY event for '%@' offset: %@", clipId, offsetNumber);
|
|
105
|
+
|
|
106
|
+
if (player) {
|
|
107
|
+
GSMEventProgramData *data = [[GSMEventProgramData alloc] init];
|
|
108
|
+
data.autoPlay = [NSNumber numberWithBool:YES];
|
|
109
|
+
[player programEvent:GSM_PLAY forProgram:clipId atOffset:offsetNumber withData:data];
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
- (void)sendPause:(NSString *)clipId offset:(double)offset
|
|
114
|
+
{
|
|
115
|
+
NSNumber *offsetNumber = [NSNumber numberWithDouble:offset];
|
|
116
|
+
NSLog(@"Player PAUSE event for '%@' offset: %@", clipId, offsetNumber);
|
|
117
|
+
|
|
118
|
+
if (player) {
|
|
119
|
+
[player programEvent:GSM_PAUSE forProgram:clipId atOffset:offsetNumber withData:nil];
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
- (void)sendStop:(NSString *)clipId offset:(double)offset
|
|
124
|
+
{
|
|
125
|
+
NSNumber *offsetNumber = [NSNumber numberWithDouble:offset];
|
|
126
|
+
NSLog(@"Player STOP event for '%@' offset: %@", clipId, offsetNumber);
|
|
127
|
+
|
|
128
|
+
if (player) {
|
|
129
|
+
[player programEvent:GSM_STOP forProgram:clipId atOffset:offsetNumber withData:nil];
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
- (void)sendBuffer:(NSString *)clipId offset:(double)offset
|
|
134
|
+
{
|
|
135
|
+
NSNumber *offsetNumber = [NSNumber numberWithDouble:offset];
|
|
136
|
+
NSLog(@"Player BUFFER event for '%@' offset: %@", clipId, offsetNumber);
|
|
137
|
+
|
|
138
|
+
if (player) {
|
|
139
|
+
[player programEvent:GSM_BUFFER forProgram:clipId atOffset:offsetNumber withData:nil];
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
- (void)sendClose:(NSString *)clipId offset:(double)offset
|
|
144
|
+
{
|
|
145
|
+
NSNumber *offsetNumber = [NSNumber numberWithDouble:offset];
|
|
146
|
+
NSLog(@"Player CLOSE event for '%@' offset: %@", clipId, offsetNumber);
|
|
147
|
+
|
|
148
|
+
if (player) {
|
|
149
|
+
[player programEvent:GSM_CLOSE forProgram:clipId atOffset:offsetNumber withData:nil];
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
- (void)sendSeek:(NSString *)clipId offset:(double)offset
|
|
154
|
+
{
|
|
155
|
+
NSNumber *offsetNumber = [NSNumber numberWithDouble:offset];
|
|
156
|
+
NSLog(@"Player SEEK event for '%@' offset: %@", clipId, offsetNumber);
|
|
157
|
+
|
|
158
|
+
if (player) {
|
|
159
|
+
[player programEvent:GSM_SEEK forProgram:clipId atOffset:offsetNumber withData:nil];
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
- (void)sendComplete:(NSString *)clipId offset:(double)offset
|
|
164
|
+
{
|
|
165
|
+
NSNumber *offsetNumber = [NSNumber numberWithDouble:offset];
|
|
166
|
+
NSLog(@"Player COMPLETE event for '%@' offset: %@", clipId, offsetNumber);
|
|
167
|
+
|
|
168
|
+
if (player) {
|
|
169
|
+
[player programEvent:GSM_COMPLETE forProgram:clipId atOffset:offsetNumber withData:nil];
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
|
|
174
|
+
(const facebook::react::ObjCTurboModule::InitParams &)params
|
|
175
|
+
{
|
|
176
|
+
return std::make_shared<facebook::react::NativeLRTGemiusPluginSpecJSI>(params);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
@end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeLRTGemiusPlugin.ts"],"mappings":";;AAAA,SAASA,mBAAmB,QAA0B,cAAc;AA+CpE,eAAeA,mBAAmB,CAACC,YAAY,CAAO,iBAAiB,CAAC","ignoreList":[]}
|