|
| 1 | + |
| 2 | +# 1Flow Mobile Plugin Destination |
| 3 | + |
| 4 | +1Flow is a leading in-app user survey and messaging platform for Mobile app and SaaS businesses. |
| 5 | + |
| 6 | +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 |
| 7 | + |
| 8 | +This destination is maintained by 1Flow. For any issues with the destination, [contact Support team ](mailto:[email protected]). |
| 9 | + |
| 10 | +## Getting started |
| 11 | + |
| 12 | +#### If gradle version is 6.5 or lower, include the below repository in your project's build.gradle file: |
| 13 | +``` |
| 14 | +allprojects{ |
| 15 | + repositories{ |
| 16 | + google() |
| 17 | + jcenter() |
| 18 | + maven{url 'https://jitpack.io'} |
| 19 | + } |
| 20 | +} |
| 21 | +``` |
| 22 | + |
| 23 | +#### If gradle version is higher than 6.5, add the below code in settings.gradle |
| 24 | +``` |
| 25 | + dependencyResolutionManagement { |
| 26 | + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) |
| 27 | + repositories { |
| 28 | + google() |
| 29 | + mavenCentral() |
| 30 | + maven{url 'https://jitpack.io'} |
| 31 | + } |
| 32 | +} |
| 33 | +``` |
| 34 | + |
| 35 | +### Add dependency in your app's build.gradle file: |
| 36 | +``` |
| 37 | +compileSdkVersion 34 |
| 38 | +.... |
| 39 | +defaultConfig { |
| 40 | + .... |
| 41 | + minSdkVersion 21 |
| 42 | + } |
| 43 | +dependencies { |
| 44 | + .... |
| 45 | + implementation 'com.segment.analytics.android:analytics:4.11.3' |
| 46 | + implementation 'com.github.1Flow-Inc:segment-1flow-android:2023.09.16' |
| 47 | +} |
| 48 | +``` |
| 49 | + |
| 50 | +### Initialize Segment and Add 1Fow Destination |
| 51 | +```java |
| 52 | +Analytics analytics = new Analytics.Builder(context, "YOUR_WRITE_KEY_HERE") |
| 53 | + .use(OneFlowIntegration.FACTORY) |
| 54 | + ... |
| 55 | + .build(); |
| 56 | + ... |
| 57 | + Analytics.setSingletonInstance(analytics); |
| 58 | +``` |
| 59 | +## Supported methods |
| 60 | + |
| 61 | +### Identify |
| 62 | +An example call would look like: |
| 63 | + |
| 64 | +```java |
| 65 | +Analytics.with(context) .identify( "[email protected]", new Traits() .putName( "Peter Gibbons"), null); |
| 66 | +``` |
| 67 | +When you call identify method of segment, it will be equivalent to `logUser` of 1Flow. `userId` will be `userID` and `traits` will be `userDetails`. |
| 68 | + |
| 69 | +### Track |
| 70 | +An example call would look like: |
| 71 | + |
| 72 | +```java |
| 73 | +Analytics.with(context).track("ButtonClicked"); |
| 74 | +``` |
| 75 | +Any value passed in `name`, will be eventName and if you have passed any event property, then it will be event `parameters`. |
| 76 | + |
| 77 | +### Screen |
| 78 | + |
| 79 | +Send Screenview events to record which mobile app screens users have viewed. For example: |
| 80 | + |
| 81 | +```java |
| 82 | +Analytics.with(context).screen(null, "Home"); |
| 83 | +``` |
| 84 | + |
| 85 | +Segment sends Screen calls to 1Flow as a `screen_[name]` event (or `screen_view` if a screen name isn't provided). |
0 commit comments