Skip to content

Commit 295643d

Browse files
authored
DOC-138 react native device mode dependencies (#1445)
* doc-138 react native deps * add table for now * checkin * Fix table, some minor tweaks * checkin * checkin some cleanup to firebase * force renumbering * flesh out firebase a bit * includify all the different react native instructions * don't use google analytics for device mode. use firebase. * small tweaks Co-authored-by: sanscontext <>
1 parent 7d8abf1 commit 295643d

File tree

23 files changed

+283
-93
lines changed

23 files changed

+283
-93
lines changed

src/_includes/content/react-dest.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<!-- Usage: `include react-dest only={ios|android}` -->
2+
<!-- in the file we're pulling from the API, "name" corresponds with the path to the yml blob for a specific destination.-->
3+
{% assign currentSlug = page.url | split: "/" | last %}
4+
{% assign thisDest = site.data.catalog.destinations.items | where: "slug", currentSlug | first %}
5+
{% assign thisDestName = thisDest.display_name %}
6+
{% assign thisDestRNspecific = include.only %}
7+
8+
9+
{% if thisDestRNspecific %}
10+
<div class="premonition info">
11+
<div class="fa fa-info-circle"></div>
12+
<div class="content"><p>
13+
The {{thisDestName}} device-mode destination SDK is only available for {{thisDestRNspecific}} in React Native.
14+
</p></div></div>
15+
{%endif%}
16+
17+
To add the {{thisDestName}} device-mode SDK to a [React Native](/docs/connections/sources/catalog/libraries/mobile/react-native/) project:
18+
1. Navigate to the root folder of your project, and run a `yarn add {{thisDestName | downcase | replace: " ", "-" }}{% if thisDestRNspecific %}-{{thisDestRNspecific}}{%endif%}` command to add the destination SDK to your project.
19+
2. Add an `import` statement to your project, as in the example below.
20+
```js
21+
import {{thisDestName | replace: " ", "" }} from '@segment/analytics-react-native-{{thisDestName | downcase | replace: " ", "" }}{% if thisDestRNspecific %}-{{thisDestRNspecific}}{%endif%}'
22+
```
23+
3. In the same project file, add the destination to the `using` list in the `await` command.
24+
```js
25+
await analytics.setup('YOUR_WRITE_KEY', {
26+
// Add any of your Device-mode destinations. This ensures they load before continuing.
27+
using: {{thisDestName | replace: " ", "" }}
28+
// ...
29+
})
30+
```
31+
4. Finally, change to your iOS development folder ( `cd ios` ) and run `pod install`.

src/connections/destinations/catalog/adjust/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ analytics = new Analytics.Builder(this, "write_key")
106106

107107
After you build and release to the App Store, Segment automatically starts translating and sending your data to Adjust.
108108

109+
### React Native
110+
111+
{% include content/react-dest.md %}
112+
109113
### Server
110114

111115
Our Cloud-mode integration allows you to send *supplemental* data to Adjust. This, however, *does not* include attribution events. If you are relying on the Adjust server-side component, and you are not bundling the Segment-Adjust SDK, your installs will not be attributed. E-commerce events and other general `track` events are supported out of the box. You **must** map your `track` events to your custom Adjust Event Token in your [Adjust destination settings](#map-your-events-to-custom-adjust-event-tokens).

src/connections/destinations/catalog/amplitude/index.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ In addition to the docs below, Amplitude created a [integration guide](https://d
4343

4444
If you included Segment's Javascript snippet on your page, then Amplitude's SDK loads on your page automatically and you can use Segment's to begin sending events right away.
4545

46+
### React Native device mode set up
47+
48+
{% include content/react-dest.md %}
49+
4650

4751
## Page and Screen
4852

@@ -446,7 +450,7 @@ with the user's `userId`, or what Amplitude refers to, respectively, as a
446450

447451
By default, Segment does **NOT** send Alias events to Amplitude. To forward Alias events from Segment, go to your Amplitude destination settings in the Segment web app, and set the **Enable Alias** setting to "on". Once enabled, Segment forwards both client-based and server-based Alias calls. Segment processes _all_ Alias calls before sending them to Amplitude, so you won't see a `usermap` request to Amplitude if you check your browser's Network activity after making a Segment Alias call.
448452

449-
> note ""
453+
> note ""
450454
> To use Alias, you must have the Amplitude Portfolio add-on enabled.
451455
452456
For more information, see the [Segment Spec page for the Alias method](https://segment.com/docs/connections/spec/alias/) and [the Amplitude `usermap` documentation](https://amplitude.zendesk.com/hc/en-us/articles/360002750712-Portfolio-Cross-Project-Analysis#user-mapping-aliasing).

src/connections/destinations/catalog/appsflyer/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ If you have the **Can Omit AppsFlyerID** setting enabled, but aren't sending an
5454

5555
To prevent this, you can enable the new **Fallback to send IDFV when advertisingId key not present** setting in your AppsFlyer destination settings. With this enabled, when you send data using cloud-mode (through the Segment servers), Segment sends the user's IDFV (the `device.id`) when `device.advertisingId` is missing or blank AND “Can Omit AppsFlyerID” is enabled.
5656

57+
#### Additional React Native device-mode set up
58+
59+
{% include content/react-dest.md %}
60+
5761
### Server
5862

5963
AppsFlyer offers an **augmentative** server-side [HTTP API](https://support.appsflyer.com/hc/en-us/articles/207034486-Server-to-Server-In-App-Events-API-HTTP-API-) intended for use along side the AppsFlyer mobile SDK. Use the cloud-mode destination _with_ the mobile SDK to link out-of-app events (such as website or offline purchases) with attributed users and devices.

src/connections/destinations/catalog/branch-metrics/index.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,28 @@ This document was last updated on November 13, 2019. If you notice any gaps, out
3131
5. Paste the Branch Key in the destination settings and click **Save**.
3232

3333

34+
### Adding Branch device-mode SDKs for React Native
35+
36+
<!-- LR, Mar2021: this should be a `react-dest` include but Branch changed their name from Branch-Metrics-->
37+
38+
To add the Branch device-mode SDK to a [React Native](/docs/connections/sources/catalog/libraries/mobile/react-native/) project:
39+
1. Navigate to the root folder of your project, and run a `yarn add branch` command to add the destination SDK to your project.
40+
2. Add an `import` statement to your project, as in the example below.
41+
```js
42+
import Branch from '@segment/analytics-react-native-branch'
43+
```
44+
3. In the same project file, add the destination to the `using` list in the `await` command.
45+
```js
46+
await analytics.setup('YOUR_WRITE_KEY', {
47+
// Add any of your Device-mode destinations. This ensures they load before continuing.
48+
using: Branch
49+
// ...
50+
})
51+
```
52+
4. Finally, change to your iOS development folder ( `cd ios` ) and run `pod install`.
53+
54+
55+
3456
## Identify
3557

3658
If you're not familiar with the Segment Specs, take a look to understand what the [Identify method](https://segment.com/docs/connections/spec/identify/) does. An example iOS call would look like:

src/connections/destinations/catalog/braze/index.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,31 @@ To use the latest Braze SDK to collect IDFAs you must do the following:
9494

9595
Braze has created a sample Android application that integrates Braze using Segment. Check it out at the [GitHub repo](https://github.com/Appboy/appboy-segment-android-sample).
9696

97+
98+
### React Native device-mode set up
99+
100+
<!-- LR, Mar2021: this should be a `react-dest` include but Braze was originally called Appboy-->
101+
102+
To add the Braze device-mode SDK to a [React Native](/docs/connections/sources/catalog/libraries/mobile/react-native/) project:
103+
1. Navigate to the root folder of your project, and run a `yarn add appboy` command to add the destination SDK to your project.
104+
2. Add an `import` statement to your project, as in the example below.
105+
```js
106+
import Braze from '@segment/analytics-react-native-appboy'
107+
```
108+
3. In the same project file, add the destination to the `using` list in the `await` command.
109+
```js
110+
await analytics.setup('YOUR_WRITE_KEY', {
111+
// Add any of your Device-mode destinations. This ensures they load before continuing.
112+
using: Braze
113+
// ...
114+
})
115+
```
116+
4. Finally, change to your iOS development folder ( `cd ios` ) and run `pod install`.
117+
118+
119+
> note ""
120+
> Braze was formerly known as "Appboy", and their React component still uses that name. Be sure to use the old name!
121+
97122
## Page
98123

99124
If you're not familiar with the Segment Specs, take a look to understand what the [Page method](/docs/connections/spec/page/) does. An example call would look like:

src/connections/destinations/catalog/bugsnag/index.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ If you'd like to integrate with Bugsnag's iOS and/or Android SDKs, in addition t
3333

3434
2. [iOS](https://github.com/segment-integrations/analytics-ios-integration-bugsnag)
3535

36+
37+
### React Native
38+
39+
{% include content/react-dest.md %}
40+
3641
- - -
3742

3843
## Identify

src/connections/destinations/catalog/clevertap/index.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ All other traits will be sent to CleverTap as custom attributes. Please also not
2828

2929
## Track
3030

31-
When you `track` an event, we will send that event to CleverTap as a custom event. Note that CleverTap does not support arrays or nested objects for custom track event properties.
31+
When you `track` an event, we will send that event to CleverTap as a custom event. Note that CleverTap does not support arrays or nested objects for custom track event properties.
3232

3333
Please also note that the default logic for our cloud mode connection to CleverTap will lower case and snake_case any event properties passed from Segment's servers to CleverTap. Our device mode connection will not lower case or snake_case any event properties passed directly to CleverTap from the client.
3434

@@ -147,6 +147,12 @@ No further action is required to integrate in-app notifications, which are regis
147147
148148
CleverTap has created a sample iOS application that integrates CleverTap using Segment. Check it out at the [GitHub repo](https://github.com/CleverTap/clevertap-segment-ios/tree/master/Example).
149149
150+
151+
## React Native
152+
153+
{% include content/react-dest.md %}
154+
155+
150156
## Server-Side
151157
152158
### Push Tokens

src/connections/destinations/catalog/comscore/index.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ Our comScore destination code is open-source on GitHub if you want to check it o
88

99
## Analytics.js
1010

11-
When you enable comScore in the Segment web app, your changes appear in the Segment CDN in about 45 minutes, and then Analytics.js starts asynchronously loading comScore's `beacon.js` onto your page. **This means you should remove comScore's snippet from your page.**
12-
+ comScore automatically starts recording data.
11+
When you enable comScore in the Segment web app, your changes appear in the Segment CDN in about 45 minutes, and then Analytics.js starts asynchronously loading comScore's `beacon.js` onto your page. **This means you should remove comScore's snippet from your page.** ComScore automatically starts recording data.
1312

1413
## Mobile
1514

@@ -27,6 +26,10 @@ allprojects {
2726
}
2827
```
2928

29+
## React Native
30+
31+
{% include content/react-dest.md only="ios"%}
32+
3033

3134
### Settings
3235
Once the Segment source is integrated with your app, toggle comScore on in your Segment destinations catalog, and add your **C2 Value**, also known as the client ID. The **C2 Value** can be found by clicking on the "Get Tag" button in the "Website" or "Mobile App" tabs within the Comscore dashboard.

src/connections/destinations/catalog/countly/index.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,16 @@ Our Countly destination code is open source on GitHub. Feel free to check it out
66

77
## Getting Started
88

9-
To get started with Countly and Segment, you'll want to first integrate your mobile app with our [iOS](/docs/connections/sources/catalog/libraries/mobile/ios/) or [Android](/docs/connections/sources/catalog/libraries/mobile/android/) sources.
9+
To get started with Countly and Segment, add our [iOS](/docs/connections/sources/catalog/libraries/mobile/ios/), [Android](/docs/connections/sources/catalog/libraries/mobile/android/) or [React Native](/docs/connections/sources/catalog/libraries/mobile/react-native/) libraries to your mobile app.
1010

1111
Once the Segment library is integrated with your app, toggle Countly on in your Segment destinations catalog, and add your application's **App Key** and **Server URL** which you can find in your Countly Application Management. If you're using their cloud hosted solution (not hosting your own Count.ly server), then your **Server URL** is `https://cloud.count.ly`.
1212

13-
These new settings will take up to an hour to propogate to all of your existing users. For new users it'll be instanteneous!
13+
These new settings will take up to an hour to propagate to all of your existing users. For new users it'll be instantaneous!
14+
15+
### React Native set up
16+
17+
{% include content/react-dest.md %}
18+
1419

1520
- - -
1621

0 commit comments

Comments
 (0)