@posthog/react-native-plugin 2.5.2 → 2.6.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
CHANGED
|
@@ -217,6 +217,70 @@ limitations under the License.
|
|
|
217
217
|
limitations under the License.
|
|
218
218
|
|
|
219
219
|
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
The @posthog/core package in packages/core is licensed under the MIT License below.
|
|
223
|
+
Third-party code remains subject to its respective notices in this file.
|
|
224
|
+
This owning notice is preserved from posthog-js-lite, from which @posthog/core was migrated:
|
|
225
|
+
https://github.com/PostHog/posthog-js-lite/blob/5fb7bee96f739b243dfea5589e2027f16629e8cd/LICENSE
|
|
226
|
+
|
|
227
|
+
MIT License
|
|
228
|
+
|
|
229
|
+
Copyright (c) 2022 PostHog (part of Hiberly Inc)
|
|
230
|
+
|
|
231
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
232
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
233
|
+
in the Software without restriction, including without limitation the rights
|
|
234
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
235
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
236
|
+
furnished to do so, subject to the following conditions:
|
|
237
|
+
|
|
238
|
+
The above copyright notice and this permission notice shall be included in all
|
|
239
|
+
copies or substantial portions of the Software.
|
|
240
|
+
|
|
241
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
242
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
243
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
244
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
245
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
246
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
247
|
+
SOFTWARE.
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
packages/core/src/error-tracking/parsers/index.ts and its compiled distributions contain code
|
|
252
|
+
derived from TraceKit. This license only applies to the relevant code.
|
|
253
|
+
|
|
254
|
+
MIT License
|
|
255
|
+
|
|
256
|
+
Copyright (c) 2013 Onur Can Cakmak onur.cakmak@gmail.com and all TraceKit contributors.
|
|
257
|
+
|
|
258
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
|
259
|
+
software and associated documentation files(the 'Software'), to deal in the Software
|
|
260
|
+
without restriction, including without limitation the rights to use, copy, modify,
|
|
261
|
+
merge, publish, distribute, sublicense, and / or sell copies of the Software, and to
|
|
262
|
+
permit persons to whom the Software is furnished to do so, subject to the following
|
|
263
|
+
conditions:
|
|
264
|
+
|
|
265
|
+
The above copyright notice and this permission notice shall be included in all copies
|
|
266
|
+
or substantial portions of the Software.
|
|
267
|
+
|
|
268
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
|
269
|
+
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
|
270
|
+
PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
271
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
|
272
|
+
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
|
273
|
+
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
packages/core/src/vendor/uuidv7.ts and its compiled distributions contain code from uuidv7:
|
|
278
|
+
https://github.com/LiosK/uuidv7/blob/f30b7a7faff73afbce0b27a46c638310f96912ba/src/index.ts
|
|
279
|
+
|
|
280
|
+
Copyright 2021-2023 LiosK
|
|
281
|
+
|
|
282
|
+
This code is licensed under the Apache License, Version 2.0, reproduced above.
|
|
283
|
+
|
|
220
284
|
---
|
|
221
285
|
|
|
222
286
|
Some files in this codebase contain code from getsentry/sentry-javascript.
|
package/android/build.gradle
CHANGED
|
@@ -91,7 +91,7 @@ dependencies {
|
|
|
91
91
|
//noinspection GradleDynamicVersion
|
|
92
92
|
implementation "com.facebook.react:react-native:+"
|
|
93
93
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
94
|
-
implementation "com.posthog:posthog-android:3.
|
|
94
|
+
implementation "com.posthog:posthog-android:3.62.0"
|
|
95
95
|
|
|
96
96
|
testImplementation "junit:junit:4.13.2"
|
|
97
97
|
}
|
package/android/src/main/java/com/posthogreactnativeplugin/PosthogReactNativePluginModule.kt
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
package com.posthogreactnativeplugin
|
|
2
2
|
|
|
3
|
+
import android.app.Activity
|
|
3
4
|
import android.content.Intent
|
|
4
5
|
import android.util.Log
|
|
6
|
+
import com.facebook.react.bridge.ActivityEventListener
|
|
5
7
|
import com.facebook.react.bridge.Arguments
|
|
6
8
|
import com.facebook.react.bridge.Promise
|
|
7
9
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
@@ -23,9 +25,30 @@ import java.util.UUID
|
|
|
23
25
|
|
|
24
26
|
class PosthogReactNativePluginModule(
|
|
25
27
|
reactContext: ReactApplicationContext,
|
|
26
|
-
) : ReactContextBaseJavaModule(reactContext)
|
|
28
|
+
) : ReactContextBaseJavaModule(reactContext),
|
|
29
|
+
ActivityEventListener {
|
|
27
30
|
override fun getName(): String = NAME
|
|
28
31
|
|
|
32
|
+
override fun initialize() {
|
|
33
|
+
super.initialize()
|
|
34
|
+
// ReactActivity forwards onNewIntent to its listeners, so unlike a plain Android host the
|
|
35
|
+
// app needs no code of its own for warm-start taps.
|
|
36
|
+
reactApplicationContext.addActivityEventListener(this)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
override fun onActivityResult(
|
|
40
|
+
activity: Activity,
|
|
41
|
+
requestCode: Int,
|
|
42
|
+
resultCode: Int,
|
|
43
|
+
data: Intent?,
|
|
44
|
+
) = Unit
|
|
45
|
+
|
|
46
|
+
// A tap delivered while the process is alive never reaches onActivityCreated, so the native
|
|
47
|
+
// integration cannot see it. Deduplicated by message id against the cold-start path.
|
|
48
|
+
override fun onNewIntent(intent: Intent) {
|
|
49
|
+
PostHogAndroid.capturePushNotificationOpened(intent)
|
|
50
|
+
}
|
|
51
|
+
|
|
29
52
|
@ReactMethod
|
|
30
53
|
fun setup(
|
|
31
54
|
sessionId: String,
|
|
@@ -527,6 +550,7 @@ class PosthogReactNativePluginModule(
|
|
|
527
550
|
fun removeListeners(count: Int) = Unit
|
|
528
551
|
|
|
529
552
|
override fun invalidate() {
|
|
553
|
+
reactApplicationContext.removeActivityEventListener(this)
|
|
530
554
|
if (pushModule === this) {
|
|
531
555
|
// Decline mints fast after teardown instead of stalling the native 10s watchdog.
|
|
532
556
|
pushModule = null
|