Bilateral Relationship

We’re trying to implement a Bilateral relationship feature in our app using Amity, but we cannot figure out to made it.
To be clearer, what we wanna achieve is a friendship system like Facebook:
User A sends a friend request to User B, if B accepts, A follows B and B follows A.
Using API seems to be impossible, we figure out a dirty way to do it by frontend:
A send friend request to B, if B accepts → A follows B and B automatically send a request to A.
When A will login in, there will be a check: if there is a friend request in pending status of a user A already follows, then it will be accepted automatically.
That’s not totally working, cause since A login again can pass a lot of time and in this meanwhile there won’t be a bidirectional following, this may cause unexpected bugs.
Do we have any other options?

Hello, please see another possible solution below:

  1. When user register / login => Create a community per user. This will serves as a place for friend requests.
  2. When A add B as a friend => Create a custom post to B’s community.
  3. If B clicks accept => The system should automatically extracted the postedUserId and then call follow function for B.
  4. Create postedUserId’s session and use received accessToken to call follow API to simulate B follow back A.
  5. Once everything’s complete. Call delete post to simulate delete friend request when done.

Please note that all these information will be available on console as well.