Skip to contentSkip to navigationSkip to topbar
On this page
Looking for more inspiration?Visit the
(information)
You're in the right place! Segment documentation is now part of Twilio Docs. The content you are used to is still here—just in a new home with a refreshed look.

1Flow Mobile Plugin Destination


Destination Info
  • Accepts Page, Alias, Identify and Track calls.
  • Refer to it as 1Flow Mobile Plugin in the Integrations object
  • This integration is partner owned. Please reach out to the partner's support for any issues.
  • This destination is in Beta

1Flow(link takes you to an external page) is a leading in-app user survey and messaging platform for Mobile app and SaaS businesses.

Using 1Flow, you can reach users in-the-moment while they are interacting with your website or application, to collect highly contextual user insights that help you improve your product offering and customer experience

The 1Flow Mobile Plugin Destination is open-source and available on GitHub. You can view these repositories here:

This destination is maintained by 1Flow. For any issues with the destination, contact Support team.


Getting started

getting-started page anchor
  1. From the Segment web app, click Catalog, then search for 1Flow Mobile Plugin.
  2. Click Add Destination.
  3. Select an existing Source to connect to 1Flow Mobile Plugin.
  4. Go to 1flow.ai -> Settings -> Project Settings, copy the 1Flow project key, and paste it into the Destination Settings in Segment.
  5. Depending on the mobile source you've selected, include 1Flow's library by adding the following lines to your dependency configuration.

Step 1: Add Segment1Flow Package using Swift Package Manager

step-1-add-segment1flow-package-using-swift-package-manager page anchor

In the Xcode File menu, click Add Packages. You'll see a dialog where you can search for Swift packages. In the search field, enter the URL to this repo.

  • https://github.com/1Flow-Inc/segment-1flow-ios

You'll then have the option to pin to a version, or specific branch, as well as which project in your workspace to add it to. Once you've made your selections, click the Add Package button.

Step 2: Initialize Segment and add 1Fow Destination

step-2-initialize-segment-and-add-1fow-destination page anchor
1
import Segment1Flow
2
...
3
let config = Configuration(writeKey: "YOUR_WRITE_KEY_HERE")
4
let analytics = Analytics(configuration: config)
5
analytics.add(plugin: OneFlowDestination())

Step 1: Install Segment1Flow Package

step-1-install-segment1flow-package page anchor
  • If gradle version is 6.5 or lower, include the below repository in your project's build.gradle file:
1
allprojects{
2
repositories{
3
google()
4
jcenter()
5
maven{url 'https://jitpack.io'}
6
}
7
}
  • If gradle version is higher than 6.5, add the below code in settings.gradle.
1
dependencyResolutionManagement {
2
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
3
repositories {
4
google()
5
mavenCentral()
6
maven{url 'https://jitpack.io'}
7
}
8
}
  • Add dependency in your app's build.gradle file:
1
compileSdkVersion 34
2
....
3
defaultConfig {
4
....
5
minSdkVersion 21
6
}
7
dependencies {
8
....
9
10
implementation 'com.segment.analytics.android:analytics:4.11.3'
11
implementation "com.github.1Flow-Inc:segment-1flow-android:2023.09.26"
12
}

Step 2: Initialize Segment and add 1Flow Destination

step-2-initialize-segment-and-add-1flow-destination page anchor
1
Analytics analytics = new Analytics.Builder(context, "YOUR_WRITE_KEY_HERE")
2
.use(OneFlowIntegration.FACTORY)
3
...
4
.build();
5
...
6
Analytics.setSingletonInstance(analytics);
7

If you're not familiar with the Segment Specs, take a look to understand what the Identify method does. An example call would look like:

1
analytics.identify(userId: "peter@example.com", traits: [
2
"name": "Peter Gibbons",
3
"email": "peter@example.com",
4
"mobile": 1234567890
5
])

When you call identify method of segment, it will be equivalent to logUser of 1Flow. userId will be userID and traits will be userDetails.

If you're not familiar with the Segment Specs, take a look to understand what the Track method does. An example call would look like:

analytics.track(name: "ButtonClicked")

Any value passed in name, will be eventName and if you have passed any event property, then it will be event parameters.

Send Screen calls to record which mobile app screens users have viewed. For example:

analytics.screen(title: "Home")

Segment sends Screen calls to 1Flow as a screen_[name] event (or screen_view if a screen name isn't provided).


Segment lets you change these destination settings from the Segment app without having to touch any code.

Property nameTypeRequiredDescription
API Keystring

Optional