> ## Documentation Index
> Fetch the complete documentation index at: https://learn.social.plus/llms.txt
> Use this file to discover all available pages before exploring further.

# Check My Followers

> Check which of the users your app shows follow the current user, up to 100 users in one call, to show Follows you and Follow back.

Show **Follows you** next to users in your app, such as people in someone else's followers or following list, on a profile, or post authors. When the current user taps **Follow**, you can also check whether that person already follows the current user. `getMyFollowers(userIds)` takes up to 100 user IDs and answers, in one call, which of them follow the current user, each with its status, `accepted` or `pending`. To show **Follow back**, combine it with [`getAllFollowings()`](./get-all-followings), which tells you whether the current user follows them.

| API | Best for | Returns |
| - | - | - |
| `getMyFollowers(userIds)` | Checking whether specific users follow the current user, such as the users on a screen | User IDs and follow statuses for the listed users who follow the current user. No user objects. |
| Follower list query — `getMyFollowers()` (Android), `getMyFollowers(with:)` (iOS), `getFollowers()` (TypeScript) | Showing the current user's followers, with user profiles, page by page | Follow relationships with the follower's user object, page by page, as a live collection |

> [!NOTE]
>
> `getMyFollowers(userIds)` checks follow status. It returns user IDs and statuses only, not users: no names, avatars or other profile data, and no pages. Take those from the users your app already shows.
>
> On Android and iOS it shares its name with the follower list. Pass user IDs to run this check. Call it without user IDs (Android) or with a query option (iOS) to get the follower list, which returns each follower's user object, page by page. Use the list to show the current user's followers. See [Get Follower/Following List](https://learn.social.plus/social-plus-sdk/social/user-relationship/following/get-follower-following-list.md).

## Parameters

| Parameter | Type | Required | Platforms | Description |
| - | - | - | - | - |
| `userIds` | `List<String>` (Android); `[String]` (iOS); `string[]` (TypeScript, React Native) | Yes | Android, iOS, TypeScript, React Native | The IDs of up to 100 users to check. An empty list returns an empty result without a network request. More than 100 IDs, an empty ID, or an ID longer than 128 characters fails with a parameter error. |

Each item in the result has two fields:

| Field | Type | Description |
| - | - | - |
| `userId` | `String` | The ID of a listed user who follows the current user. Match it against the user IDs you sent. |
| `status` | `AmityFollowStatus` (Android, iOS); `'accepted' \| 'pending'` (TypeScript, React Native) | `accepted` — the user follows the current user. `pending` — the user asked to follow the current user and the request waits for the current user to accept. |

A listed user who is not in the result does not follow the current user. That includes a user ID that doesn't exist, a deleted user, a user the current user has blocked, and the current user's own ID. An unknown ID doesn't cause an error: the call still answers for the other IDs, and if none of the IDs is a known user, the result is empty. Only `accepted` means the user follows the current user; treat `pending` as not following yet.

The method has no status filter. It always returns `accepted` and `pending` together, with each user at most once, most recently changed first. If follow requests are turned off for your network, every entry is `accepted`.

## Check One User

When the current user taps **Follow**, or opens a profile, check that one user. Send a list with the user's ID, then look for an `accepted` entry. This tells you, for example, whether the person was already a follower when the current user followed them, which you can record in your own analytics.

Check before you call `follow`, so the answer describes the moment of the tap.

```kotlin Android theme={null}
val relationship = AmityCoreClient.newUserRepository().relationship()

fun onFollowTapped(userId: String) {
    val disposable = relationship.getMyFollowers(listOf(userId))
        .map { followers -> followers.any { it.userId == userId && it.status == AmityFollowStatus.ACCEPTED } }
        .flatMap { wasAlreadyFollower ->
            relationship.follow(userId = userId).map { wasAlreadyFollower }
        }
        .subscribe(
            { wasAlreadyFollower ->
                logFollowEvent(userId, wasAlreadyFollower)
            },
            { error ->
                handleGeneralError(error)
            },
        )
}
```

```swift iOS theme={null}
let relationship = AmityUserRelationship()

func followTapped(userId: String) async {
    do {
        let followers = try await relationship.getMyFollowers(userIds: [userId])
        let wasAlreadyFollower = followers.contains { $0.userId == userId && $0.status == .accepted }

        _ = try await relationship.follow(withUserId: userId)
        logFollowEvent(userId: userId, wasAlreadyFollower: wasAlreadyFollower)
    } catch {
        handleError(error)
    }
}
```

```typescript TypeScript theme={null}
import { UserRepository } from '@amityco/ts-sdk';

async function onFollowTapped(userId: string) {
  const followers = await UserRepository.Relationship.getMyFollowers([userId]);
  const wasAlreadyFollower = followers.some((f) => f.userId === userId && f.status === 'accepted');

  await UserRepository.Relationship.follow(userId);
  logFollowEvent(userId, wasAlreadyFollower);
}
```

## Check a List of Users

When you show a list of users, such as someone else's [followers or following list](https://learn.social.plus/social-plus-sdk/social/user-relationship/following/get-follower-following-list.md) or the authors of posts, collect the IDs of the users on screen, call `getMyFollowers(userIds)` once, and look up each user in the result. To choose each user's button, combine it with [`getAllFollowings()`](./get-all-followings), which tells you whether the current user follows them:

| The user follows the current user (`getMyFollowers`) | The current user follows the user (`getAllFollowings`) | Show |
| - | - | - |
| Any | `pending` | **Pending** |
| `accepted` | No | **Follows you** and **Follow back** |
| `accepted` | `accepted` | **Follows you** and **Following** |
| Missing or `pending` | No | **Follow** |
| Missing or `pending` | `accepted` | **Following** |

`getAllFollowings()` returns up to 5,000 follows. If the current user has more, a user missing from it may still be followed or have a pending request. See [Get All Followings](https://learn.social.plus/social-plus-sdk/social/user-relationship/following/get-all-followings.md).

```kotlin Android theme={null}
val relationship = AmityCoreClient.newUserRepository().relationship()
val userIds = usersOnScreen.map { it.getUserId() }.distinct()

val disposable = Single.zip(
    relationship.getMyFollowers(userIds),
    relationship.getAllFollowings(),
) { followers, followings -> followers to followings }
    .subscribe(
        { (followers, followings) ->
            val followsMe = followers.filter { it.status == AmityFollowStatus.ACCEPTED }.map { it.userId }.toSet()
            val myStatus = followings.associate { it.userId to it.status }

            usersOnScreen.forEach { user ->
                val id = user.getUserId()
                when {
                    myStatus[id] == AmityFollowStatus.PENDING -> showPendingButton(user)
                    myStatus[id] == AmityFollowStatus.ACCEPTED -> showFollowingButton(user)
                    id in followsMe -> showFollowBackButton(user)
                    else -> showFollowButton(user)
                }
            }
        },
        { error ->
            handleGeneralError(error)
        },
    )
```

```swift iOS theme={null}
let relationship = AmityUserRelationship()

do {
    let userIds = Array(Set(usersOnScreen.map(\.userId)))
    let followers = try await relationship.getMyFollowers(userIds: userIds)
    let followsMe = Set(followers.filter { $0.status == .accepted }.map(\.userId))

    let followings = try await relationship.getAllFollowings()
    let myStatus = Dictionary(uniqueKeysWithValues: followings.map { ($0.userId, $0.status) })

    for user in usersOnScreen {
        if myStatus[user.userId] == .pending {
            showPendingButton(for: user)
        } else if myStatus[user.userId] == .accepted {
            showFollowingButton(for: user)
        } else if followsMe.contains(user.userId) {
            showFollowBackButton(for: user)
        } else {
            showFollowButton(for: user)
        }
    }
} catch {
    handleError(error)
}
```

```typescript TypeScript theme={null}
import { UserRepository } from '@amityco/ts-sdk';

const userIds = [...new Set(usersOnScreen.map((user) => user.userId))];
const followers = await UserRepository.Relationship.getMyFollowers(userIds);
const followsMe = new Set(followers.filter((f) => f.status === 'accepted').map((f) => f.userId));

const followings = await UserRepository.Relationship.getAllFollowings();
const myStatus = new Map(followings.map((f) => [f.userId, f.status]));

usersOnScreen.forEach((user) => {
  if (myStatus.get(user.userId) === 'pending') showPendingButton(user);
  else if (myStatus.get(user.userId) === 'accepted') showFollowingButton(user);
  else if (followsMe.has(user.userId)) showFollowBackButton(user);
  else showFollowButton(user);
});
```

## Show Follow Buttons on a Feed

A common use is the follow button on each post in a feed: show **Follow back** on authors who already follow the current user. Check the authors one page at a time, as the feed loads:

1. When a page of posts loads, collect the author IDs, remove duplicates, and skip authors you have already checked.
2. Call `getMyFollowers(userIds)` with up to 100 IDs at a time. With more than 100, the call fails with a parameter error: the SDK does not split or cut the list, so no author is wrongly reported as not following.
3. Keep the answers in your own map: `true` for each `accepted` author and `false` for every other ID you sent. A missing key means "not checked yet". If a call fails, leave its IDs unchecked so the next page load checks them again.
4. Call [`getAllFollowings()`](./get-all-followings) to know whom the current user follows, then choose each post's button.

| The current user follows the author (`getAllFollowings`) | The author follows the current user (your map) | Show |
| - | - | - |
| `pending` | Any | **Pending** |
| `accepted` | Any | **Following** |
| No | `true` | **Follow back** |
| No | `false` or not checked yet | **Follow** |

Hide the button on the current user's own posts.

```kotlin Android theme={null}
val relationship = AmityCoreClient.newUserRepository().relationship()
val followsMe = mutableMapOf<String, Boolean>() // author ID → follows the current user; missing = not checked yet

// Call when a page of posts loads.
fun updateFollowButtons(posts: List<AmityPost>) {
    val unchecked = posts.map { it.getCreatorId() }.distinct().filter { it !in followsMe }
    val checks = unchecked.chunked(100).map { batch ->
        relationship.getMyFollowers(batch)
            .doOnSuccess { followers ->
                val accepted = followers.filter { it.status == AmityFollowStatus.ACCEPTED }.map { it.userId }.toSet()
                batch.forEach { followsMe[it] = it in accepted }
            }
            .ignoreElement()
            .onErrorComplete() // leave this batch unchecked; the next page load checks it again
    }

    val disposable = Completable.concat(checks)
        .andThen(relationship.getAllFollowings())
        .subscribe(
            { followings ->
                val myStatus = followings.associate { it.userId to it.status }
                posts.forEach { post ->
                    val authorId = post.getCreatorId()
                    when {
                        myStatus[authorId] == AmityFollowStatus.PENDING -> showPendingButton(post)
                        myStatus[authorId] == AmityFollowStatus.ACCEPTED -> showFollowingButton(post)
                        followsMe[authorId] == true -> showFollowBackButton(post)
                        else -> showFollowButton(post)
                    }
                }
            },
            { error ->
                handleGeneralError(error)
            },
        )
}
```

```swift iOS theme={null}
let relationship = AmityUserRelationship()
var followsMe: [String: Bool] = [:] // author ID → follows the current user; missing = not checked yet

// Call when a page of posts loads.
@MainActor
func updateFollowButtons(for posts: [AmityPost]) async {
    let unchecked = Array(Set(posts.map(\.postedUserId))).filter { followsMe[$0] == nil }
    for start in stride(from: 0, to: unchecked.count, by: 100) {
        let batch = Array(unchecked[start..<min(start + 100, unchecked.count)])
        // Leave a failed batch unchecked; the next page load checks it again.
        guard let followers = try? await relationship.getMyFollowers(userIds: batch) else { continue }
        let accepted = Set(followers.filter { $0.status == .accepted }.map(\.userId))
        batch.forEach { followsMe[$0] = accepted.contains($0) }
    }

    do {
        let followings = try await relationship.getAllFollowings()
        let myStatus = Dictionary(uniqueKeysWithValues: followings.map { ($0.userId, $0.status) })

        for post in posts {
            let authorId = post.postedUserId
            if myStatus[authorId] == .pending {
                showPendingButton(for: post)
            } else if myStatus[authorId] == .accepted {
                showFollowingButton(for: post)
            } else if followsMe[authorId] == true {
                showFollowBackButton(for: post)
            } else {
                showFollowButton(for: post)
            }
        }
    } catch {
        handleError(error)
    }
}
```

```typescript TypeScript theme={null}
import { UserRepository } from '@amityco/ts-sdk';

const followsMe = new Map<string, boolean>(); // author ID → follows the current user; missing = not checked yet

// Call when a page of posts loads.
async function updateFollowButtons(posts: Amity.Post[]) {
  const unchecked = [...new Set(posts.map((post) => post.postedUserId))].filter((id) => !followsMe.has(id));

  for (let start = 0; start < unchecked.length; start += 100) {
    const batch = unchecked.slice(start, start + 100);
    try {
      const followers = await UserRepository.Relationship.getMyFollowers(batch);
      const accepted = new Set(followers.filter((f) => f.status === 'accepted').map((f) => f.userId));
      batch.forEach((id) => followsMe.set(id, accepted.has(id)));
    } catch {
      // Leave this batch unchecked; the next page load checks it again.
    }
  }

  const followings = await UserRepository.Relationship.getAllFollowings();
  const myStatus = new Map(followings.map((f) => [f.userId, f.status]));

  posts.forEach((post) => {
    const authorId = post.postedUserId;
    if (myStatus.get(authorId) === 'pending') showPendingButton(post);
    else if (myStatus.get(authorId) === 'accepted') showFollowingButton(post);
    else if (followsMe.get(authorId)) showFollowBackButton(post);
    else showFollowButton(post);
  });
}
```

On Android, a paged feed comes as Paging 3 `PagingData`, which hands posts to the list one at a time, so there is no single "page loaded" list to pass in. Run the check from the screen instead: read the loaded posts from `itemSnapshotList`, and call `updateFollowButtons` once scrolling settles, so a fast scroll doesn't send many small calls. Only loaded posts are checked; posts further down are checked when they load. For Paging 3 with the SDK, see [Observe a Paged Live Collection](https://learn.social.plus/social-plus-sdk/core-concepts/realtime-communication/live-objects-collections/android.md#observe-a-paged-live-collection).

```kotlin Android theme={null}
@OptIn(FlowPreview::class)
@Composable
fun CheckAuthorsOnScreen(posts: LazyPagingItems<AmityPost>) {
    LaunchedEffect(posts) {
        snapshotFlow { posts.itemSnapshotList.items }
            .debounce(300) // wait until scrolling settles
            .collect { loaded -> updateFollowButtons(loaded) }
    }
}
```

On pull to refresh, clear `followsMe` before you call `updateFollowButtons` again, so every author is checked again. After the current user taps a button, call `updateFollowButtons` again for the posts on screen: `getAllFollowings()` already includes the change, so the button updates without checking the authors again.

## Keep Follower Status Current

`getMyFollowers(userIds)` is a one-time call, not a live collection. It keeps nothing on the device and does not notify you when someone follows or unfollows the current user. Each call sends a new request, so call it again when you need fresh answers, for example when the screen reloads or on pull to refresh. Clear your own map first, so every user is checked again.

If the request fails, the call emits an error (Android), throws (iOS), or rejects (TypeScript, React Native) with the server's error.

## Platform Notes

| Platform | Method | Result type |
| - | - | - |
| Android | `AmityCoreClient.newUserRepository().relationship().getMyFollowers(userIds)` | `Single<List<AmityFollowerUserStatus>>`. Requires Android SDK 7.36.0 or later. |
| iOS | `AmityUserRelationship().getMyFollowers(userIds:)` | `@MainActor async throws -> [AmityFollowerUserStatus]`: call it from the main actor, as with `getAllFollowings()`. Requires iOS SDK 8.14.0 or later. |
| TypeScript | `UserRepository.Relationship.getMyFollowers(userIds)` | `Promise<Amity.FollowerUserStatus[]>`. Requires TypeScript SDK 7.35.0 or later. |
| React Native | `UserRepository.Relationship.getMyFollowers(userIds)` | `Promise<Amity.FollowerUserStatus[]>`, the same as TypeScript: the React Native SDK takes the TypeScript SDK's code. |

Not available on Flutter.

## Related Topics

> [card] [Get All Followings](https://learn.social.plus/social-plus-sdk/social/user-relationship/following/get-all-followings.md)
>
> Check whether the current user follows a user.

> [card] [Get Follower/Following List](https://learn.social.plus/social-plus-sdk/social/user-relationship/following/get-follower-following-list.md)
>
> Page through followers and followings with user profiles.

> [card] [Follow/Unfollow User](https://learn.social.plus/social-plus-sdk/social/user-relationship/following/follow-unfollow-user.md)
>
> Follow back a user who follows the current user.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.