Mobile Guide: Connecting Mobile Sources
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": false3},
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.
Find the instructions for packaging (or bundling) mobile SDKs in the documentation for each library:
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.
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.
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.