@amplitude/plugin-engagement-react-native 1.6.1 → 1.8.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/PluginEngagementReactNative.podspec +14 -1
- package/android/build.gradle +12 -2
- package/android/settings.gradle +12 -0
- package/lib/module/AmplitudeEngagementPlugin.js.map +1 -1
- package/lib/module/build-version.json +1 -1
- package/lib/typescript/src/AmplitudeEngagementPlugin.d.ts +4 -4
- package/lib/typescript/src/AmplitudeEngagementPlugin.d.ts.map +1 -1
- package/package.json +5 -1
- package/src/AmplitudeEngagementPlugin.ts +10 -5
|
@@ -16,7 +16,20 @@ Pod::Spec.new do |s|
|
|
|
16
16
|
s.source_files = "ios/**/*.{h,m,mm,cpp,swift}"
|
|
17
17
|
s.private_header_files = "ios/**/*.h"
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
# Conditionally vendor frameworks based on CI environment variable
|
|
20
|
+
# This functionality exists to enable development of the SDK locally in React Native/Flutter projects without having to publish the frameworks to a public repository.
|
|
21
|
+
# Use local frameworks when NOT in CI (for local development), use CocoaPods dependency in CI
|
|
22
|
+
use_local_frameworks = ENV['IOS_USE_LOCAL_SDK_SOURCE'] == 'true'
|
|
23
|
+
|
|
24
|
+
if use_local_frameworks
|
|
25
|
+
s.ios.vendored_frameworks = [
|
|
26
|
+
'ios/Frameworks/AmplitudeEngagementSwift.xcframework',
|
|
27
|
+
'ios/Frameworks/CQuickJS.xcframework',
|
|
28
|
+
]
|
|
29
|
+
s.dependency 'AmplitudeCore', '>=1.0.12', '<2.0.0'
|
|
30
|
+
else
|
|
31
|
+
s.dependency "AmplitudeEngagementSwift", "1.8.0"
|
|
32
|
+
end
|
|
20
33
|
|
|
21
34
|
install_modules_dependencies(s)
|
|
22
35
|
end
|
package/android/build.gradle
CHANGED
|
@@ -9,7 +9,7 @@ buildscript {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
dependencies {
|
|
12
|
-
classpath "com.android.tools.build:gradle:8.
|
|
12
|
+
classpath "com.android.tools.build:gradle:8.9.1"
|
|
13
13
|
// noinspection DifferentKotlinGradleVersion
|
|
14
14
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}"
|
|
15
15
|
}
|
|
@@ -67,6 +67,16 @@ android {
|
|
|
67
67
|
repositories {
|
|
68
68
|
mavenCentral()
|
|
69
69
|
google()
|
|
70
|
+
|
|
71
|
+
def localAndroidDir = new File(rootDir, "../../android")
|
|
72
|
+
if (localAndroidDir.exists()) {
|
|
73
|
+
maven {
|
|
74
|
+
url = new File(localAndroidDir, "engagement/build/outputs/fat-aar/release").toURI()
|
|
75
|
+
metadataSources {
|
|
76
|
+
artifact()
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
70
80
|
}
|
|
71
81
|
|
|
72
82
|
def kotlin_version = getExtOrDefault("kotlinVersion")
|
|
@@ -76,7 +86,7 @@ dependencies {
|
|
|
76
86
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
77
87
|
|
|
78
88
|
// Amplitude Engagement SDK
|
|
79
|
-
implementation "com.amplitude:amplitude-engagement-android:1.
|
|
89
|
+
implementation "com.amplitude:amplitude-engagement-android:1.8.0"
|
|
80
90
|
|
|
81
91
|
// Amplitude Analytics SDK (required dependency)
|
|
82
92
|
implementation "com.amplitude:analytics-android:1.+"
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
rootProject.name = "plugin-engagement-react-native"
|
|
2
|
+
|
|
3
|
+
def localAndroidDir = new File(rootDir, "../../android")
|
|
4
|
+
if (localAndroidDir.exists()) {
|
|
5
|
+
includeBuild(localAndroidDir) {
|
|
6
|
+
dependencySubstitution {
|
|
7
|
+
substitute(module("com.amplitude:amplitude-engagement-android"))
|
|
8
|
+
.using(project(":engagement"))
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["forwardEvent","init","screen","boot","NativePluginEngagementReactNative","Logger","version","AmplitudeEngagementPlugin","name","type","logger","SDK_LIBRARY","SDK_VERSION","trackEventSubscription","setup","config","client","log","apiKey","error","user_id","device_id","remove","onTrackEvent","event","eventProperties","event_properties","track","event_type","execute","context","JSON","stringify","screenName"],"sourceRoot":"../../src","sources":["AmplitudeEngagementPlugin.ts"],"mappings":";;AAMA,SAASA,YAAY,EAAEC,IAAI,EAAEC,MAAM,EAAEC,IAAI,QAAQ,YAAG;AACpD,OAAOC,iCAAiC,MAAM,wCAAqC;AAEnF,SAASC,MAAM,QAA8B,aAAU;AAEvD,SAASC,OAAO,QAAQ,sBAAsB;AAE9C,OAAO,MAAMC,yBAAyB,
|
|
1
|
+
{"version":3,"names":["forwardEvent","init","screen","boot","NativePluginEngagementReactNative","Logger","version","AmplitudeEngagementPlugin","name","type","logger","SDK_LIBRARY","SDK_VERSION","trackEventSubscription","setup","config","client","log","apiKey","error","user_id","device_id","remove","onTrackEvent","event","eventProperties","event_properties","track","event_type","execute","context","JSON","stringify","screenName"],"sourceRoot":"../../src","sources":["AmplitudeEngagementPlugin.ts"],"mappings":";;AAMA,SAASA,YAAY,EAAEC,IAAI,EAAEC,MAAM,EAAEC,IAAI,QAAQ,YAAG;AACpD,OAAOC,iCAAiC,MAAM,wCAAqC;AAEnF,SAASC,MAAM,QAA8B,aAAU;AAEvD,SAASC,OAAO,QAAQ,sBAAsB;AAE9C,OAAO,MAAMC,yBAAyB,CAEtC;EACEC,IAAI,GAAG,2BAA2B;EAClCC,IAAI,GAAG,YAAY;EASnBC,MAAM,GAAoB,IAAIL,MAAM,CAAC,2BAA2B,CAAC;;EAEjE;EACA,OAAwBM,WAAW,GAAG,mCAAmC;EACzE,OAAwBC,WAAW,GAAGN,OAAO;EAE7CO,sBAAsB,GAA6B,IAAI;EAEvD,MAAMC,KAAKA,CACTC,MAAyB,EACzBC,MAAyB,EACV;IACf,IAAI;MACF,IAAI,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,CACzC,yBAAyB,CAChB;MACXxB,MAAM,CAAC+B,UAAU,CAAC;IACpB;IAEAjC,YAAY,CAAC8B,OAAO,CAAC;IAErB,OAAOA,OAAO;EAChB;AACF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"1.
|
|
1
|
+
{"version":"1.8.0"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { EnrichmentPlugin, Event,
|
|
1
|
+
import type { EnrichmentPlugin, Event, ReactNativeClient, ReactNativeConfig } from '@amplitude/analytics-core';
|
|
2
2
|
import { type AmplitudeLogger } from './logger';
|
|
3
3
|
import type { EventSubscription } from 'react-native';
|
|
4
|
-
export declare class AmplitudeEngagementPlugin implements EnrichmentPlugin<
|
|
4
|
+
export declare class AmplitudeEngagementPlugin implements EnrichmentPlugin<ReactNativeClient, ReactNativeConfig> {
|
|
5
5
|
name: string;
|
|
6
6
|
type: "enrichment";
|
|
7
|
-
client?:
|
|
7
|
+
client?: ReactNativeClient;
|
|
8
8
|
userId?: string;
|
|
9
9
|
deviceId?: string;
|
|
10
10
|
sessionId?: number;
|
|
@@ -13,7 +13,7 @@ export declare class AmplitudeEngagementPlugin implements EnrichmentPlugin<Analy
|
|
|
13
13
|
private static readonly SDK_LIBRARY;
|
|
14
14
|
private static readonly SDK_VERSION;
|
|
15
15
|
trackEventSubscription: EventSubscription | null;
|
|
16
|
-
setup(config:
|
|
16
|
+
setup(config: ReactNativeConfig, client: ReactNativeClient): Promise<void>;
|
|
17
17
|
boot(user_id?: string, device_id?: string): void;
|
|
18
18
|
execute(context: Event): Promise<Event | null>;
|
|
19
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AmplitudeEngagementPlugin.d.ts","sourceRoot":"","sources":["../../../src/AmplitudeEngagementPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,KAAK,EACL,
|
|
1
|
+
{"version":3,"file":"AmplitudeEngagementPlugin.d.ts","sourceRoot":"","sources":["../../../src/AmplitudeEngagementPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,KAAK,EACL,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,2BAA2B,CAAC;AAInC,OAAO,EAAU,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAGtD,qBAAa,yBACX,YAAW,gBAAgB,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAEjE,IAAI,SAA+B;IACnC,IAAI,EAAG,YAAY,CAAU;IAE7B,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAE3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAErC,MAAM,EAAE,eAAe,CAA2C;IAGlE,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAuC;IAC1E,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAW;IAE9C,sBAAsB,EAAE,iBAAiB,GAAG,IAAI,CAAQ;IAElD,KAAK,CACT,MAAM,EAAE,iBAAiB,EACzB,MAAM,EAAE,iBAAiB,GACxB,OAAO,CAAC,IAAI,CAAC;IAmBhB,IAAI,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI;IAuB1C,OAAO,CAAC,OAAO,EAAE,KAAK,GAAG,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;CAmBrD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amplitude/plugin-engagement-react-native",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"description": "Amplitude Engagement plugin for React Native",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|
|
@@ -96,6 +96,10 @@
|
|
|
96
96
|
"<rootDir>/testproject/node_modules",
|
|
97
97
|
"<rootDir>/example/node_modules",
|
|
98
98
|
"<rootDir>/lib/"
|
|
99
|
+
],
|
|
100
|
+
"testPathIgnorePatterns": [
|
|
101
|
+
"<rootDir>/testproject/.*\\.test\\.[jt]sx?$",
|
|
102
|
+
"<rootDir>/testproject/.*\\.spec\\.[jt]sx?$"
|
|
99
103
|
]
|
|
100
104
|
},
|
|
101
105
|
"commitlint": {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
EnrichmentPlugin,
|
|
3
3
|
Event,
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
ReactNativeClient,
|
|
5
|
+
ReactNativeConfig,
|
|
6
6
|
} from '@amplitude/analytics-core';
|
|
7
7
|
import { forwardEvent, init, screen, boot } from '.';
|
|
8
8
|
import NativePluginEngagementReactNative from './NativePluginEngagementReactNative';
|
|
@@ -11,11 +11,13 @@ import { Logger, type AmplitudeLogger } from './logger';
|
|
|
11
11
|
import type { EventSubscription } from 'react-native';
|
|
12
12
|
import { version } from './build-version.json';
|
|
13
13
|
|
|
14
|
-
export class AmplitudeEngagementPlugin
|
|
14
|
+
export class AmplitudeEngagementPlugin
|
|
15
|
+
implements EnrichmentPlugin<ReactNativeClient, ReactNativeConfig>
|
|
16
|
+
{
|
|
15
17
|
name = 'AmplitudeEngagementPlugin';
|
|
16
18
|
type = 'enrichment' as const;
|
|
17
19
|
|
|
18
|
-
client?:
|
|
20
|
+
client?: ReactNativeClient;
|
|
19
21
|
|
|
20
22
|
userId?: string;
|
|
21
23
|
deviceId?: string;
|
|
@@ -30,7 +32,10 @@ export class AmplitudeEngagementPlugin implements EnrichmentPlugin<AnalyticsClie
|
|
|
30
32
|
|
|
31
33
|
trackEventSubscription: EventSubscription | null = null;
|
|
32
34
|
|
|
33
|
-
async setup(
|
|
35
|
+
async setup(
|
|
36
|
+
config: ReactNativeConfig,
|
|
37
|
+
client: ReactNativeClient
|
|
38
|
+
): Promise<void> {
|
|
34
39
|
try {
|
|
35
40
|
this.logger.log('initializing with apiKey', config.apiKey);
|
|
36
41
|
init(config.apiKey);
|