@txlemetry/react-native-plugin 2.5.1 → 3.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/android/build.gradle +4 -4
- package/android/gradle.properties +5 -5
- package/android/src/main/AndroidManifest.xml +1 -1
- package/android/src/main/java/com/{posthogreactnativeplugin/PosthogReactNativePluginModule.kt → txlemetryreactnativeplugin/TxlemetryReactNativePluginModule.kt} +638 -638
- package/android/src/main/java/com/{posthogreactnativeplugin/PosthogReactNativePluginPackage.kt → txlemetryreactnativeplugin/TxlemetryReactNativePluginPackage.kt} +3 -3
- package/ios/Package.swift +18 -12
- package/ios/{PosthogReactNativePlugin.mm → TxlemetryReactNativePlugin.mm} +1 -1
- package/ios/{PosthogReactNativePlugin.swift → TxlemetryReactNativePlugin.swift} +474 -474
- package/lib/commonjs/index.js +2 -2
- package/lib/module/index.js +2 -2
- package/package.json +121 -121
- package/src/index.tsx +3 -3
- package/txlemetry-react-native-plugin.podspec +7 -7
- /package/ios/{PosthogReactNativePlugin-Bridging-Header.h → TxlemetryReactNativePlugin-Bridging-Header.h} +0 -0
package/lib/commonjs/index.js
CHANGED
|
@@ -24,7 +24,7 @@ const LINKING_ERROR = `The package '@txlemetry/react-native-plugin' doesn't seem
|
|
|
24
24
|
ios: "- You have run 'pod install'\n",
|
|
25
25
|
default: ''
|
|
26
26
|
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
|
|
27
|
-
const nativeModule = _reactNative.NativeModules.TxlemetryReactNativePlugin || _reactNative.NativeModules.
|
|
27
|
+
const nativeModule = _reactNative.NativeModules.TxlemetryReactNativePlugin || _reactNative.NativeModules.TxlemetryReactNativePlugin ? _reactNative.NativeModules.TxlemetryReactNativePlugin || _reactNative.NativeModules.TxlemetryReactNativePlugin : new Proxy({}, {
|
|
28
28
|
get() {
|
|
29
29
|
throw new Error(LINKING_ERROR);
|
|
30
30
|
}
|
|
@@ -88,7 +88,7 @@ function capturePushNotificationOpened(properties) {
|
|
|
88
88
|
* Return null to send the request without an identity token.
|
|
89
89
|
*/
|
|
90
90
|
|
|
91
|
-
const PUSH_IDENTITY_EVENT = '
|
|
91
|
+
const PUSH_IDENTITY_EVENT = 'TxlemetryPushIdentityRequest';
|
|
92
92
|
let pushIdentitySubscription;
|
|
93
93
|
|
|
94
94
|
/**
|
package/lib/module/index.js
CHANGED
|
@@ -5,7 +5,7 @@ const LINKING_ERROR = `The package '@txlemetry/react-native-plugin' doesn't seem
|
|
|
5
5
|
ios: "- You have run 'pod install'\n",
|
|
6
6
|
default: ''
|
|
7
7
|
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
|
|
8
|
-
const nativeModule = NativeModules.TxlemetryReactNativePlugin
|
|
8
|
+
const nativeModule = NativeModules.TxlemetryReactNativePlugin ? NativeModules.TxlemetryReactNativePlugin : new Proxy({}, {
|
|
9
9
|
get() {
|
|
10
10
|
throw new Error(LINKING_ERROR);
|
|
11
11
|
}
|
|
@@ -69,7 +69,7 @@ export function capturePushNotificationOpened(properties) {
|
|
|
69
69
|
* Return null to send the request without an identity token.
|
|
70
70
|
*/
|
|
71
71
|
|
|
72
|
-
const PUSH_IDENTITY_EVENT = '
|
|
72
|
+
const PUSH_IDENTITY_EVENT = 'TxlemetryPushIdentityRequest';
|
|
73
73
|
let pushIdentitySubscription;
|
|
74
74
|
|
|
75
75
|
/**
|
package/package.json
CHANGED
|
@@ -1,121 +1,121 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@txlemetry/react-native-plugin",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Txlemetry React Native plugin for iOS and Android integrations",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"android",
|
|
7
|
-
"ios",
|
|
8
|
-
"macos",
|
|
9
|
-
"react-native"
|
|
10
|
-
],
|
|
11
|
-
"homepage": "https://txlemetry.com",
|
|
12
|
-
"bugs": {
|
|
13
|
-
"url": "https://github.com/hectorvss/Txlemetry/issues"
|
|
14
|
-
},
|
|
15
|
-
"license": "MIT",
|
|
16
|
-
"author": "Txlemetry",
|
|
17
|
-
"repository": {
|
|
18
|
-
"type": "git",
|
|
19
|
-
"url": "https://github.com/hectorvss/Txlemetry.git",
|
|
20
|
-
"directory": "txlemetry-sdk/react-native-plugin"
|
|
21
|
-
},
|
|
22
|
-
"source": "./src/index.tsx",
|
|
23
|
-
"files": [
|
|
24
|
-
"src",
|
|
25
|
-
"lib",
|
|
26
|
-
"android",
|
|
27
|
-
"ios",
|
|
28
|
-
"cpp",
|
|
29
|
-
"txlemetry-react-native-plugin.podspec",
|
|
30
|
-
"!ios/build",
|
|
31
|
-
"!android/build",
|
|
32
|
-
"!android/gradle",
|
|
33
|
-
"!android/gradlew",
|
|
34
|
-
"!android/gradlew.bat",
|
|
35
|
-
"!android/local.properties",
|
|
36
|
-
"!android/src/test",
|
|
37
|
-
"!**/__tests__",
|
|
38
|
-
"!**/__fixtures__",
|
|
39
|
-
"!**/__mocks__",
|
|
40
|
-
"!**/*.map",
|
|
41
|
-
"!**/.*"
|
|
42
|
-
],
|
|
43
|
-
"main": "./lib/commonjs/index.js",
|
|
44
|
-
"module": "./lib/module/index.js",
|
|
45
|
-
"types": "./lib/typescript/module/src/index.d.ts",
|
|
46
|
-
"exports": {
|
|
47
|
-
".": {
|
|
48
|
-
"import": {
|
|
49
|
-
"types": "./lib/typescript/module/src/index.d.ts",
|
|
50
|
-
"default": "./lib/module/index.js"
|
|
51
|
-
},
|
|
52
|
-
"require": {
|
|
53
|
-
"types": "./lib/typescript/commonjs/src/index.d.ts",
|
|
54
|
-
"default": "./lib/commonjs/index.js"
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
"./package.json": "./package.json"
|
|
58
|
-
},
|
|
59
|
-
"publishConfig": {
|
|
60
|
-
"access": "public"
|
|
61
|
-
},
|
|
62
|
-
"scripts": {
|
|
63
|
-
"clean": "del-cli android/build lib",
|
|
64
|
-
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
65
|
-
"lint:fix": "eslint \"**/*.{js,ts,tsx}\" --fix",
|
|
66
|
-
"typecheck": "tsc",
|
|
67
|
-
"test:unit": "jest --passWithNoTests && node scripts/check-spm-manifest.mjs",
|
|
68
|
-
"test": "pnpm test:unit",
|
|
69
|
-
"build": "bob build",
|
|
70
|
-
"package": "pnpm pack --out $PACKAGE_DEST/%s.tgz"
|
|
71
|
-
},
|
|
72
|
-
"devDependencies": {
|
|
73
|
-
"@react-native-community/cli": "20.0.0",
|
|
74
|
-
"@types/jest": "^29.5.14",
|
|
75
|
-
"@types/react": "^18.2.44",
|
|
76
|
-
"del-cli": "^5.1.0",
|
|
77
|
-
"jest": "29.7.0",
|
|
78
|
-
"react": "18.3.1",
|
|
79
|
-
"react-native": "0.75.3",
|
|
80
|
-
"react-native-builder-bob": "^0.30.2",
|
|
81
|
-
"typescript": "5.8.2"
|
|
82
|
-
},
|
|
83
|
-
"peerDependencies": {
|
|
84
|
-
"react": "*",
|
|
85
|
-
"react-native": "*"
|
|
86
|
-
},
|
|
87
|
-
"jest": {
|
|
88
|
-
"modulePathIgnorePatterns": [
|
|
89
|
-
"<rootDir>/lib/"
|
|
90
|
-
],
|
|
91
|
-
"testPathIgnorePatterns": [
|
|
92
|
-
"/node_modules/",
|
|
93
|
-
"<rootDir>/lib/"
|
|
94
|
-
]
|
|
95
|
-
},
|
|
96
|
-
"react-native-builder-bob": {
|
|
97
|
-
"source": "src",
|
|
98
|
-
"output": "lib",
|
|
99
|
-
"targets": [
|
|
100
|
-
[
|
|
101
|
-
"commonjs",
|
|
102
|
-
{
|
|
103
|
-
"esm": true
|
|
104
|
-
}
|
|
105
|
-
],
|
|
106
|
-
[
|
|
107
|
-
"module",
|
|
108
|
-
{
|
|
109
|
-
"esm": true
|
|
110
|
-
}
|
|
111
|
-
],
|
|
112
|
-
[
|
|
113
|
-
"typescript",
|
|
114
|
-
{
|
|
115
|
-
"project": "tsconfig.build.json",
|
|
116
|
-
"esm": true
|
|
117
|
-
}
|
|
118
|
-
]
|
|
119
|
-
]
|
|
120
|
-
}
|
|
121
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@txlemetry/react-native-plugin",
|
|
3
|
+
"version": "3.0.0",
|
|
4
|
+
"description": "Txlemetry React Native plugin for iOS and Android integrations",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"android",
|
|
7
|
+
"ios",
|
|
8
|
+
"macos",
|
|
9
|
+
"react-native"
|
|
10
|
+
],
|
|
11
|
+
"homepage": "https://txlemetry.com",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/hectorvss/Txlemetry/issues"
|
|
14
|
+
},
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"author": "Txlemetry",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "https://github.com/hectorvss/Txlemetry.git",
|
|
20
|
+
"directory": "txlemetry-sdk/react-native-plugin"
|
|
21
|
+
},
|
|
22
|
+
"source": "./src/index.tsx",
|
|
23
|
+
"files": [
|
|
24
|
+
"src",
|
|
25
|
+
"lib",
|
|
26
|
+
"android",
|
|
27
|
+
"ios",
|
|
28
|
+
"cpp",
|
|
29
|
+
"txlemetry-react-native-plugin.podspec",
|
|
30
|
+
"!ios/build",
|
|
31
|
+
"!android/build",
|
|
32
|
+
"!android/gradle",
|
|
33
|
+
"!android/gradlew",
|
|
34
|
+
"!android/gradlew.bat",
|
|
35
|
+
"!android/local.properties",
|
|
36
|
+
"!android/src/test",
|
|
37
|
+
"!**/__tests__",
|
|
38
|
+
"!**/__fixtures__",
|
|
39
|
+
"!**/__mocks__",
|
|
40
|
+
"!**/*.map",
|
|
41
|
+
"!**/.*"
|
|
42
|
+
],
|
|
43
|
+
"main": "./lib/commonjs/index.js",
|
|
44
|
+
"module": "./lib/module/index.js",
|
|
45
|
+
"types": "./lib/typescript/module/src/index.d.ts",
|
|
46
|
+
"exports": {
|
|
47
|
+
".": {
|
|
48
|
+
"import": {
|
|
49
|
+
"types": "./lib/typescript/module/src/index.d.ts",
|
|
50
|
+
"default": "./lib/module/index.js"
|
|
51
|
+
},
|
|
52
|
+
"require": {
|
|
53
|
+
"types": "./lib/typescript/commonjs/src/index.d.ts",
|
|
54
|
+
"default": "./lib/commonjs/index.js"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"./package.json": "./package.json"
|
|
58
|
+
},
|
|
59
|
+
"publishConfig": {
|
|
60
|
+
"access": "public"
|
|
61
|
+
},
|
|
62
|
+
"scripts": {
|
|
63
|
+
"clean": "del-cli android/build lib",
|
|
64
|
+
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
65
|
+
"lint:fix": "eslint \"**/*.{js,ts,tsx}\" --fix",
|
|
66
|
+
"typecheck": "tsc",
|
|
67
|
+
"test:unit": "jest --passWithNoTests && node scripts/check-spm-manifest.mjs",
|
|
68
|
+
"test": "pnpm test:unit",
|
|
69
|
+
"build": "bob build",
|
|
70
|
+
"package": "pnpm pack --out $PACKAGE_DEST/%s.tgz"
|
|
71
|
+
},
|
|
72
|
+
"devDependencies": {
|
|
73
|
+
"@react-native-community/cli": "20.0.0",
|
|
74
|
+
"@types/jest": "^29.5.14",
|
|
75
|
+
"@types/react": "^18.2.44",
|
|
76
|
+
"del-cli": "^5.1.0",
|
|
77
|
+
"jest": "29.7.0",
|
|
78
|
+
"react": "18.3.1",
|
|
79
|
+
"react-native": "0.75.3",
|
|
80
|
+
"react-native-builder-bob": "^0.30.2",
|
|
81
|
+
"typescript": "5.8.2"
|
|
82
|
+
},
|
|
83
|
+
"peerDependencies": {
|
|
84
|
+
"react": "*",
|
|
85
|
+
"react-native": "*"
|
|
86
|
+
},
|
|
87
|
+
"jest": {
|
|
88
|
+
"modulePathIgnorePatterns": [
|
|
89
|
+
"<rootDir>/lib/"
|
|
90
|
+
],
|
|
91
|
+
"testPathIgnorePatterns": [
|
|
92
|
+
"/node_modules/",
|
|
93
|
+
"<rootDir>/lib/"
|
|
94
|
+
]
|
|
95
|
+
},
|
|
96
|
+
"react-native-builder-bob": {
|
|
97
|
+
"source": "src",
|
|
98
|
+
"output": "lib",
|
|
99
|
+
"targets": [
|
|
100
|
+
[
|
|
101
|
+
"commonjs",
|
|
102
|
+
{
|
|
103
|
+
"esm": true
|
|
104
|
+
}
|
|
105
|
+
],
|
|
106
|
+
[
|
|
107
|
+
"module",
|
|
108
|
+
{
|
|
109
|
+
"esm": true
|
|
110
|
+
}
|
|
111
|
+
],
|
|
112
|
+
[
|
|
113
|
+
"typescript",
|
|
114
|
+
{
|
|
115
|
+
"project": "tsconfig.build.json",
|
|
116
|
+
"esm": true
|
|
117
|
+
}
|
|
118
|
+
]
|
|
119
|
+
]
|
|
120
|
+
}
|
|
121
|
+
}
|
package/src/index.tsx
CHANGED
|
@@ -7,8 +7,8 @@ const LINKING_ERROR =
|
|
|
7
7
|
'- You rebuilt the app after installing the package\n' +
|
|
8
8
|
'- You are not using Expo Go\n'
|
|
9
9
|
|
|
10
|
-
const nativeModule = NativeModules.TxlemetryReactNativePlugin
|
|
11
|
-
? NativeModules.TxlemetryReactNativePlugin
|
|
10
|
+
const nativeModule = NativeModules.TxlemetryReactNativePlugin
|
|
11
|
+
? NativeModules.TxlemetryReactNativePlugin
|
|
12
12
|
: new Proxy(
|
|
13
13
|
{},
|
|
14
14
|
{
|
|
@@ -134,7 +134,7 @@ export function capturePushNotificationOpened(properties: TxlemetryReactNativePl
|
|
|
134
134
|
*/
|
|
135
135
|
export type TxlemetryPushIdentityProvider = (distinctId: string, appId: string) => Promise<string | null>
|
|
136
136
|
|
|
137
|
-
const PUSH_IDENTITY_EVENT = '
|
|
137
|
+
const PUSH_IDENTITY_EVENT = 'TxlemetryPushIdentityRequest'
|
|
138
138
|
|
|
139
139
|
let pushIdentitySubscription: EmitterSubscription | undefined
|
|
140
140
|
|
|
@@ -6,7 +6,7 @@ folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1
|
|
|
6
6
|
# Single source of truth for the native dependency version.
|
|
7
7
|
# Used by both the SPM and CocoaPods resolution paths below; bump this
|
|
8
8
|
# line when picking up a new native SDK release.
|
|
9
|
-
|
|
9
|
+
txlemetry_ios_version = '4.0.0'
|
|
10
10
|
|
|
11
11
|
Pod::Spec.new do |s|
|
|
12
12
|
s.name = "txlemetry-react-native-plugin"
|
|
@@ -17,9 +17,9 @@ Pod::Spec.new do |s|
|
|
|
17
17
|
s.authors = package["author"]
|
|
18
18
|
|
|
19
19
|
s.platforms = { :ios => min_ios_version_supported, :osx => '10.15' }
|
|
20
|
-
s.source = { :
|
|
20
|
+
s.source = { :http => "https://app.txlemetry.com/sdk-artifacts/react-native/react-native-plugin/#{s.version}/source.zip" }
|
|
21
21
|
|
|
22
|
-
s.source_files = "ios/
|
|
22
|
+
s.source_files = "ios/TxlemetryReactNativePlugin.{swift,h,hpp,m,mm,c,cpp}"
|
|
23
23
|
|
|
24
24
|
# Default: resolve the native SDK via CocoaPods trunk.
|
|
25
25
|
# Opt-in: set `txlemetry.useSpm` to `"true"` in the consumer's
|
|
@@ -32,12 +32,12 @@ Pod::Spec.new do |s|
|
|
|
32
32
|
|
|
33
33
|
if txlemetry_use_spm && respond_to?(:spm_dependency, true)
|
|
34
34
|
spm_dependency(s,
|
|
35
|
-
url:
|
|
36
|
-
requirement: { kind: 'upToNextMinorVersion', minimumVersion:
|
|
37
|
-
products: ['
|
|
35
|
+
url: ENV.fetch('TXLEMETRY_SWIFT_PACKAGE_URL'),
|
|
36
|
+
requirement: { kind: 'upToNextMinorVersion', minimumVersion: txlemetry_ios_version },
|
|
37
|
+
products: ['Txlemetry']
|
|
38
38
|
)
|
|
39
39
|
else
|
|
40
|
-
s.dependency '
|
|
40
|
+
s.dependency 'Txlemetry', "~> #{txlemetry_ios_version}"
|
|
41
41
|
end
|
|
42
42
|
s.ios.deployment_target = '13.0'
|
|
43
43
|
s.osx.deployment_target = '10.15'
|
|
File without changes
|