“Did it hurt when you fell from heaven?” — Anonymous
Just like that pickup line, dating apps are getting insipid. Dating apps do an amazing job of matching users based on their interests, hobbies, taste, etc. But to keep the user engaged, it takes more than just finding them a match.
User interaction is the key to user engagement. If “less is more,” then less text means more interaction. In order to get to know someone, you need more than texting and looking at their photos (assuming that they in fact use their own photos).
In this tutorial, I will walk you through a use case where video calling can be integrated into a dating app to increase user engagement — and thus enable the user to find a good match.
If you’re new to Flutter, install the Flutter SDK from here.
To begin with, I have created a simple login/signup form that takes two inputs: email ID and password. You can customize this interface for your needs.
Here, I am using Firebase for user authentication and to save the user profile. The user profile consists of:
For the sake of this demo, I have taken a small example of six categories from which people can select and complete their profile. These interests are then matched with all the users in the database. If two users have shared interests, they are added to the same list.
To find a match for a user, I map their interests with the interests of the other users. Users whose interests overlap are matched and added to a matchedUsers
list with their UID and availability status.
Before joining the video call with the matched users, I have added a screen to test your device camera and microphone.
For testing the camera, we initialize the Agora RtcEngine and then use the startPreview()
method.
For testing the microphone, I use another plug-in, mic_stream
, which returns the level of audio received by the microphone. Using this, we make audio bars to represent the state of the microphone.
For the call page, I have gone with a UI similar to Tinder, where the users can swipe right or left depending on whether they like the person on the screen or not.
So we will begin by setting up the video view for the local and remote users. Here, we have gone with a simple UI where the local user screen is stacked on top of the remote user view.
Video View
This video call between the two users occurs in a Tinder UI fashion. So as soon as a person swipes the other user right or left, they join a call with another matched user. For the Tinder-like UI, we are using a plug-in called tcard.
Agora Video Call Cards
Here’s what happens when a user swipes right or left:
Left Swipe
Right Swipe
For all the users that have been swiped right, we maintain a likedUsers
list that holds the UID of all these users. This UID helps us join an RTM channel with a user so that we can send them messages after the call has ended.
To set up the RTM SDK follow these steps:
RtmChannel
and RtmClient
objects and then initialize them using an App ID, a token, and a channel name.Initializing the RTM SDK
RTM Login
Join a RTM channel
sendMessage
method to send a message to a channel.Send a RTM message
Leave RTM Channel
Before you build the app, make sure that you did the following:
Combining RTC and RTM creates a lot of possibilities. In this tutorial, we have seen one of the biggest engagement apps: speed dating, where two random people are matched based on their interests and are added to an RTC channel.
You can find the complete code for this application here.
To learn more about the Agora Flutter SDK and other use cases, see the developer guide here.
You can also have a look at the complete documentation for the functions discussed above and many more here.
And I invite you to join the Agora Developer Slack Community.