mapp-intelligence-reactnative-plugin 1.0.1 → 1.0.2

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.
Files changed (38) hide show
  1. package/android/gradle.properties +3 -3
  2. package/android/src/main/java/com/mappinteligenceplugin/mapper/Util.kt +12 -4
  3. package/lib/commonjs/Converters.js +1 -1
  4. package/lib/commonjs/Converters.js.map +1 -1
  5. package/lib/commonjs/GlobalErrorHandler.js +2 -6
  6. package/lib/commonjs/GlobalErrorHandler.js.map +1 -1
  7. package/lib/commonjs/MappIntelligencePlugin.js +298 -0
  8. package/lib/commonjs/MappIntelligencePlugin.js.map +1 -0
  9. package/lib/commonjs/UseWebTracking.js +5 -9
  10. package/lib/commonjs/UseWebTracking.js.map +1 -1
  11. package/lib/commonjs/index.js +14 -390
  12. package/lib/commonjs/index.js.map +1 -1
  13. package/lib/commonjs/promiseRejectionHandler.js.map +1 -1
  14. package/lib/module/Converters.js +1 -1
  15. package/lib/module/Converters.js.map +1 -1
  16. package/lib/module/GlobalErrorHandler.js +2 -6
  17. package/lib/module/GlobalErrorHandler.js.map +1 -1
  18. package/lib/module/MappIntelligencePlugin.js +292 -0
  19. package/lib/module/MappIntelligencePlugin.js.map +1 -0
  20. package/lib/module/UseWebTracking.js +5 -8
  21. package/lib/module/UseWebTracking.js.map +1 -1
  22. package/lib/module/index.js +2 -320
  23. package/lib/module/index.js.map +1 -1
  24. package/lib/module/promiseRejectionHandler.js.map +1 -1
  25. package/lib/typescript/src/DataTypes.d.ts +6 -6
  26. package/lib/typescript/src/DataTypes.d.ts.map +1 -1
  27. package/lib/typescript/src/GlobalErrorHandler.d.ts.map +1 -1
  28. package/lib/typescript/src/MappIntelligencePlugin.d.ts +201 -0
  29. package/lib/typescript/src/MappIntelligencePlugin.d.ts.map +1 -0
  30. package/lib/typescript/src/UseWebTracking.d.ts.map +1 -1
  31. package/lib/typescript/src/index.d.ts +2 -200
  32. package/lib/typescript/src/index.d.ts.map +1 -1
  33. package/package.json +25 -21
  34. package/src/Converters.tsx +1 -1
  35. package/src/GlobalErrorHandler.tsx +3 -6
  36. package/src/MappIntelligencePlugin.tsx +394 -0
  37. package/src/UseWebTracking.tsx +12 -12
  38. package/src/index.tsx +2 -410
