---
title: "Bet Sharing"
canonical_url: "https://apidocs.sportradar.com/resources/virtual-stadium/docs/sdk/centralHub/betSharing"
markdown_url: "https://apidocs.sportradar.com/resources/virtual-stadium/docs/sdk/centralHub/betSharing.md"
last_updated: "2026-04-16T10:19:11Z"
---

# Bet Sharing

Share betslips with the Central Hub community and load shared bets from the community feed.

## Creating Bet Shares

Use `CentralHubBetShareProvider` when you want to publish a betslip with an optional comment and optional stake visibility.

**Android**

```kotlin
class CentralHubViewModel : ViewModel(), KoinComponent {

    private val betShareProvider: CentralHubBetShareProvider = get()

    suspend fun shareBet(
        betPayload: BetPayload,
        comment: String?,
        showStake: Boolean,
    ) {
        betShareProvider.createBetShare(
            betPayload = betPayload,
            comment = comment,
            showStake = showStake,
            onSuccess = { /* Handle success */ },
            onFailure = { error -> /* Handle error */ },
        )
    }
}
```

**iOS**

```swift
class CentralHubViewModel: ObservableObject {

    private let betShareProvider =
        KoinHelper().getCentralHubBetShareProvider()

    func shareBet(
        betPayload: BetPayload,
        comment: String?,
        showStake: Bool
    ) async {
        await betShareProvider.createBetShare(
            betPayload: betPayload,
            comment: comment,
            showStake: showStake,
            onSuccess: { /* Handle success */ },
            onFailure: { error in /* Handle error */ }
        )
    }
}
```

## Browsing Shared Bets

Use `CentralHubBetsProvider` to load and paginate shared betslips.

The provider supports:

- filtering,
- sorting, and
- incremental loading for larger feeds.

### Filter Options

- `BetShareFilterType.ALL` — show every shared bet.
- `BetShareFilterType.FOLLOWERS_BETS` — show only bets shared by followed users.
- `BetShareFilterType.MY_SHARED_BETS` — show only the signed-in user's shared bets.
- `BetShareFilterType.MY_CONVERSATIONS` — show bets where the user has joined the conversation.
- `BetShareFilterType.WINNING_BETS` — show only winning bet shares.

### Sort Options

- `BetShareSortType.CREATED` — sort by creation time.
- `BetShareSortType.COMMENT_COUNT` — sort by most commented.
- `BetShareSortType.COPY_COUNT` — sort by most copied.

**Android**

```kotlin
class BetsViewModel : ViewModel(), KoinComponent {

    private val betsProvider: CentralHubBetsProvider = get()

    val betsState = betsProvider.state

    fun loadBets(
        filterType: BetShareFilterType,
        sortType: BetShareSortType,
    ) {
        betsProvider.loadBetShares(filterType, sortType)
    }

    fun loadMore(
        filterType: BetShareFilterType,
        sortType: BetShareSortType,
    ) {
        betsProvider.loadMoreBetShares(filterType, sortType)
    }
}
```

```kotlin
@Composable
fun BetsFeed(viewModel: BetsViewModel = viewModel()) {
    val state by viewModel.betsState.collectAsStateWithLifecycle()

    LazyColumn {
        items(state.sharedBets) { betShare ->
            BetShareCard(betShare)
        }

        if (!state.allDataLoaded) {
            item {
                LoadMoreButton {
                    viewModel.loadMore(
                        BetShareFilterType.ALL,
                        BetShareSortType.CREATED,
                    )
                }
            }
        }
    }
}
```

**iOS**

```swift
class BetsViewModel: ObservableObject {

    private let betsProvider =
        KoinHelper().getCentralHubBetsProvider()

    @Published var betsState: CentralHubBetsState?

    init() {
        subscribeToBets()
    }

    private func subscribeToBets() {
        betsProvider.state.subscribe { [weak self] state in
            self?.betsState = state
        }
    }

    func loadBets(
        filterType: BetShareFilterType,
        sortType: BetShareSortType
    ) {
        betsProvider.loadBetShares(
            filterType: filterType,
            sortType: sortType
        )
    }
}
```

## Data Models

### BetShare

```kotlin
data class BetShare(
    val id: String,
    val messageId: String?,
    val channelId: String?,
    val content: String,
    val numOfUnreadComments: Int,
    val numOfAllComments: Int,
    val userFollowersCount: Int?,
    val betPayload: BetPayload,
    val isMy: Boolean,
    val betShareCopyCount: Int,
    val user: User,
    val createdAt: Long,
    val showStake: Boolean,
    val comments: List<MessageReply>,
    val reactions: List<Reaction>,
)
```

### CentralHubBetsState

```kotlin
data class CentralHubBetsState(
    val sharedBets: List<BetShare>,
    val loadingState: LoadingStatus,
    val previousPageLoadingStatus: LoadingStatus,
    val allDataLoaded: Boolean,
)
```

## Related Topics

- [Copying Bets](https://apidocs.sportradar.com/resources/virtual-stadium/docs/sdk/centralHub/betCopying.md) - Copy shared bets to your bet slip.
- [Comments & Reactions](https://apidocs.sportradar.com/resources/virtual-stadium/docs/sdk/centralHub/commentsAndReactions.md) - Engage with shared bets.
- [Notifications](https://apidocs.sportradar.com/resources/virtual-stadium/docs/sdk/centralHub/notifications.md) - Get notified about new bet shares.
