Manually Trigger Mobile Flows
Learn the different methods to manually trigger mobile Flows.
Table of Contents
Overview
When a mobile flow has been published, the flow can be triggered based on an app session, screen view, event, or manually. If a flow is set to trigger on app session, screen view, or event, it can also be triggered manually. One way to manually trigger a mobile flow is by using an action on a button in different flow. Flows can also be triggered directly on the client using the appcues.show("flow_id") SDK function call, an Appcues SDK deep link, or a custom app deep link.
Manually triggering with the SDK show function
Developers can trigger a flow directly in the app by using the appcues.show("flow_id") call. This call takes a flow ID, also called an experience ID in the SDK code. The flow ID can be found by navigating to the flow settings, the format of the URL will be like https://studio.appcues.com/mobile/flows/ {flow_id}/settings. With this ID, the show call can be added to the app to trigger the flow based on any desired user interaction. This function ignores any targeting that is set on the flow.
appcues.show("flow_id")
Appcues SDK deep link
An Appcues SDK deep link can be used to open an application and trigger a flow. This can be great for launching an app and triggering a flow from an email or message. This deep link will trigger the flow on the screen that first displays when the app is loaded. This style of deep link uses the App ID and Flow ID. The App ID is listed under Apps & Installation in Appcues Studio. The flow ID can be found in the URL for the flow https://studio.appcues.com/mobile/flows/{flow_id}/settings. These SDK deep links require the installation to be completed successfully with the custom URL scheme of the SDK added to the app. For more information on SDK installation, refer mobile developers to the installation documentation.
appcues-{app_id}://sdk/experience_content/{flow_id}
Custom app deep link
Custom app deep links can be used to open an application and trigger a flow on a particular page. For these deep links a developer will need to add a custom logic in the app that uses the appcues.show("flow_id") call. This type of link is an extension of the functionality discussed in the first section above for the appcues.show("flow_id") function. When this deep link is triggered it will open the application, load a particular screen, and trigger the flow. The coding of the logic for this type of deep link is completely up to the host application, but an example of how you could structure this is shown below.
myapp://settings/profile?flow_id={flow_id}
The myapp://settings/profile portion is an example of a custom scheme myapp:// in the host application, with a path that would route to some page in the app. The app developer would then be able to see an optional flow_id query parameter on the link, and use that ID to call appcues.show("flow_id") after navigating to the desired page in the app.
Pro tip: It's best practice to have some basic deep links already created. For example, if you're building a new feature that you plan to promote, it's a good idea for your engineering team to scope adding a deep link to that feature.
Example use case: push notifications
One great use case for the custom app deep link approach is for driving engagement with your application and mobile flows, through push notifications. If your app sends push notifications to your user base, you could include deep links with the ?flow_id={flow_id} approach noted above. When the user taps on that push notification, they will be sent to a specific destination in your application, then calling appcues.show("flow_id") for the flow parameter provided will launch an Appcues mobile flow from the push notification link.