@@ -1,205 +1,7 @@
1
- import type { CampaignParameters, EcommerceParameters, EventParameters, ExceptionType, LogLevel, MediaEvent, PageParameters, SessionParameters, UserCategories } from './DataTypes';
2
- export declare const MappIntelligencePlugin: any;
3
- /**
4
- * Builds plugin with a provided configuration. After this method finishes, plugin is ready for use.
5
- * @returns result if method executed succesfully or not
6
- */
7
- export declare const build: () => Promise<number>;
8
- /**
9
- * Initialize plugin with a provided trackIds and domain
10
- * @param trackIDs array of trackIds
11
- * @param domain tracking domain url
12
- * @returns result if method executed succesfully or not
13
- */
14
- export declare const initWithConfiguration: (trackIDs: number[], domain: string) => Promise<number>;
15
- /**
16
- * Set log level to define what will be logged to the console
17
- * @param level log level
18
- * @returns result if method executed succesfully or not
19
- */
20
- export declare const setLogLevel: (level: LogLevel) => Promise<number>;
21
- /**
22
- * Set exception log level
23
- * @param level one of the predefined exception types
24
- * @returns result if method executed succesfully or not
25
- */
26
- export declare const setExceptionLogLevel: (level: ExceptionType) => Promise<number>;
27
- /**
28
- * Sets interval in minutes, for periodic job to execute and send tracked requests to a server
29
- * @param interval number in minutes. The minimum is 15, limited by Android specification for a worker.
30
- * @returns result if method executed succesfully or not
31
- */
32
- export declare const setRequestInterval: (interval: number) => Promise<number>;
33
- /**
34
- * If sets to true, request will be send in a batch (multiple records in single network call);
35
- * Otherwise records are sent one record by one network call.
36
- * @param enabled speciffy if batch is enabled or disabled
37
- * @returns result if method executed succesfully or not
38
- */
39
- export declare const setBatchSupportEnabled: (enabled: boolean) => Promise<number>;
40
- /**
41
- * iOS Only - Enable sending data while application is in a background state
42
- * @param enabled
43
- * @returns result if method executed succesfully or not
44
- */
45
- export declare const setEnableBackgroundSendout: (enabled: boolean) => Promise<number>;
46
- /**
47
- * Set number of track records to send in a sigle batch request
48
- * @param size number of track records
49
- * @returns result if method executed succesfully or not
50
- */
51
- export declare const setBatchSupportSize: (size: number) => Promise<number>;
52
- /**
53
- * Requests are buffered in a queue before sending. This option set size of the queue.
54
- * @param numberOfRequsts size of a queue for buffering requests
55
- * @returns result if method executed succesfully or not
56
- */
57
- export declare const setRequestPerQueue: (numberOfRequsts: number) => Promise<number>;
58
- /**
59
- * Control if migration should be applied from a previos SDK version.
60
- * @param migrate true to apply migration on the initialization process; otherwise false
61
- * @returns result if method executed succesfully or not
62
- */
63
- export declare const setShouldMigrate: (migrate: boolean) => Promise<number>;
64
- /**
65
- * Based on the result of the user's conset to allow personalized tracking or not,
66
- * enable anonymous tracking when no consent. If enabled, everId will be deleted (and not generated until anonymous tracking is enabled)
67
- * @param anonymous true to enable anonymous tracking; false to disable it.
68
- * @returns result if method executed succesfully or not
69
- */
70
- export declare const setAnonymousTracking: (anonymous: boolean) => Promise<number>;
71
- /**
72
- * Send application version as parameter in every request
73
- * @param flag - true to set sending application version in every request; otherwise false.
74
- * @returns result if method executed succesfully or not
75
- */
76
- export declare const setSendAppVersionInEveryRequest: (flag: boolean) => Promise<number>;
77
- /**
78
- * To enable user matching between Engage and Intelligence system
79
- * @param enabled true to enable user matching; false to disable it.
80
- * @returns result if method executed succesfully or not
81
- */
82
- export declare const setEnableUserMatching: (enabled: boolean) => Promise<number>;
83
- /**
84
- * Track single page by page name
85
- * @param pageTitle page name for tracking
86
- * @returns result if method executed succesfully or not
87
- */
88
- export declare const trackPage: (pageTitle: string) => Promise<number>;
89
- /**
90
- * Detailed page tracking with additional parameters that can be set to track
91
- * @param pageTitle - name of the page
92
- * @param pageParameters - parameters for the page
93
- * @param sessionParamters - parameters for the current session
94
- * @param userCategories - predefined user categories
95
- * @param ecommerceParameters - predefined eCommerce parameters
96
- * @param campaignParameters - predefined campaign parameters
97
- * @returns result if method executed succesfully or not
98
- */
99
- export declare const trackCustomPage: (pageTitle: string, pageParameters?: PageParameters | null, sessionParamters?: SessionParameters | null, userCategories?: UserCategories | null, ecommerceParameters?: EcommerceParameters | null, campaignParameters?: CampaignParameters | null) => Promise<number>;
100
- /**
101
- * Custom page tracking with option to track some custom parameters
102
- * @param pageTitle - name of the page
103
- * @param pageParameters - custom parameters that can be tracked
104
- * @returns result if method executed succesfully or not
105
- */
106
- export declare const trackPageWithCustomData: (pageTitle: string, pageParameters: Map<string, string> | null) => Promise<number>;
107
- /**
108
- * Track user action
109
- * @param name - action name
110
- * @param eventParameters - predefined event parameters
111
- * @param sessionParamters - predefined session parameters
112
- * @param userCategories - predefined user categories
113
- * @param ecommerceParameters - predefined ecommerce parameters
114
- * @param campaignParameters - predefined campaign parameters
115
- * @returns result if method executed succesfully or not
116
- */
117
- export declare const trackAction: (name: string, eventParameters?: EventParameters | null, sessionParamters?: SessionParameters | null, userCategories?: UserCategories | null, ecommerceParameters?: EcommerceParameters | null, campaignParameters?: CampaignParameters | null) => Promise<number>;
118
- /**
119
- * Track URL's with included deeplinks, media parameters
120
- * @param url single url that can contain some query parameters for tracking
121
- * @param mediaCode media code to track
122
- * @returns result if method executed succesfully or not
123
- */
124
- export declare const trackUrl: (url: string, mediaCode?: string | null) => Promise<number>;
125
- /**
126
- * Track video or audio events - starting, playing, pausing/stoping, ending of playing
127
- * @param mediaEvent predefined events to track
128
- * @returns result if method executed succesfully or not
129
- */
130
- export declare const trackMedia: (mediaEvent: MediaEvent) => Promise<number>;
131
- /**
132
- * Record data about handled exceptions
133
- * @param e caught exception
134
- * @param stackTrace stack trace of the caught exception
135
- * @returns result if method executed succesfully or not
136
- */
137
- export declare const trackException: (e: Error, stackTrace?: string | null) => Promise<number>;
138
- /**
139
- * Record data about handled exception
140
- * @param name name or type of the exception if can be obtained
141
- * @param message message of the current caught exception
142
- * @param stackTrace stack trace of the caught exception
143
- * @returns result if method executed succesfully or not
144
- */
145
- export declare const trackExceptionWithName: (name: string, message: string, stackTrace?: string | null) => Promise<number>;
146
- /**
147
- * Set unique everId as identifier for a single device/user
148
- * @param everId unique identifier in the tracking system
149
- * @returns result if method executed succesfully or not
150
- */
151
- export declare const setEverId: (everId?: String | null) => Promise<number>;
152
- /**
153
- * Returns current everId of a device
154
- * @returns everId
155
- */
156
- export declare const getEverId: () => Promise<string>;
157
- /**
158
- * Check if plugin is initialized and ready to use
159
- * @returns true if plugin is ready to use; false otherwise.
160
- */
161
- export declare const isInitialized: () => Promise<boolean>;
162
- /**
163
- * Temporary sessionId is used when anonymous tracking is enabled to provide
164
- * anonymous tracking of a single session
165
- * @param sessionId unique session identifier
166
- * @returns result if method executed succesfully or not
167
- */
168
- export declare const setTemporarySessionId: (sessionId?: String | null) => Promise<number>;
169
- /**
170
- * In some cases, it is necessary to exclude users completely from tracking.
171
- * For this purpose, the SDK provides an opt-out option.
172
- * Internally, calling this method will delete all current tracking data cached in the database (if sendCurrentData is set to false), cancel the sending of requests, terminate the WorkManager, and disable all incoming tracking requests.
173
- * @param sendData true to send recorded data before opt-out
174
- * @returns result if method executed succesfully or not
175
- */
176
- export declare const optOut: (sendData: boolean) => Promise<number>;
177
- /**
178
- * Disables opt-out, and resets tracking to enabled.
179
- * @param sendData true to send recorded data before opt-in
180
- * @returns result if method executed succesfully or not
181
- */
182
- export declare const optIn: (sendData: boolean) => Promise<number>;
183
- /**
184
- * Reset all webtrekk configuration. After this, new init with settings must be called before using plugin.
185
- * @returns result if method executed succesfully or not
186
- */
187
- export declare const reset: () => Promise<number>;
188
- /**
189
- * When called, data will be immediately sent.
190
- * The request will then be deleted from the database, cleaning it.
191
- * Please note that the application must be started and visible to use this method.
192
- * @returns result if method executed succesfully or not
193
- */
194
- export declare const sendRequestsAndClean: () => Promise<number>;
195
- /**
196
- * Get active configuration of the native SDK and returns it as a string
197
- * @returns string representation of the active configuration
198
- */
199
- export declare const printCurrentConfig: () => Promise<string>;
1
+ export { MappIntelligencePlugin } from './MappIntelligencePlugin';
200
2
  export * from './Converters';
201
3
  export * from './DataTypes';
202
4
  export * from './GlobalErrorHandler';
203
- export * from './UseWebTracking';
5
+ export { useWebTracking } from './UseWebTracking';
204
6
  export * from './promiseRejectionHandler';
205
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,aAAa,EACb,QAAQ,EACR,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,cAAc,EACf,MAAM,aAAa,CAAC;AAiBrB,eAAO,MAAM,sBAAsB,KAS9B,CAAC;AAEN;;;GAGG;AACH,eAAO,MAAM,KAAK,QAAO,QAAQ,MAAM,CAGtC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,aACtB,MAAM,EAAE,UACV,MAAM,KACb,QAAQ,MAAM,CAGhB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,WAAW,UAAW,QAAQ,KAAG,QAAQ,MAAM,CAG3D,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,UAAW,aAAa,KAAG,QAAQ,MAAM,CAEzE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,aAAc,MAAM,KAAG,QAAQ,MAAM,CAGnE,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,YAAa,OAAO,KAAG,QAAQ,MAAM,CAGvE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,YAC5B,OAAO,KACf,QAAQ,MAAM,CAGhB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,SAAU,MAAM,KAAG,QAAQ,MAAM,CAGhE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,oBACZ,MAAM,KACtB,QAAQ,MAAM,CAGhB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,YAAa,OAAO,KAAG,QAAQ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ClD,cAAc,2BAA2B,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mapp-intelligence-reactnative-plugin",
3
- "version": "1.0.1",
4
- "description": "The MappIntelligence React Native plugin allows you to track user activities, screen flow and media usage for an App. All data is send to the MappIntelligence tracking system for further analysis.",
3
+ "version": "1.0.2",
4
+ "description": "The MappIntelligence SDK allows you to track user activities, screen flow and media usage for an App. All data is send to the MappIntelligence tracking system for further analysis.",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
7
7
  "types": "lib/typescript/src/index.d.ts",
@@ -53,25 +53,28 @@
53
53
  "registry": "https://registry.npmjs.org/"
54
54
  },
55
55
  "devDependencies": {
56
- "@react-native/eslint-config": "^0.72.2",
57
- "@testing-library/jest-native": "^5.4.3",
58
- "@testing-library/react-native": "^12.4.5",
59
- "@types/jest": "^28.1.2",
60
- "@types/react": "^18.2.58",
61
- "@types/react-native": "^0.70.0",
62
- "eslint": "^8.57.0",
63
- "eslint-config-prettier": "^8.5.0",
64
- "eslint-plugin-prettier": "^4.0.0",
65
- "jest": "^28.1.3",
66
- "pod-install": "^0.1.0",
67
- "prettier": "^2.0.5",
68
- "react": "18.2.0",
69
- "react-native": "0.73.5",
70
- "react-native-builder-bob": "^0.23.2",
71
- "react-test-renderer": "^18.2.0",
56
+ "@react-native/babel-preset": "0.75.3",
57
+ "@react-native/eslint-config": "0.75.3",
58
+ "@react-native/metro-config": "0.75.3",
59
+ "@react-native/typescript-config": "0.75.3",
60
+ "@types/jest": "28.1.2",
61
+ "@types/react": "18.2.58",
62
+ "@types/react-native": "0.70.0",
63
+ "eslint": "8.57.0",
64
+ "eslint-config-prettier": "8.5.0",
65
+ "eslint-plugin-prettier": "4.0.0",
66
+ "jest": "28.1.3",
67
+ "lefthook": "1.7.1",
68
+ "pod-install": "0.1.0",
69
+ "prettier": "2.0.5",
70
+ "react": "18.3.1",
71
+ "react-native": "0.75.3",
72
+ "react-native-builder-bob": "0.23.2",
73
+ "react-native-webview": "13.12.2",
74
+ "react-test-renderer": "18.3.1",
72
75
  "turbo": "^1.10.7",
73
- "typedoc": "^0.25.13",
74
- "typescript": "^5.0.2"
76
+ "typedoc": "0.25.13",
77
+ "typescript": "5.0.2"
75
78
  },
76
79
  "resolutions": {
77
80
  "@types/react": "17.0.21"
@@ -85,7 +88,8 @@
85
88
  ],
86
89
  "packageManager": "yarn@3.6.1",
87
90
  "engines": {
88
- "node": ">= 18.0.0"
91
+ "node": "18.x",
92
+ "engine-strict": "true"
89
93
  },
90
94
  "jest": {
91
95
  "preset": "react-native",
@@ -129,7 +129,7 @@ export function convertEcommerceParameters(
129
129
  export function convertCampaignParameters(
130
130
  campaignParameters?: CampaignParameters | null
131
131
  ): Object | null {
132
- console.log('convertCapaignParameters');
132
+ console.log('convertCampaignParameters');
133
133
  if (campaignParameters == null) {
134
134
  return null;
135
135
  }
@@ -1,8 +1,5 @@
1
- import { trackException } from './index';
2
- // import {
3
- // getUnhandledPromiseRejectionTracker,
4
- // setUnhandledPromiseRejectionTracker,
5
- // } from './promiseRejectionHandler';
1
+ import { MappIntelligencePlugin } from 'mapp-intelligence-reactnative-plugin';
2
+
6
3
  const {
7
4
  polyfillGlobal,
8
5
  } = require('react-native/Libraries/Utilities/PolyfillFunctions');
@@ -19,7 +16,7 @@ var onErrorCallback: ((e: Error, isFatal: Boolean) => {}) | undefined | null =
19
16
 
20
17
  const defaultErrorHandler: GlobalErrorHandler = (error, isFatal) => {
21
18
  try {
22
- trackException(error, error.stackTrace);
19
+ MappIntelligencePlugin.trackException(error, error.stackTrace);
23
20
  console.log('GLOBAL ERROR HANDLER: ', isFatal, error);
24
21
  } catch (err) {
25
22
  console.error(err);