@amplitude/analytics-react-native 1.10.2 → 1.11.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/lib/commonjs/amp-capture.js +10 -1
- package/lib/commonjs/amp-capture.js.map +1 -1
- package/lib/commonjs/autocapture/element-interaction.js +22 -0
- package/lib/commonjs/autocapture/element-interaction.js.map +1 -0
- package/lib/commonjs/autocapture/rage-click.js +141 -0
- package/lib/commonjs/autocapture/rage-click.js.map +1 -0
- package/lib/commonjs/config/joined-config.js +1 -0
- package/lib/commonjs/config/joined-config.js.map +1 -1
- package/lib/commonjs/constants.js +2 -1
- package/lib/commonjs/constants.js.map +1 -1
- package/lib/commonjs/plugins/frustration-plugin.js +67 -0
- package/lib/commonjs/plugins/frustration-plugin.js.map +1 -0
- package/lib/commonjs/react-native-client.js +27 -23
- package/lib/commonjs/react-native-client.js.map +1 -1
- package/lib/commonjs/version.js +1 -1
- package/lib/module/amp-capture.js +10 -1
- package/lib/module/amp-capture.js.map +1 -1
- package/lib/module/autocapture/element-interaction.js +17 -0
- package/lib/module/autocapture/element-interaction.js.map +1 -0
- package/lib/module/autocapture/rage-click.js +133 -0
- package/lib/module/autocapture/rage-click.js.map +1 -0
- package/lib/module/config/joined-config.js +1 -0
- package/lib/module/config/joined-config.js.map +1 -1
- package/lib/module/constants.js +1 -0
- package/lib/module/constants.js.map +1 -1
- package/lib/module/plugins/frustration-plugin.js +59 -0
- package/lib/module/plugins/frustration-plugin.js.map +1 -0
- package/lib/module/react-native-client.js +28 -24
- package/lib/module/react-native-client.js.map +1 -1
- package/lib/module/version.js +1 -1
- package/lib/typescript/amp-capture.d.ts +7 -1
- package/lib/typescript/amp-capture.d.ts.map +1 -1
- package/lib/typescript/autocapture/element-interaction.d.ts +7 -0
- package/lib/typescript/autocapture/element-interaction.d.ts.map +1 -0
- package/lib/typescript/autocapture/rage-click.d.ts +30 -0
- package/lib/typescript/autocapture/rage-click.d.ts.map +1 -0
- package/lib/typescript/config/joined-config.d.ts.map +1 -1
- package/lib/typescript/constants.d.ts +1 -0
- package/lib/typescript/constants.d.ts.map +1 -1
- package/lib/typescript/plugins/frustration-plugin.d.ts +17 -0
- package/lib/typescript/plugins/frustration-plugin.d.ts.map +1 -0
- package/lib/typescript/react-native-client.d.ts.map +1 -1
- package/lib/typescript/version.d.ts +1 -1
- package/package.json +3 -3
- package/src/amp-capture.ts +13 -3
- package/src/autocapture/element-interaction.ts +27 -0
- package/src/autocapture/rage-click.ts +172 -0
- package/src/config/joined-config.ts +1 -0
- package/src/constants.ts +1 -0
- package/src/plugins/frustration-plugin.ts +80 -0
- package/src/react-native-client.ts +19 -14
- package/src/version.ts +1 -1
|
@@ -41,6 +41,7 @@ import { plugin as networkCapturePlugin } from '@amplitude/plugin-network-captur
|
|
|
41
41
|
import { CampaignTracker } from './campaign/campaign-tracker';
|
|
42
42
|
import { Context } from './plugins/context';
|
|
43
43
|
import { networkConnectivityCheckerPlugin } from './plugins/network-connectivity-checker';
|
|
44
|
+
import { frustrationPlugin } from './plugins/frustration-plugin';
|
|
44
45
|
import { ReactNativeDiagnosticsStorage } from './diagnostics/diagnostics-storage';
|
|
45
46
|
import { LIBPREFIX } from './lib-prefix';
|
|
46
47
|
import { VERSION } from './version';
|
|
@@ -50,6 +51,7 @@ import { parseOldCookies } from './cookie-migration';
|
|
|
50
51
|
import { isNative } from './utils/platform';
|
|
51
52
|
import { RemoteConfigCustomStorage } from './remote-config/remote-config-customstorage';
|
|
52
53
|
import * as Capture from './amp-capture';
|
|
54
|
+
import { getElementInteractionEventProperties } from './autocapture/element-interaction';
|
|
53
55
|
import {
|
|
54
56
|
APP_BUILD,
|
|
55
57
|
APP_VERSION,
|
|
@@ -64,11 +66,6 @@ import {
|
|
|
64
66
|
PREVIOUS_BUILD,
|
|
65
67
|
PREVIOUS_VERSION,
|
|
66
68
|
SCREEN_NAME,
|
|
67
|
-
TARGET_ACCESSIBILITY_LABEL,
|
|
68
|
-
TARGET_ACTION,
|
|
69
|
-
TARGET_COMPONENT,
|
|
70
|
-
TARGET_ELEMENT,
|
|
71
|
-
TARGET_TEST_ID,
|
|
72
69
|
} from './constants';
|
|
73
70
|
|
|
74
71
|
/**
|
|
@@ -300,6 +297,7 @@ export class AmplitudeReactNative extends AmplitudeCore implements ReactNativeCl
|
|
|
300
297
|
screenViews: true,
|
|
301
298
|
elementInteractions: true,
|
|
302
299
|
networkTracking: true,
|
|
300
|
+
frustrationInteractions: true,
|
|
303
301
|
};
|
|
304
302
|
} else if (autocaptureConfig && typeof autocaptureConfig === 'object') {
|
|
305
303
|
this.autocapture = autocaptureConfig;
|
|
@@ -342,17 +340,23 @@ export class AmplitudeReactNative extends AmplitudeCore implements ReactNativeCl
|
|
|
342
340
|
await this.add(networkCapturePlugin(getNetworkTrackingConfig(this.config))).promise;
|
|
343
341
|
}
|
|
344
342
|
|
|
343
|
+
const frustrationInteractions = this.autocapture?.frustrationInteractions;
|
|
344
|
+
if (frustrationInteractions) {
|
|
345
|
+
this.config.loggerProvider.debug('Adding frustration interactions plugin');
|
|
346
|
+
await this.add(
|
|
347
|
+
frustrationPlugin({
|
|
348
|
+
...(typeof frustrationInteractions === 'object' ? frustrationInteractions : {}),
|
|
349
|
+
getScreenName: () => this.currentScreenName,
|
|
350
|
+
}),
|
|
351
|
+
).promise;
|
|
352
|
+
}
|
|
353
|
+
|
|
345
354
|
if (this.autocapture?.elementInteractions === true) {
|
|
346
355
|
this.captureUnsubscribe = Capture.subscribe((properties) => {
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
[TARGET_COMPONENT]: properties.component,
|
|
352
|
-
[TARGET_ELEMENT]: properties.element,
|
|
353
|
-
[TARGET_TEST_ID]: properties.testID,
|
|
354
|
-
};
|
|
355
|
-
this.track(DEFAULT_ELEMENT_INTERACTED_EVENT, analyticsProps);
|
|
356
|
+
this.track(
|
|
357
|
+
DEFAULT_ELEMENT_INTERACTED_EVENT,
|
|
358
|
+
getElementInteractionEventProperties(properties, this.currentScreenName),
|
|
359
|
+
);
|
|
356
360
|
});
|
|
357
361
|
}
|
|
358
362
|
|
|
@@ -396,6 +400,7 @@ export class AmplitudeReactNative extends AmplitudeCore implements ReactNativeCl
|
|
|
396
400
|
shutdown() {
|
|
397
401
|
this.appStateChangeHandler?.remove();
|
|
398
402
|
this.captureUnsubscribe?.();
|
|
403
|
+
this.timeline.reset(this);
|
|
399
404
|
}
|
|
400
405
|
|
|
401
406
|
async runAttributionStrategy(attributionConfig?: AttributionOptions, isNewSession = false) {
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '1.
|
|
1
|
+
export const VERSION = '1.11.0';
|