mapp-intelligence-reactnative-plugin 1.0.0 → 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.
- package/README.md +31 -7
- package/android/gradle.properties +3 -3
- package/android/src/main/java/com/mappinteligenceplugin/mapper/Util.kt +12 -4
- package/lib/commonjs/Converters.js +1 -1
- package/lib/commonjs/Converters.js.map +1 -1
- package/lib/commonjs/GlobalErrorHandler.js +2 -6
- package/lib/commonjs/GlobalErrorHandler.js.map +1 -1
- package/lib/commonjs/MappIntelligencePlugin.js +298 -0
- package/lib/commonjs/MappIntelligencePlugin.js.map +1 -0
- package/lib/commonjs/UseWebTracking.js +7 -11
- package/lib/commonjs/UseWebTracking.js.map +1 -1
- package/lib/commonjs/index.js +49 -378
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/promiseRejectionHandler.js.map +1 -1
- package/lib/module/Converters.js +1 -1
- package/lib/module/Converters.js.map +1 -1
- package/lib/module/GlobalErrorHandler.js +2 -6
- package/lib/module/GlobalErrorHandler.js.map +1 -1
- package/lib/module/MappIntelligencePlugin.js +292 -0
- package/lib/module/MappIntelligencePlugin.js.map +1 -0
- package/lib/module/UseWebTracking.js +6 -10
- package/lib/module/UseWebTracking.js.map +1 -1
- package/lib/module/index.js +5 -319
- package/lib/module/index.js.map +1 -1
- package/lib/module/promiseRejectionHandler.js.map +1 -1
- package/lib/typescript/src/Converters.d.ts +1 -1
- package/lib/typescript/src/Converters.d.ts.map +1 -1
- package/lib/typescript/src/DataTypes.d.ts +6 -6
- package/lib/typescript/src/DataTypes.d.ts.map +1 -1
- package/lib/typescript/src/GlobalErrorHandler.d.ts.map +1 -1
- package/lib/typescript/src/MappIntelligencePlugin.d.ts +201 -0
- package/lib/typescript/src/MappIntelligencePlugin.d.ts.map +1 -0
- package/lib/typescript/src/UseWebTracking.d.ts +2 -2
- package/lib/typescript/src/UseWebTracking.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +5 -199
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/mapp-intelligence-reactnative-plugin.podspec +1 -1
- package/package.json +28 -24
- package/src/Converters.tsx +6 -6
- package/src/GlobalErrorHandler.tsx +3 -6
- package/src/MappIntelligencePlugin.tsx +394 -0
- package/src/UseWebTracking.tsx +13 -15
- package/src/index.tsx +5 -409
|
@@ -1,201 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
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';
|
|
2
|
+
export * from './Converters';
|
|
3
|
+
export * from './DataTypes';
|
|
200
4
|
export * from './GlobalErrorHandler';
|
|
5
|
+
export { useWebTracking } from './UseWebTracking';
|
|
6
|
+
export * from './promiseRejectionHandler';
|
|
201
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,cAAc,2BAA2B,CAAC"}
|
|
@@ -12,7 +12,7 @@ Pod::Spec.new do |s|
|
|
|
12
12
|
s.authors = package["author"]
|
|
13
13
|
|
|
14
14
|
s.platforms = { :ios => "11.0" }
|
|
15
|
-
s.source = { :git => "https://github.com/
|
|
15
|
+
s.source = { :git => "https://github.com/mapp-digital/Mapp-Intelligence-ReactNative-Plugin.git", :tag => "#{s.version}" }
|
|
16
16
|
|
|
17
17
|
s.source_files = "ios/**/*.{h,m,mm}"
|
|
18
18
|
s.dependency "React-Core"
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mapp-intelligence-reactnative-plugin",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "The MappIntelligence
|
|
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",
|
|
@@ -41,37 +41,40 @@
|
|
|
41
41
|
],
|
|
42
42
|
"repository": {
|
|
43
43
|
"type": "git",
|
|
44
|
-
"url": "git+https://github.com/
|
|
44
|
+
"url": "git+https://github.com/mapp-digital/Mapp-Intelligence-ReactNative-Plugin.git"
|
|
45
45
|
},
|
|
46
46
|
"author": "Mapp Digital <stefan.stevanovic@mapp.com> (https://github.com/StefanMiticon)",
|
|
47
47
|
"license": "MIT",
|
|
48
48
|
"bugs": {
|
|
49
|
-
"url": "https://github.com/
|
|
49
|
+
"url": "https://github.com/mapp-digital/Mapp-Intelligence-ReactNative-Plugin/issues"
|
|
50
50
|
},
|
|
51
|
-
"homepage": "https://github.com/
|
|
51
|
+
"homepage": "https://github.com/mapp-digital/Mapp-Intelligence-ReactNative-Plugin#readme",
|
|
52
52
|
"publishConfig": {
|
|
53
53
|
"registry": "https://registry.npmjs.org/"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@react-native/
|
|
57
|
-
"@
|
|
58
|
-
"@
|
|
59
|
-
"@
|
|
60
|
-
"@types/
|
|
61
|
-
"@types/react
|
|
62
|
-
"
|
|
63
|
-
"eslint
|
|
64
|
-
"eslint-
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"react
|
|
71
|
-
"react-
|
|
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": "
|
|
74
|
-
"typescript": "
|
|
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": "
|
|
91
|
+
"node": "18.x",
|
|
92
|
+
"engine-strict": "true"
|
|
89
93
|
},
|
|
90
94
|
"jest": {
|
|
91
95
|
"preset": "react-native",
|
package/src/Converters.tsx
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type {
|
|
2
|
-
|
|
2
|
+
UserCategories,
|
|
3
|
+
PageParameters,
|
|
4
|
+
SessionParameters,
|
|
3
5
|
EcommerceParameters,
|
|
6
|
+
CampaignParameters,
|
|
4
7
|
EventParameters,
|
|
5
|
-
MediaEvent,
|
|
6
8
|
MediaParameteres,
|
|
7
|
-
|
|
8
|
-
SessionParameters,
|
|
9
|
-
UserCategories,
|
|
9
|
+
MediaEvent,
|
|
10
10
|
} from './DataTypes';
|
|
11
11
|
|
|
12
12
|
//MARK: methods for converting objects
|
|
@@ -129,7 +129,7 @@ export function convertEcommerceParameters(
|
|
|
129
129
|
export function convertCampaignParameters(
|
|
130
130
|
campaignParameters?: CampaignParameters | null
|
|
131
131
|
): Object | null {
|
|
132
|
-
console.log('
|
|
132
|
+
console.log('convertCampaignParameters');
|
|
133
133
|
if (campaignParameters == null) {
|
|
134
134
|
return null;
|
|
135
135
|
}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
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);
|