Skip to content

Get notified when receiving a new real time game challenge #438

@veloce

Description

@veloce

This is not related to correspondence game challenges, they work differently and are received through a push notification.

Here it need a persistent websocket connection with the following specifics:

  • should be open when the app has focus and closed when the app is in background
  • it should listen to the challenges event to be aware of new challenges

Opening a persistent websocket connection is also the way to notify other users that the player is online. Closing #404 thus.

We'll also need a challengesProvider, which is a NotifierProvider.

Upon receiving a new challenge one should:

  • display a notification, using the flutter_local_notifications plugin
  • have a "decline" action button in the notification (clicking on the notification would mean accepting the challenge)
  • update the challengesProvider state

The challenges message always contains the current list of all challenges, so we're notified when a challenge has been cancelled. When a challenge is canceled:

  • cancel the corresponding challenge notification
  • update the challengesProvider state

Metadata

Metadata

Assignees

No one assigned

    Labels

    cat: challengesChallenging a player, viewing the challenges, etc.cat: dataState management, data modelling, etc. Not related to UI.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions