Skip to contentSkip to navigationSkip to topbar
Page toolsOn this page
Looking for more inspiration?Visit the

Mobile Guide: Connecting Mobile Sources


About mobile connection modes

about-mobile-connection-modes page anchor

Segment defaults to using cloud-based connection mode ("cloud-mode") for any destination connected to a mobile source, because this can help decrease the size of your final app package. When you use cloud-mode, Segment sends messages to the Segment servers, and then translates and forwards that data on to the downstream tools. This way, you only package the Segment mobile library with your app.

However, many destination tools that specifically deal with mobile interactions require that you use a device-based connection mode ("device-mode") so that they can collect information directly on the mobile device. (You can check the full list of destinations and which connection modes they support.)

If you plan to use destinations that require device-mode, you must package the Segment-integration version of that tool's SDK along with the Segment source library in your app. The Segment-integration SDK allows you to still collect the data with Segment, but also enables any device-based features, and still saves you space.

When you package a tool's device-mode SDK with the Segment SDK, Segment sends the data directly to the tool's API endpoint. Segment then also adds the tool to the integrations object and sets it to false, so that the data is not sent a second time from Segment servers.

For example, if you bundled the Segment SDK and Segment-Intercom library, you would see this in your payload:

1
"integrations": {
2
"Intercom": false
3
},

When you package Segment and the Segment-integration SDKs, you must use a dependency manager (such as Cocoapods or Gradle) to ensure that all SDKs are compatible and all of their dependencies are included. Segment does not support bundling mobile SDKs without a dependency manager.

Packaging Device-mode destination SDKs

packaging-device-mode-destination-sdks page anchor

Find the instructions for packaging (or bundling) mobile SDKs in the documentation for each library:

  • iOS
  • Android
  • React Native

Bundled SDKs vs. cloud-mode destinations for mobile

bundled-sdks-vs-cloud-mode-destinations-for-mobile page anchor

Segment's core Mobile SDKs are small and offload as much destination-handling work as possible to Segment's servers. When you install the lightweight SDK, you have access to Segment's entire suite of server-side destinations.

Why do some destinations require bundling their SDKs?

why-do-some-destinations-require-bundling-their-sdks page anchor

Segment bundles certain SDKs (instead of sending your data to them from its servers) so that you have access to features that require direct client access, such as A/B testing, user surveys, and touch heatmapping, or access to device data such as CPU usage, network data, or uncaught and raised exceptions. For those features, Segment bundles the destination's native SDK.

The mobile SDKs are modular, so you only need to include the SDKs for the tools you plan to use. These lightweight Segment-tool-SDKs provide the native functionality of all destinations without including hefty third-party SDKs by default. This gives you control over size and helps prevent method bloat.

Learn how to use custom builds for Android and iOS.

Which destination's SDKs can be bundled?

which-destinations-sdks-can-be-bundled page anchor

To check whether a destination can be bundled, look at the connection modes reference page and find the line for that specific destination.

If a destination has a checkmark in the "Device - Mobile" column, it can be bundled.