Games You Play Events

LucraEventListener Setup Guidearrow-up-right

Listening for GYP events

LucraClient().setEventListener(object : LucraEventListener {
    override fun onEvent(event: LucraEvent) {
        when (event) {
            is LucraEvent.GamesContest.Created -> {
                Log.d("Sample", "Contest created: ${event.contestId}")
            }
            is LucraEvent.GamesContest.Accepted -> {
                Log.d("Sample", "Contest accepted: ${event.contestId}")
            }
            is LucraEvent.GamesContest.Canceled -> {
                Log.d("Sample", "Contest canceled: ${event.matchupId}")
            }
            is LucraEvent.GamesContest.Started -> {
                Log.d("Sample", "Contest started: ${event.matchupId}")
            }
            is LucraEvent.GamesContest.StartedActive -> {
                Log.d(
                    "Sample",
                    "Contest started with Active scoring: ${event.matchupId}, matchup: ${event.lucraMatchup}"
                )
            }
        }
    }
})

Event reference

  • GamesContest.Created – Fired immediately after the user creates a Games matchup. Includes contestId so you can cache or deep-link to the matchup.

  • GamesContest.Accepted – Emitted when an invite is accepted (your user or their opponent). Use contestId to refresh state or notify stakeholders.

  • GamesContest.Canceled – Triggered when a matchup is canceled before completion. Carries the matchupId for cleanup or messaging.

  • GamesContest.Started – Signals that the matchup has moved from pending to live play. Useful for starting timers or enabling score entry.

  • GamesContest.StartedActive – Indicates the active matchup, that is being viewed, has started. Meaningful for participants that aren't the creator of the matchup.

Last updated