Skip to content

Add server-driven push notifications via OpenCode plugin #5

@BillSteinUNB

Description

@BillSteinUNB

Summary

Implement server-driven push notifications via an OpenCode server plugin integration to enable reliable background notifications.

Context

Currently, WhisperCode has in-app notification support that fires when:

  • A session completes (agent turn done)
  • An error occurs

However, mobile background notifications are unreliable - the app may be killed or in background mode, causing notifications to be missed. Users have requested more reliable notification delivery.

Problem

  • iOS/Android background push notifications are not consistently delivered
  • App must be in foreground or recently active to show notifications
  • Users miss important events when the app is not running

Proposed Solution

Create a server-side plugin for OpenCode that can send push notifications through a notification service:

  1. Server Plugin - Create an OpenCode server plugin that:

    • Listens for session events (completion, errors, etc.)
    • Sends push notifications to the mobile app via a push service (APNs for iOS, FCM for Android)
    • Supports customizable notification preferences per user
  2. Push Service Integration:

    • Integrate with APNs (Apple Push Notification service) for iOS
    • Integrate with FCM (Firebase Cloud Messaging) for Android (future)
    • Or use a third-party service like OneSignal, Pushwoosh, etc.
  3. Mobile App Changes:

    • Register for push notifications on app launch
    • Handle push payload to navigate to relevant session/project
    • Allow users to configure which events trigger notifications

Technical Considerations

  • The app already has a notification context (useNotification) that tracks session events
  • The OpenCode plugin system has event hooks like event, session.idle, session.error
  • Server needs to store device tokens for each user
  • Consider encryption for sensitive notification payloads
  • Need to handle notification permission flow on iOS

Scope

  • Design server plugin architecture for notification delivery
  • Research and choose push notification provider (native vs third-party)
  • Implement server-side plugin code
  • Update iOS app to register for and handle remote notifications
  • Add settings UI for notification preferences

Related Features

This complements the existing in-app notification system - it doesn't replace it, but provides reliability when the app is in the background.

Labels

  • enhancement
  • infrastructure

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions