For achieving successful social networking, the ability to follow and unfollow users is a fundamental feature. This blog post looks into the concept of user relationships and the methods to establish these connections in your application. We will explore the one-directional relationship model and the two methods provided by our SDK to create these relationships — with and without a request process.
Whether you’re looking to implement a follow request system or an automatic connection establishment, this guide will provide you with the necessary knowledge and tools. So, get ready to enhance your application’s social features and user engagement.
Before we dive into the details, here are some pre-requisites you need to have:
- Basic understanding of social networking concepts.
- Familiarity with SDKs and how they work.
- An Amity Social Cloud Portal account
- An Amity Social Cloud Console Account
- A UI or access to Amity Social Cloud UI Kits
Note: If you haven’t already registered for an Amity Social Cloud account, we recommend following our comprehensive step-by-step guide in the Amity Portal to create your new network.
Understanding User Relationship Concept
In most social networks, user relationships are one-directional. This means that if user A follows user B, it doesn’t necessarily mean that user B also follows user A. This is the model that our SDK uses. It’s a simple yet effective way to create connections between users, which are essential for determining the visibility and accessibility of data in user feeds and global feed.
User Connection Methods
Our SDK provides two methods to create relationships between users:
- With request process: In this method, a user sends a “Follow” action to another user. The system then sends a request to the target user. The connection is not established until the target user accepts the follow request. This method is useful when you want to give users control over who can follow them.
- Without request process: In this method, a user sends a “Follow” action to another user, and the system automatically establishes the connection. This method is useful when you want to make the process of following other users seamless and quick.
The default connection method is the “With request process”. However, you can change this by contacting our support team.
Implementing the Follow/Unfollow Feature
Here are the steps to implement the follow/unfollow feature in your app:
- Integrate the SDK: The first step is to integrate our SDK into your application. This will provide you with the necessary tools and functions to implement the follow/unfollow feature.
- Choose the connection method: Decide whether you want to use the “With request process” method or the “Without request process” method. This will depend on the nature of your app and the level of control you want to give to your users.
- Implement the “Follow” action: Once you’ve chosen the connection method, you can implement the “Follow” action. This action will trigger the system to either send a follow request or automatically establish a connection.
- Implement the “Unfollow” action: Similarly, you need to implement the “Unfollow” action. This action will allow users to remove existing connections.
- Test the feature: Finally, make sure to thoroughly test the feature to ensure it works as expected. Check both the “Follow” and “Unfollow” actions, and make sure the connections are correctly established and removed.
Implementing a follow/unfollow feature in your app can significantly enhance its social aspects and increase user engagement. By understanding the user relationship concept and the connection methods provided by Amity Social Cloud SDK, you can implement this feature effectively and efficiently. Remember, the key is to choose the right connection method that suits your app’s nature and your users’ preferences.