iidrak-analytics-react 1.2.4
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 +170 -0
- package/index.d.ts +1 -0
- package/index.js +4 -0
- package/metastreamio/metastreamio.account.js +65 -0
- package/metastreamio/metastreamio.cart.js +192 -0
- package/metastreamio/metastreamio.constants.js +256 -0
- package/metastreamio/metastreamio.date.js +41 -0
- package/metastreamio/metastreamio.environment.js +406 -0
- package/metastreamio/metastreamio.interface.js +591 -0
- package/metastreamio/metastreamio.logger.js +150 -0
- package/metastreamio/metastreamio.network.js +313 -0
- package/metastreamio/metastreamio.provider.js +50 -0
- package/metastreamio/metastreamio.queue.js +68 -0
- package/metastreamio/metastreamio.recorder.js +157 -0
- package/metastreamio/metastreamio.session.js +150 -0
- package/metastreamio/metastreamio.user.js +79 -0
- package/metastreamio/metastreamio.userproperties.js +76 -0
- package/metastreamio/metastreamio.utility.js +206 -0
- package/metastreamio/models/constructor.app.js +24 -0
- package/metastreamio/models/constructor.config.js +33 -0
- package/metastreamio/models/constructor.user.js +30 -0
- package/metastreamio/models/event.account.balance.js +12 -0
- package/metastreamio/models/event.account.js +22 -0
- package/metastreamio/models/event.appinfo.js +28 -0
- package/metastreamio/models/event.appperformance.js +25 -0
- package/metastreamio/models/event.cart.js +19 -0
- package/metastreamio/models/event.cartitem.js +34 -0
- package/metastreamio/models/event.device.js +55 -0
- package/metastreamio/models/event.event.js +88 -0
- package/metastreamio/models/event.network.js +27 -0
- package/metastreamio/models/event.parameter.js +12 -0
- package/metastreamio/models/event.parameters.js +38 -0
- package/metastreamio/models/event.session.js +24 -0
- package/metastreamio/models/event.session.utm.js +37 -0
- package/metastreamio/models/event.userproperty.js +14 -0
- package/metastreamio/string.format.js +7 -0
- package/package.json +21 -0
package/README.md
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
# Iidrak Analytics (React Native)
|
|
2
|
+
|
|
3
|
+
A powerful, offline-first analytics SDK for React Native applications that includes **Session Replay**. Track events, manage shopping carts, record user sessions (screens & touches), and persist data reliably even when the network is down.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- 📊 **Event Tracking**: Log custom events with arbitrary parameters.
|
|
8
|
+
- 🎥 **Session Replay**: Record screen interactions and touch events for playback analysis.
|
|
9
|
+
- 🛒 **Cart Management**: Built-in shopping cart state management.
|
|
10
|
+
- 📴 **Offline Support**: Automatically queues events when offline and flushes them when connection is restored.
|
|
11
|
+
- 🆔 **User & Session Management**: Auto-generates session IDs and supports user identification.
|
|
12
|
+
- âš¡ **Lightweight**: Minimal performance overhead.
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
This package relies on several peer dependencies for device info, storage, and screen capture. You must install them in your project.
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install iidrak-analytics-react
|
|
20
|
+
|
|
21
|
+
# Install required peer dependencies
|
|
22
|
+
npm install @react-native-async-storage/async-storage @react-native-community/netinfo react-native-device-info react-native-view-shot
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
**iOS Users**: after installing, remember to run:
|
|
26
|
+
```bash
|
|
27
|
+
cd ios && pod install
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
**Android Users**: ensuring linking works may require a clean build:
|
|
31
|
+
```bash
|
|
32
|
+
cd android && ./gradlew clean
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Getting Started
|
|
36
|
+
|
|
37
|
+
### 1. Initialize the SDK
|
|
38
|
+
|
|
39
|
+
Create an instance of `MetaStreamIO` with your configuration. This is usually done in your root component file (e.g., `App.tsx` or `App.js`).
|
|
40
|
+
|
|
41
|
+
**Configuration Payload Format:**
|
|
42
|
+
The configuration object requires strict structure for `app`, `config`, and `user` keys.
|
|
43
|
+
|
|
44
|
+
```javascript
|
|
45
|
+
import { MetaStreamIO, MetaStreamProvider } from 'iidrak-analytics-react';
|
|
46
|
+
|
|
47
|
+
const iidrakConfig = {
|
|
48
|
+
// Application Details
|
|
49
|
+
app: {
|
|
50
|
+
id: "your-app-id", // Required: Unique ID for your app
|
|
51
|
+
channel: "mobile", // Optional: 'mobile', 'web', etc.
|
|
52
|
+
environment: "production", // Optional: 'dev', 'staging', 'production'
|
|
53
|
+
endpoints: ["https://your-analytics-collector.com/collect"], // Analytics Server URL
|
|
54
|
+
headers: { // Optional: Custom headers for requests
|
|
55
|
+
"Authorization": "Bearer token"
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
// SDK Configuration
|
|
60
|
+
config: {
|
|
61
|
+
// Session Replay Endpoint (Required to enable recording)
|
|
62
|
+
recordingEndpoint: "https://your-replay-server.com",
|
|
63
|
+
|
|
64
|
+
logging: true, // Enable console logs
|
|
65
|
+
loggingLevel: 'INFO', // 'INFO', 'WARN', 'ERROR'
|
|
66
|
+
silentMode: false, // If true, disables all logging
|
|
67
|
+
sessionLength: 1800, // Session timeout in seconds (e.g. 30 mins)
|
|
68
|
+
quality: 0.5, // Recording quality (0.1 - 1.0)
|
|
69
|
+
fps: 2, // Frames Per Second for recording
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
// Initial User Info
|
|
73
|
+
user: {
|
|
74
|
+
guestMode: true, // Start as guest?
|
|
75
|
+
user_id: "user_123", // Optional: Known user ID
|
|
76
|
+
country: "US", // Optional
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
// Initialize the tracker
|
|
81
|
+
const tracker = new MetaStreamIO(iidrakConfig);
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### 2. Wrap Your App
|
|
85
|
+
|
|
86
|
+
To enable **Session Replay** and auto-capture of interactions, wrap your entire application with the `MetaStreamProvider`. Pass the initialized `tracker` instance to it.
|
|
87
|
+
|
|
88
|
+
```javascript
|
|
89
|
+
function App() {
|
|
90
|
+
return (
|
|
91
|
+
<MetaStreamProvider tracker={tracker}>
|
|
92
|
+
{/* Your App Components */}
|
|
93
|
+
<YourNavigationRoot />
|
|
94
|
+
</MetaStreamProvider>
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Usage
|
|
100
|
+
|
|
101
|
+
### 1. Starting a Session
|
|
102
|
+
|
|
103
|
+
Call this when your app loads or when a user logs in. If `recordingEndpoint` is configured, this will also start the Session Replay recorder.
|
|
104
|
+
|
|
105
|
+
```javascript
|
|
106
|
+
tracker.start_session({
|
|
107
|
+
user_id: "user_123", // Optional: Update user ID
|
|
108
|
+
// ...other user traits
|
|
109
|
+
});
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### 2. Tracking Events
|
|
113
|
+
|
|
114
|
+
You can track any custom event. The payload requires an `eventName` and optional `eventParameters`.
|
|
115
|
+
|
|
116
|
+
**Event Payload Format:**
|
|
117
|
+
```javascript
|
|
118
|
+
tracker.trackEvent({
|
|
119
|
+
eventName: "add_to_cart",
|
|
120
|
+
eventParameters: [
|
|
121
|
+
{ key: "product_id", value: "prod_999" },
|
|
122
|
+
{ key: "price", value: 29.99 },
|
|
123
|
+
{ key: "category", value: "shoes" }
|
|
124
|
+
]
|
|
125
|
+
});
|
|
126
|
+
```
|
|
127
|
+
*Note: `eventParameters` creates a flexible dictionary of data associated with the event.*
|
|
128
|
+
|
|
129
|
+
### 3. Screen Tracking
|
|
130
|
+
|
|
131
|
+
Though `MetaStreamProvider` captures the video, you can manually log screen views for analytics:
|
|
132
|
+
|
|
133
|
+
```javascript
|
|
134
|
+
tracker.screen("HomeScreen", {});
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### 4. Shopping Cart
|
|
138
|
+
|
|
139
|
+
Manage a persistent shopping cart state:
|
|
140
|
+
|
|
141
|
+
```javascript
|
|
142
|
+
// Add Item
|
|
143
|
+
tracker.cart.add({
|
|
144
|
+
id: "prod_001",
|
|
145
|
+
name: "Cool Sneakers",
|
|
146
|
+
price: 99.99,
|
|
147
|
+
quantity: 1
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
// Remove Item
|
|
151
|
+
tracker.cart.remove("prod_001");
|
|
152
|
+
|
|
153
|
+
// Clear Cart
|
|
154
|
+
tracker.cart.clear();
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## Troubleshooting
|
|
158
|
+
|
|
159
|
+
### "DeviceInfo could not be found"
|
|
160
|
+
If you see this error, it means the native module `react-native-device-info` is not linked.
|
|
161
|
+
1. Ensure you installed the peer dependency: `npm install react-native-device-info`
|
|
162
|
+
2. Rebuild your native app: `cd android && ./gradlew clean && cd .. && npx react-native run-android`
|
|
163
|
+
|
|
164
|
+
### "Cannot read property 'MetaStreamProvider' of undefined"
|
|
165
|
+
Ensure you are importing correctly.
|
|
166
|
+
Correct: `import { MetaStreamProvider } from 'iidrak-analytics-react';`
|
|
167
|
+
|
|
168
|
+
## License
|
|
169
|
+
|
|
170
|
+
MIT
|
package/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare module 'MetaStreamIO';
|
package/index.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { strf } from "./string.format.js";
|
|
4
|
+
|
|
5
|
+
strf();
|
|
6
|
+
|
|
7
|
+
import { AccountModel } from "./models/event.account.js";
|
|
8
|
+
import { AccountBalanceModel } from "./models/event.account.balance.js";
|
|
9
|
+
|
|
10
|
+
/*
|
|
11
|
+
*
|
|
12
|
+
* Log account data
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
class MetaStreamIOAccountData {
|
|
17
|
+
constructor({ constants, logger, storage, utility } = {}) {
|
|
18
|
+
this.constant = constants;
|
|
19
|
+
this.logger = logger;
|
|
20
|
+
this.account = new AccountModel();
|
|
21
|
+
this.utility = utility;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
reset() {
|
|
25
|
+
this.account = new AccountModel();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
setType(account = null) {
|
|
29
|
+
if (account) {
|
|
30
|
+
this.account.type = account;
|
|
31
|
+
this.logger.log(
|
|
32
|
+
"account",
|
|
33
|
+
this.constant.MetaStreamIO_AccountTypeSet.format(this.account.type)
|
|
34
|
+
);
|
|
35
|
+
} else {
|
|
36
|
+
this.logger.log(
|
|
37
|
+
"account",
|
|
38
|
+
"setAccountType() could not set account type: " + err
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
setBalance({ account = null, balance = null } = {}) {
|
|
44
|
+
this.account.balances[account] = new AccountBalanceModel({
|
|
45
|
+
account: account,
|
|
46
|
+
balance: balance,
|
|
47
|
+
});
|
|
48
|
+
return this.account.balances[account];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
setBalances(balances) {
|
|
52
|
+
try {
|
|
53
|
+
balances.forEach((balance) => {
|
|
54
|
+
this.setBalance({
|
|
55
|
+
account: balance.account,
|
|
56
|
+
balance: balance.balances,
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
} catch (err) {
|
|
60
|
+
this.logger.error("account", err);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export { MetaStreamIOAccountData };
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { strf } from "./string.format.js";
|
|
4
|
+
|
|
5
|
+
strf();
|
|
6
|
+
|
|
7
|
+
import { CartModel } from "./models/event.cart";
|
|
8
|
+
import { CartItemModel } from "./models/event.cartitem";
|
|
9
|
+
|
|
10
|
+
/*
|
|
11
|
+
*
|
|
12
|
+
* Cart class for managing shopping cart
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
class MetaStreamIOCart {
|
|
17
|
+
constructor({ constants, date, encryption, logger, storage, utility } = {}) {
|
|
18
|
+
// Extend functionality with other MetaStream classes
|
|
19
|
+
this.constant = constants;
|
|
20
|
+
this.date = date;
|
|
21
|
+
this.encryption = encryption;
|
|
22
|
+
this.logger = logger;
|
|
23
|
+
this.utility = utility;
|
|
24
|
+
|
|
25
|
+
// Initialise variables
|
|
26
|
+
this.reset();
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
reset() {
|
|
30
|
+
this.cart = new CartModel();
|
|
31
|
+
this.last_cart = {};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
setCartId(id = null) {
|
|
35
|
+
if (!id) {
|
|
36
|
+
this.cart.id = this.utility.generateRandomId();
|
|
37
|
+
} else {
|
|
38
|
+
this.cart.id = id;
|
|
39
|
+
}
|
|
40
|
+
this.logger.log(
|
|
41
|
+
"cart",
|
|
42
|
+
this.constant.MetaStreamIO_Cart_CartIdSet.format(this.cart.id)
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Add items to the cart - expects an array so this can be multiple items at once
|
|
47
|
+
|
|
48
|
+
add(items = []) {
|
|
49
|
+
try {
|
|
50
|
+
for (let item in items) {
|
|
51
|
+
let _new_item = new CartItemModel({
|
|
52
|
+
price: items[item].price ? items[item].price : null,
|
|
53
|
+
id: items[item].id ? items[item].id : null,
|
|
54
|
+
name: items[item].name ? items[item].name : null,
|
|
55
|
+
type: items[item].type ? items[item].type : null,
|
|
56
|
+
validity: items[item].validity ? items[item].validity : null,
|
|
57
|
+
value: items[item].value ? items[item].value : null,
|
|
58
|
+
quantity: ((cart, item) => {
|
|
59
|
+
let _id = item.id;
|
|
60
|
+
try {
|
|
61
|
+
return cart[_id].quantity + item.quantity;
|
|
62
|
+
} catch (err) {
|
|
63
|
+
return item.quantity;
|
|
64
|
+
}
|
|
65
|
+
})(this.cart.items, items[item]),
|
|
66
|
+
recipients: items[item].recipients ? items[item].recipients : [],
|
|
67
|
+
}).json();
|
|
68
|
+
let _bid = items[item].id ? items[item].id : null;
|
|
69
|
+
this.cart.items = { ...this.cart.items, [_bid]: _new_item };
|
|
70
|
+
this.logger.log(
|
|
71
|
+
"cart",
|
|
72
|
+
this.constant.MetaStreamIO_Cart_AddedToCart.format(items[item].id)
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
} catch (err) {
|
|
76
|
+
this.logger.error(
|
|
77
|
+
"cart",
|
|
78
|
+
"addCartItem() error adding item to cart:",
|
|
79
|
+
err
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
this.logger.log(
|
|
83
|
+
"cart",
|
|
84
|
+
this.constant.MetaStreamIO_Cart_Cart.format(JSON.stringify(this.cart))
|
|
85
|
+
);
|
|
86
|
+
return this;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Reduce the quantity of a specific item in the cart
|
|
90
|
+
|
|
91
|
+
reduce(id = null, quantity = null) {
|
|
92
|
+
let _quantity = quantity ? quantity : 1;
|
|
93
|
+
if (this.cart.items[id]) {
|
|
94
|
+
if (this.cart.items[id]["quantity"] > 0) {
|
|
95
|
+
this.cart.items[id]["quantity"] =
|
|
96
|
+
this.cart.items[id]["quantity"] - _quantity;
|
|
97
|
+
this.logger.log(
|
|
98
|
+
"cart",
|
|
99
|
+
this.constant.MetaStreamIO_Cart_QuantityReduced.format(
|
|
100
|
+
id,
|
|
101
|
+
this.cart.items[id]["quantity"]
|
|
102
|
+
)
|
|
103
|
+
);
|
|
104
|
+
this.logger.log(
|
|
105
|
+
"cart",
|
|
106
|
+
this.constant.MetaStreamIO_Cart_Cart.format(
|
|
107
|
+
JSON.stringify(this.cart.items)
|
|
108
|
+
)
|
|
109
|
+
);
|
|
110
|
+
} else {
|
|
111
|
+
this.logger.log(
|
|
112
|
+
"cart",
|
|
113
|
+
this.constant.MetaStreamIO_Cart_QuantityZero.format(id)
|
|
114
|
+
);
|
|
115
|
+
this.logger.log(
|
|
116
|
+
"cart",
|
|
117
|
+
this.constant.MetaStreamIO_Cart_Cart.format(
|
|
118
|
+
JSON.stringify(this.cart.items)
|
|
119
|
+
)
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
} else {
|
|
123
|
+
this.logger.log(
|
|
124
|
+
"cart",
|
|
125
|
+
this.constant.MetaStreamIO_Cart_BundleNotInCart.format(id)
|
|
126
|
+
);
|
|
127
|
+
this.logger.log(
|
|
128
|
+
"cart",
|
|
129
|
+
this.constant.MetaStreamIO_Cart_Cart.format(
|
|
130
|
+
JSON.stringify(this.cart.items)
|
|
131
|
+
)
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
return this;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
delete(id = null) {
|
|
138
|
+
if (this.cart.items[id]) {
|
|
139
|
+
delete this.cart.items[id];
|
|
140
|
+
} else {
|
|
141
|
+
this.logger.log(
|
|
142
|
+
"cart",
|
|
143
|
+
this.constant.MetaStreamIO_Cart_BundleNotInCart.format(id)
|
|
144
|
+
);
|
|
145
|
+
this.logger.log(
|
|
146
|
+
"cart",
|
|
147
|
+
this.constant.MetaStreamIO_Cart_Cart.format(
|
|
148
|
+
JSON.stringify(this.cart.items)
|
|
149
|
+
)
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
return this;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// Remove all items from the cart and generate a new cart id
|
|
156
|
+
|
|
157
|
+
clear(cart_id = null) {
|
|
158
|
+
try {
|
|
159
|
+
this.cart = new CartModel({
|
|
160
|
+
id: cart_id !== null ? cart_id : this.utility.generateRandomId(),
|
|
161
|
+
});
|
|
162
|
+
this.logger.log("cart", this.constant.MetaStreamIO_Cart_RemoveAllItems);
|
|
163
|
+
this.logger.log(
|
|
164
|
+
"cart",
|
|
165
|
+
this.constant.MetaStreamIO_Cart_Cart.format(JSON.stringify(this.cart))
|
|
166
|
+
);
|
|
167
|
+
} catch (err) {
|
|
168
|
+
return this;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
return this;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
get lastCart() {
|
|
175
|
+
return this.last_cart;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
set lastCart(input) {
|
|
179
|
+
this.last_cart = input;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// Convert cart object to a list of objects with the bundle id as the key for each
|
|
183
|
+
list(input = {}) {
|
|
184
|
+
let _return = [];
|
|
185
|
+
for (let id in input) {
|
|
186
|
+
_return.push(input[id]);
|
|
187
|
+
}
|
|
188
|
+
return _return;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export { MetaStreamIOCart };
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { strf } from "./string.format.js";
|
|
4
|
+
|
|
5
|
+
strf();
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
*
|
|
9
|
+
* Constants
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
class MetaStreamIOConstants {
|
|
14
|
+
// MetaStreamIO constants
|
|
15
|
+
get MetaStreamIO_ValueNotSet() {
|
|
16
|
+
return "unassigned";
|
|
17
|
+
}
|
|
18
|
+
get MetaStreamIO_Unidentified() {
|
|
19
|
+
return "unidentified";
|
|
20
|
+
}
|
|
21
|
+
get MetaStreamIO_SessionLengthSeconds() {
|
|
22
|
+
return 1800;
|
|
23
|
+
}
|
|
24
|
+
get MetaStreamIO_SendOnceDefault() {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
get MetaStreamIO_Endpoint_User() {
|
|
29
|
+
return "/user";
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Account
|
|
33
|
+
get MetaStreamIO_AccountTypeSet() {
|
|
34
|
+
return "account type set to {0}";
|
|
35
|
+
}
|
|
36
|
+
get MetaStreamIO_AccountBalanceSet() {
|
|
37
|
+
return "account balance for {0} set to {1}";
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
get MetaStreamIO_AccountTypeNotSet() {
|
|
41
|
+
return "not set";
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// AsyncStorage names
|
|
45
|
+
get MetaStreamIO_Async_ReadSuccess() {
|
|
46
|
+
return "AsyncStorage retrieval for {0} returned: {1}";
|
|
47
|
+
}
|
|
48
|
+
get MetaStreamIO_Async_ReadFail() {
|
|
49
|
+
return "AsyncStorage retrieval for {0} failed";
|
|
50
|
+
}
|
|
51
|
+
get MetaStreamIO_Async_WriteSuccess() {
|
|
52
|
+
return "AsyncStorage set {0} to {1}";
|
|
53
|
+
}
|
|
54
|
+
get MetaStreamIO_Async_WriteFail() {
|
|
55
|
+
return "AsyncStorage attempt to set {0} failed.";
|
|
56
|
+
}
|
|
57
|
+
get MetaStreamIO_Async_Cart() {
|
|
58
|
+
return "tracker_cart";
|
|
59
|
+
}
|
|
60
|
+
get MetaStreamIO_Async_CartId() {
|
|
61
|
+
return "tracker_cart_id";
|
|
62
|
+
}
|
|
63
|
+
get MetaStreamIO_Async_EventParameters() {
|
|
64
|
+
return "event_parameters";
|
|
65
|
+
}
|
|
66
|
+
get MetaStreamIO_Async_UserProperties() {
|
|
67
|
+
return "user_properties";
|
|
68
|
+
}
|
|
69
|
+
get MetaStreamIO_Async_UserId() {
|
|
70
|
+
return "user_id";
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// Cart
|
|
74
|
+
get MetaStreamIO_Cart_AddedToCart() {
|
|
75
|
+
return "{0} added to cart";
|
|
76
|
+
}
|
|
77
|
+
get MetaStreamIO_Cart_Cart() {
|
|
78
|
+
return "cart: {0}";
|
|
79
|
+
}
|
|
80
|
+
get MetaStreamIO_Cart_CartIdSet() {
|
|
81
|
+
return "cart id set to {0}";
|
|
82
|
+
}
|
|
83
|
+
get MetaStreamIO_Cart_QuantityReduced() {
|
|
84
|
+
return "{0} quantity reduced to {1}";
|
|
85
|
+
}
|
|
86
|
+
get MetaStreamIO_Cart_QuantityZero() {
|
|
87
|
+
return "{0} quantity already zero";
|
|
88
|
+
}
|
|
89
|
+
get MetaStreamIO_Cart_BundleNotInCart() {
|
|
90
|
+
return "{0} not found in cart, not removed";
|
|
91
|
+
}
|
|
92
|
+
get MetaStreamIO_Cart_RemoveAllItems() {
|
|
93
|
+
return "all items removed from cart and new cart id assigned";
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// Encryption suite
|
|
97
|
+
get MetaStreamIO_Encryption_SHA256Generated() {
|
|
98
|
+
return "sha256 hash generated: {0}";
|
|
99
|
+
}
|
|
100
|
+
get MetaStreamIO_Encryption_UUIDv4Generated() {
|
|
101
|
+
return "new uuid generated: {0}";
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// Environment
|
|
105
|
+
get MetaStreamIO_Environment_AppInfo() {
|
|
106
|
+
return "app info: {0}";
|
|
107
|
+
}
|
|
108
|
+
get MetaStreamIO_Environment_AppPerformance() {
|
|
109
|
+
return "app performance: {0}";
|
|
110
|
+
}
|
|
111
|
+
get MetaStreamIO_Environment_Device() {
|
|
112
|
+
return "device: {0}";
|
|
113
|
+
}
|
|
114
|
+
get MetaStreamIO_Environment_Network() {
|
|
115
|
+
return "network: {0}";
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// Events and user properties logs
|
|
119
|
+
get MetaStreamIO_Log_EventTracked() {
|
|
120
|
+
return "event tracked: {0}";
|
|
121
|
+
}
|
|
122
|
+
get MetaStreamIO_Log_EventTrackFailed() {
|
|
123
|
+
return "event track failed: {0}";
|
|
124
|
+
}
|
|
125
|
+
get MetaStreamIO_Log_EventParameters() {
|
|
126
|
+
return "event parameters: ";
|
|
127
|
+
}
|
|
128
|
+
get MetaStreamIO_Log_EventParameterSet() {
|
|
129
|
+
return "event parameter {0} set to {1} with type {2}";
|
|
130
|
+
}
|
|
131
|
+
get MetaStreamIO_Log_SendOnce() {
|
|
132
|
+
return "send once enabled: event parameters cleared";
|
|
133
|
+
}
|
|
134
|
+
get MetaStreamIO_Log_RequestObject() {
|
|
135
|
+
return "request object >>";
|
|
136
|
+
}
|
|
137
|
+
get MetaStreamIO_Log_UserIdSet() {
|
|
138
|
+
return "user id set: {0}";
|
|
139
|
+
}
|
|
140
|
+
get MetaStreamIO_Log_CIAMIdSet() {
|
|
141
|
+
return "ciam id set: {0}";
|
|
142
|
+
}
|
|
143
|
+
get MetaStreamIO_Log_EmailIdSet() {
|
|
144
|
+
return "email id set: {0}";
|
|
145
|
+
}
|
|
146
|
+
get MetaStreamIO_Log_UserCountrySet() {
|
|
147
|
+
return "user country set: {0}";
|
|
148
|
+
}
|
|
149
|
+
get MetaStreamIO_Log_UserPropertySet() {
|
|
150
|
+
return "user property {0} set to {1} with type {2}";
|
|
151
|
+
}
|
|
152
|
+
get MetaStreamIO_Log_PushDeviceTokenSet() {
|
|
153
|
+
return "device token set: {0}";
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// Event names
|
|
157
|
+
get MetaStreamIO_EventName_Purchase() {
|
|
158
|
+
return "purchase";
|
|
159
|
+
}
|
|
160
|
+
get MetaStreamIO_EventName_SendAirtime() {
|
|
161
|
+
return "send_airtime";
|
|
162
|
+
}
|
|
163
|
+
get MetaStreamIO_EventName_QuickBuy() {
|
|
164
|
+
return "quick_buy";
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// Logger
|
|
168
|
+
get MetaStreamIO_Logger_Prefix() {
|
|
169
|
+
return "[MetaStreamIO]";
|
|
170
|
+
}
|
|
171
|
+
get MetaStreamIO_Logger_MessageFormat() {
|
|
172
|
+
return "{0} {1} {2}";
|
|
173
|
+
}
|
|
174
|
+
get MetaStreamIO_Logger_Category_Success() {
|
|
175
|
+
return "success";
|
|
176
|
+
}
|
|
177
|
+
get MetaStreamIO_Logger_Category_Environment() {
|
|
178
|
+
return "environment";
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// MetaStreamIO
|
|
182
|
+
get MetaStreamIO_IO_ProjectEnvironmentSet() {
|
|
183
|
+
return "project environment set to {0}";
|
|
184
|
+
}
|
|
185
|
+
get MetaStreamIO_IO_ProjectEnvironmentNotSet() {
|
|
186
|
+
return "project environment not set";
|
|
187
|
+
}
|
|
188
|
+
get MetaStreamIO_IO_ProjectIdSet() {
|
|
189
|
+
return "project id set to {0}";
|
|
190
|
+
}
|
|
191
|
+
get MetaStreamIO_IO_ProjectIdNotSet() {
|
|
192
|
+
return "no project id specified";
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
// Network
|
|
196
|
+
get MetaStreamIO_Network_GetDataIssue() {
|
|
197
|
+
return "getData issue: {0} [endpoint: {1}]";
|
|
198
|
+
}
|
|
199
|
+
get MetaStreamIO_Network_GetDataReturn() {
|
|
200
|
+
return "getData returned: {0}";
|
|
201
|
+
}
|
|
202
|
+
get MetaStreamIO_Network_PostDataIssue() {
|
|
203
|
+
return "postData issue: {0} [endpoint: {1}]";
|
|
204
|
+
}
|
|
205
|
+
get MetaStreamIO_Network_PostDataReturn() {
|
|
206
|
+
return "postData returned: {0}";
|
|
207
|
+
}
|
|
208
|
+
get MetaStreamIO_Network_SilentMode() {
|
|
209
|
+
return "silent mode enabled; no data sent";
|
|
210
|
+
}
|
|
211
|
+
get MetaStreamIO_Network_SilentModeEnabled() {
|
|
212
|
+
return "silent mode enabled";
|
|
213
|
+
}
|
|
214
|
+
get MetaStreamIO_Network_EndpointSet() {
|
|
215
|
+
return "endpoint set: {0}";
|
|
216
|
+
}
|
|
217
|
+
get MetaStreamIO_Network_EndpointTestFailed() {
|
|
218
|
+
return "endpoint test failed: {0}";
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
// Session
|
|
222
|
+
get MetaStreamIO_User_Guest() {
|
|
223
|
+
return "unidentified:guest";
|
|
224
|
+
}
|
|
225
|
+
get MetaStreamIO_Session_SourceNotSet() {
|
|
226
|
+
return "not set";
|
|
227
|
+
}
|
|
228
|
+
get MetaStreamIO_Session_SessionIdSet() {
|
|
229
|
+
return "session id generated: {0}";
|
|
230
|
+
}
|
|
231
|
+
get MetaStreamIO_Session_SessionStillValid() {
|
|
232
|
+
return "session still valid - check passed";
|
|
233
|
+
}
|
|
234
|
+
get MetaStreamIO_User_HashModeDefault() {
|
|
235
|
+
return true;
|
|
236
|
+
}
|
|
237
|
+
get MetaStreamIO_User_DoubleHashModeDefault() {
|
|
238
|
+
return false;
|
|
239
|
+
}
|
|
240
|
+
get MetaStreamIO_User_Base64Default() {
|
|
241
|
+
return false;
|
|
242
|
+
}
|
|
243
|
+
get MetaStreamIO_User_SecureEncryptionDefault() {
|
|
244
|
+
return false;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
// Utility
|
|
248
|
+
get MetaStreamIO_Utility_ComparedArraysAreDifferent() {
|
|
249
|
+
return "evaluated arrays are different";
|
|
250
|
+
}
|
|
251
|
+
get MetaStreamIO_Utility_ComparedArraysAreIdentical() {
|
|
252
|
+
return "evaluated arrays are identical";
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
export { MetaStreamIOConstants };
|