You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* chore(deps): update y18n from 3.2.1 to 4.0.1
* chore(deps): update react-native in test-app from 0.62.2 to 0.64
* chore(deps): update react-core dependency and deployment ios
* chore(deps); update podfile in test app to reflect react native update
* force run ci
* ci: force run
* ci: force run
* chore(deps): update podfile to match test app names
* chore(deps): update top-level package.json bump react-native from 0.62.2 to 0.64 and babel from 7.4 to 7,12,9
* chore(deps): correct babel version
* chore(deps): bump jest and detox to get around node 14 build error
* chore(deps): update babel-core and ts-tests
* ci: force run
* chore(deps): downgrade typescript
* chore(deps): downgrade jest-mock-console
* chore(deps): change version in analytics.spec.ts
* test: fix jest no input calls
* ci: force run
* fix: fix lint issue with array type
* test: change test-app minSdkVersion to 21
* test: try ios podfile fix
* ci: bump xcode version
* test: update test app detox config
* fix: remove mocha and remove cirleCi config in e2e setup
* fix: deleted vanilla config fix lint
* fix: re-add jest config to core package.json
* fix: revert devDependencies in core package.json
* fix: remove jest Config from core
Co-authored-by: Alan Charles <alan.charles@Alans-MacBook-Pro.local>
Co-authored-by: Prayansh Srivastava <prayansh@gmail.com>
Copy file name to clipboardExpand all lines: packages/core/docs/classes/analytics.client.md
+2-87Lines changed: 2 additions & 87 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,10 +42,6 @@
42
42
43
43
*Defined in [analytics.ts:152](https://github.com/segmentio/analytics-react-native/blob/master/packages/core/src/analytics.ts#L152)*
44
44
45
-
Whether the client is ready to send events to Segment.
46
-
47
-
This becomes `true` when `.setup()` succeeds. All calls will be queued until it becomes `true`.
48
-
49
45
___
50
46
51
47
## Methods
@@ -58,10 +54,6 @@ ___
58
54
59
55
*Defined in [analytics.ts:330](https://github.com/segmentio/analytics-react-native/blob/master/packages/core/src/analytics.ts#L330)*
60
56
61
-
Merge two user identities, effectively connecting two sets of user data as one. This may not be supported by all integrations.
62
-
63
-
When you learn more about who the group is, you can record that information with group.
64
-
65
57
**Parameters:**
66
58
67
59
| Name | Type | Default value | Description |
@@ -80,10 +72,6 @@ ___
80
72
81
73
*Defined in [analytics.ts:167](https://github.com/segmentio/analytics-react-native/blob/master/packages/core/src/analytics.ts#L167)*
82
74
83
-
Catch React-Native bridge errors
84
-
85
-
These errors are emitted when calling the native counterpart. This only applies to methods with no return value (`Promise<void>`), methods like `getAnonymousId` do reject promises.
86
-
87
75
**Parameters:**
88
76
89
77
| Name | Type |
@@ -101,10 +89,6 @@ ___
101
89
102
90
*Defined in [analytics.ts:369](https://github.com/segmentio/analytics-react-native/blob/master/packages/core/src/analytics.ts#L369)*
103
91
104
-
Completely disable the sending of any analytics data.
105
-
106
-
If you have a way for users to actively or passively (sometimes based on location) opt-out of analytics data collection, you can use this method to turn off all data collection.
107
-
108
92
**Returns:**`Promise`<`void`>
109
93
110
94
___
@@ -116,10 +100,6 @@ ___
116
100
117
101
*Defined in [analytics.ts:359](https://github.com/segmentio/analytics-react-native/blob/master/packages/core/src/analytics.ts#L359)*
118
102
119
-
Enable the sending of analytics data. Enabled by default.
120
-
121
-
Occasionally used in conjunction with disable user opt-out handling.
122
-
123
103
**Returns:**`Promise`<`void`>
124
104
125
105
___
@@ -131,10 +111,6 @@ ___
131
111
132
112
*Defined in [analytics.ts:350](https://github.com/segmentio/analytics-react-native/blob/master/packages/core/src/analytics.ts#L350)*
133
113
134
-
Trigger an upload of all queued events.
135
-
136
-
This is useful when you want to force all messages queued on the device to be uploaded. Please note that not all integrations respond to this method.
137
-
138
114
**Returns:**`Promise`<`void`>
139
115
140
116
___
@@ -146,8 +122,6 @@ ___
146
122
147
123
*Defined in [analytics.ts:374](https://github.com/segmentio/analytics-react-native/blob/master/packages/core/src/analytics.ts#L374)*
148
124
149
-
Retrieve the anonymousId.
150
-
151
125
**Returns:**`Promise`<`string`>
152
126
153
127
___
@@ -159,10 +133,6 @@ ___
159
133
160
134
*Defined in [analytics.ts:317](https://github.com/segmentio/analytics-react-native/blob/master/packages/core/src/analytics.ts#L317)*
161
135
162
-
Associate a user with a group, organization, company, project, or w/e _you_ call them.
163
-
164
-
When you learn more about who the group is, you can record that information with group.
*Defined in [analytics.ts:304](https://github.com/segmentio/analytics-react-native/blob/master/packages/core/src/analytics.ts#L304)*
184
154
185
-
Associate a user with their unique ID and record traits about them.
186
-
187
-
When you learn more about who your user is, you can record that information with identify.
188
-
189
155
**Parameters:**
190
156
191
157
| Name | Type | Default value | Description |
192
158
| ------ | ------ | ------ | ------ |
193
-
| user |`string`| - | database ID (or email address) for this user. If you don't have a userId but want to record traits, you should pass nil. For more information on how we generate the UUID and Apple's policies on IDs, see [https://segment.io/libraries/ios#ids](https://segment.io/libraries/ios#ids)|
159
+
| user |`string`\|`null`| - | database ID (or email address) for this user. If you don't have a userId but want to record traits, you should pass nil. For more information on how we generate the UUID and Apple's policies on IDs, see [https://segment.io/libraries/ios#ids](https://segment.io/libraries/ios#ids)|
194
160
|`Default value` traits |[JsonMap]()| {} | A dictionary of traits you know about the user. Things like: email, name, plan, etc. |
195
161
|`Default value` options |[Options]()| {} | A dictionary of options, e.g. integrations (thigh analytics integration to forward the event to) |
196
162
@@ -205,27 +171,6 @@ ___
205
171
206
172
*Defined in [analytics.ts:213](https://github.com/segmentio/analytics-react-native/blob/master/packages/core/src/analytics.ts#L213)*
207
173
208
-
Append a new middleware to the middleware chain.
209
-
210
-
Middlewares are a powerful mechanism that can augment the events collected by the SDK. A middleware is a simple function that is invoked by the Segment SDK and can be used to monitor, modify or reject events.
211
-
212
-
Middlewares are invoked for all events, including automatically tracked events, and external event sources like Adjust and Optimizely. This offers you the ability the customize those messages to fit your use case even if the event was sent outside your source code.
213
-
214
-
The key thing to observe here is that the output produced by the first middleware feeds into the second. This allows you to chain and compose independent middlewares!
215
-
216
-
For example, you might want to record the device year class with your events. Previously, you would have to do this everywhere you trigger an event with the Segment SDK. With middlewares, you can do this in a single place :
*Defined in [analytics.ts:340](https://github.com/segmentio/analytics-react-native/blob/master/packages/core/src/analytics.ts#L340)*
245
190
246
-
Reset any user state that is cached on the device.
247
-
248
-
This is useful when a user logs out and you want to clear the identity. It will clear any traits or userId's cached on the device.
249
-
250
191
**Returns:**`Promise`<`void`>
251
192
252
193
___
@@ -258,10 +199,6 @@ ___
258
199
259
200
*Defined in [analytics.ts:289](https://github.com/segmentio/analytics-react-native/blob/master/packages/core/src/analytics.ts#L289)*
260
201
261
-
Record the screens or views your users see.
262
-
263
-
When a user views a screen in your app, you'll want to record that here. For some tools like Google Analytics and Flurry, screen views are treated specially, and are different from "events" kind of like "page views" on the web. For services that don't treat "screen views" specially, we map "screen" straight to "track" with the same parameters. For example, Mixpanel doesn't treat "screen views" any differently. So a call to "screen" will be tracked as a normal event in Mixpanel, but get sent to Google Analytics and Flurry as a "screen".
264
-
265
202
**Parameters:**
266
203
267
204
| Name | Type | Default value | Description |
@@ -281,8 +218,6 @@ ___
281
218
282
219
*Defined in [analytics.ts:177](https://github.com/segmentio/analytics-react-native/blob/master/packages/core/src/analytics.ts#L177)*
283
220
284
-
Sets the IDFA value on iOS. Customers are now responsible for collecting IDFA on their own.
285
-
286
221
**Parameters:**
287
222
288
223
| Name | Type |
@@ -300,18 +235,6 @@ ___
300
235
301
236
*Defined in [analytics.ts:252](https://github.com/segmentio/analytics-react-native/blob/master/packages/core/src/analytics.ts#L252)*
302
237
303
-
Setup the Analytics module. All calls made before are queued and only executed if the configuration was successful.
304
-
305
-
```js
306
-
awaitanalytics.setup('YOUR_WRITE_KEY', {
307
-
using: [Mixpanel, GoogleAnalytics],
308
-
trackAppLifecycleEvents:true,
309
-
ios: {
310
-
trackDeepLinks:true
311
-
}
312
-
})
313
-
```
314
-
315
238
**Parameters:**
316
239
317
240
| Name | Type | Default value | Description |
@@ -330,10 +253,6 @@ ___
330
253
331
254
*Defined in [analytics.ts:271](https://github.com/segmentio/analytics-react-native/blob/master/packages/core/src/analytics.ts#L271)*
332
255
333
-
Record the actions your users perform.
334
-
335
-
When a user performs an action in your app, you'll want to track that action for later analysis. Use the event name to say what the user did, and properties to specify any interesting details of the action.
336
-
337
256
**Parameters:**
338
257
339
258
| Name | Type | Default value | Description |
@@ -353,10 +272,6 @@ ___
353
272
354
273
*Defined in [analytics.ts:225](https://github.com/segmentio/analytics-react-native/blob/master/packages/core/src/analytics.ts#L225)*
355
274
356
-
Use the native configuration.
357
-
358
-
You'll need to call this method when you configure Analytics's singleton using the native API.
Copy file name to clipboardExpand all lines: packages/core/docs/interfaces/analytics.configuration.md
-26Lines changed: 0 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,8 +33,6 @@
33
33
34
34
*Defined in [analytics.ts:119](https://github.com/segmentio/analytics-react-native/blob/master/packages/core/src/analytics.ts#L119)*
35
35
36
-
Android specific settings.
37
-
38
36
___
39
37
<aid="debug"></a>
40
38
@@ -53,8 +51,6 @@ ___
53
51
54
52
*Defined in [analytics.ts:45](https://github.com/segmentio/analytics-react-native/blob/master/packages/core/src/analytics.ts#L45)*
55
53
56
-
Default project settings to use, if Segment.com cannot be reached. An example configuration can be found here, using your write key: [](https://cdn-settings.segment.com/v1/projects/YOUR_WRITE_KEY/settings)[https://cdn-settings.segment.com/v1/projects/YOUR\_WRITE\_KEY/settings](https://cdn-settings.segment.com/v1/projects/YOUR_WRITE_KEY/settings)
57
-
58
54
___
59
55
<aid="flushat"></a>
60
56
@@ -64,10 +60,6 @@ ___
64
60
65
61
*Defined in [analytics.ts:53](https://github.com/segmentio/analytics-react-native/blob/master/packages/core/src/analytics.ts#L53)*
66
62
67
-
The number of queued events that the analytics client should flush at. Setting this to `1` will not queue any events and will use more battery.
68
-
69
-
`20` by default.
70
-
71
63
___
72
64
<aid="ios"></a>
73
65
@@ -77,8 +69,6 @@ ___
77
69
78
70
*Defined in [analytics.ts:101](https://github.com/segmentio/analytics-react-native/blob/master/packages/core/src/analytics.ts#L101)*
79
71
80
-
iOS specific settings.
81
-
82
72
___
83
73
<aid="proxy"></a>
84
74
@@ -88,10 +78,6 @@ ___
88
78
89
79
*Defined in [analytics.ts:71](https://github.com/segmentio/analytics-react-native/blob/master/packages/core/src/analytics.ts#L71)*
90
80
91
-
Whether the analytics client should send all requests through your own hosted proxy rather than directly to Segment. See: iOS: [https://segment.com/docs/connections/sources/catalog/libraries/mobile/ios/#proxy-http-calls](https://segment.com/docs/connections/sources/catalog/libraries/mobile/ios/#proxy-http-calls) android: [https://segment.com/docs/connections/sources/catalog/libraries/mobile/android/#proxy-http-calls](https://segment.com/docs/connections/sources/catalog/libraries/mobile/android/#proxy-http-calls)
92
-
93
-
Ex. For a desired proxy through `http://localhost:64000/segment` the configuration would look like such { scheme: 'http', host: 'localhost', port: 64000, path: '/segment' }
94
-
95
81
___
96
82
<aid="recordscreenviews"></a>
97
83
@@ -101,10 +87,6 @@ ___
101
87
102
88
*Defined in [analytics.ts:19](https://github.com/segmentio/analytics-react-native/blob/master/packages/core/src/analytics.ts#L19)*
103
89
104
-
Whether the analytics client should automatically make a screen call when a view controller is added to a view hierarchy. Because the iOS underlying implementation uses method swizzling, we recommend initializing the analytics client as early as possible.
105
-
106
-
Disabled by default.
107
-
108
90
___
109
91
<aid="trackapplifecycleevents"></a>
110
92
@@ -114,10 +96,6 @@ ___
114
96
115
97
*Defined in [analytics.ts:26](https://github.com/segmentio/analytics-react-native/blob/master/packages/core/src/analytics.ts#L26)*
116
98
117
-
Whether the analytics client should automatically track application lifecycle events, such as "Application Installed", "Application Updated" and "Application Opened".
118
-
119
-
Disabled by default.
120
-
121
99
___
122
100
<aid="trackattributiondata"></a>
123
101
@@ -127,8 +105,6 @@ ___
127
105
128
106
*Defined in [analytics.ts:31](https://github.com/segmentio/analytics-react-native/blob/master/packages/core/src/analytics.ts#L31)*
129
107
130
-
*__deprecated__*: The property should not be used
131
-
132
108
___
133
109
<aid="using"></a>
134
110
@@ -138,7 +114,5 @@ ___
138
114
139
115
*Defined in [analytics.ts:36](https://github.com/segmentio/analytics-react-native/blob/master/packages/core/src/analytics.ts#L36)*
140
116
141
-
Register a set of integrations to be used with this Analytics instance.
0 commit comments