Introduction
Sometimes it can be handy to trigger a survey or announcement popup directly in code. You can trigger a flow manually to:
- Test a live flow before launching to all users
- Debug any issues
- Trigger a persistent feedback form from a button/link in your app
This guide shows you how to do this easily.
Get Flow ID
The
flow_id
can be copied from the URL of your survey page, e.g. f29a3ee75b33208ccb86abae
in the below image.Start Flow Method
You can manually start any active flow (published, currently turned on) in your project by calling the startFlow method. This wouldn’t work if you turn off the flow or haven’t published it yet.
Calling this manually would ignore any target audience filters you set for the survey or announcement flow. As long as the flow is found in your current project and is in active status, it will show immediately.
JavaScript
There are two ways to invoke this method:
javascript_1flow.start("flow_id");
javascriptwindow._1flow("start", "flow_id");
iOS
swiftOneFlow.startFlow("flow_id");
Android
kotlinOneFlow.startFlow("flow_id");
React Native
javascriptawait OneFlow.startFlow("flow_id");
Flutter
dartimport 'package:flutter_1flow_sdk/flutter_1flow_sdk.dart'; try { OneFlow.startFlow("flow_id"); } on PlatformException { print('startFlow: error occured'); }