Skip to main content

Video Push Notifications

Keep your audience engaged with intelligent push notifications for live streams, broadcast events, and viewer interactions. Get notified when streams start, viewers join, or important stream events occur.

Overview

social.plus Video SDK provides comprehensive push notification capabilities specifically designed for live streaming applications. Support both direct delivery for quick implementation and webhook integration for custom notification processing.

Stream-Specific Notifications

  • Stream Lifecycle - Start, end, and status change notifications
  • Viewer Activity - Join, leave, and viewer count updates
  • Broadcast Events - Connection issues, quality changes, and technical alerts
  • Interactive Features - Chat messages, reactions, and viewer engagement
  • Recording Status - Recording start, stop, and availability notifications
  • Cross-platform Support - iOS, Android, React Native, Flutter, and Web

Notification Types

Stream Lifecycle Events

EventWhen TriggeredDefault Message
stream.startedStream goes live” is now live!”
stream.endedStream stops” stream has ended”
stream.scheduledScheduled stream reminder” goes live in 15 minutes”

Viewer Activity

EventWhen TriggeredDefault Message
viewer.joinedNew viewer joins” joined the stream”
viewer.milestoneViewer count milestonesβ€πŸŽ‰ viewers watching!”
viewer.followViewer follows broadcaster” followed you”

Broadcasting Alerts

EventWhen TriggeredDefault Message
broadcast.quality_lowStream quality drops”Stream quality decreased”
broadcast.reconnectedConnection restored”Stream connection restored”
broadcast.errorCritical broadcast error”Stream encountered an error”

Recording Events

EventWhen TriggeredDefault Message
recording.startedRecording begins”Recording started”
recording.completedRecording ready”Your stream recording is ready”
recording.failedRecording error”Recording failed to save”

Platform Implementation

Setup APNs for Video Notifications
  1. Configure APNs Certificate
import Social_Video

// Register for video-specific notifications
VideoNotificationManager.shared.register(for: [
    .streamStarted,
    .viewerJoined, 
    .broadcastAlert,
    .recordingReady
])
  1. Handle Stream Notifications
// AppDelegate.swift
func application(_ application: UIApplication, 
                 didReceiveRemoteNotification userInfo: [AnyHashable: Any]) {
    
    if let streamId = userInfo["stream_id"] as? String,
       let eventType = userInfo["event_type"] as? String {
        
        switch eventType {
        case "stream.started":
            // Navigate to live stream
            navigateToStream(streamId)
            
        case "viewer.joined":
            // Update viewer count UI
            updateViewerCount()
            
        case "recording.completed":
            // Show recording available
            showRecordingAlert()
            
        default:
            break
        }
    }
}
  1. Custom Notification Handling
VideoNotificationManager.shared.configure { notification in
    notification.sound = .default
    notification.badge = 1
    
    // Custom title based on stream type
    if notification.streamType == "live" {
        notification.title = "πŸ”΄ \(notification.broadcasterName) is LIVE"
    }
    
    return notification
}

Webhook Integration

For advanced customization, integrate with webhooks to process stream events before sending notifications:
// Webhook endpoint handler
app.post('/video-webhooks', (req, res) => {
  const { event_type, stream_id, data } = req.body;
  
  switch (event_type) {
    case 'stream.started':
      // Custom logic for stream start
      sendCustomStreamNotification(stream_id, data);
      break;
      
    case 'viewer.milestone':
      // Celebrate viewer milestones
      if (data.viewer_count % 100 === 0) {
        sendMilestoneNotification(stream_id, data.viewer_count);
      }
      break;
      
    case 'recording.completed':
      // Process recording completion
      processRecordingNotification(stream_id, data.recording_url);
      break;
  }
  
  res.status(200).send('OK');
});

Configuration Options

Configure notification behavior and appearance:
// Global video notification configuration
VideoNotifications.configure({
  // Delivery settings
  directPush: true,
  webhookUrl: 'https://your-server.com/video-webhooks',
  
  // Event subscriptions
  events: {
    streamStarted: true,
    streamEnded: true,
    viewerJoined: false, // Disable viewer join notifications
    viewerMilestone: true,
    recordingReady: true,
    broadcastAlerts: true
  },
  
  // Notification appearance
  appearance: {
    showBroadcasterAvatar: true,
    useStreamThumbnail: true,
    showViewerCount: true,
    customSound: 'stream_notification.wav'
  },
  
  // Timing settings
  timing: {
    scheduleReminder: 15, // Minutes before scheduled stream
    quietHours: {
      start: '22:00',
      end: '08:00'
    }
  }
});

Testing & Debugging

// Test video notifications in development
VideoNotifications.test({
  event: 'stream.started',
  streamId: 'test-stream-123',
  broadcasterName: 'Test Broadcaster',
  title: 'Test Stream Title',
  thumbnail: 'https://example.com/thumbnail.jpg'
});

// Test specific platforms
VideoNotifications.testPlatform('ios', {
  deviceToken: 'test-device-token',
  event: 'viewer.milestone',
  data: { viewerCount: 100 }
});

Best Practices

Stream Timing: Send stream start notifications immediately but batch viewer activity updates to avoid overwhelming users.

Notification Strategy

  • Stream Lifecycle - Always notify for stream start/end events
  • Viewer Activity - Use milestones instead of individual join/leave events
  • Recording Status - Critical for content creators who rely on recordings
  • Broadcast Issues - Essential for broadcasters to maintain stream quality

User Experience

  • Permission Timing - Request during onboarding or first stream creation
  • Relevance - Only notify followers/subscribers of broadcaster
  • Frequency - Respect quiet hours and user preferences
  • Content - Include stream thumbnail and viewer count when possible

Technical Considerations

  • Delivery Speed - Stream notifications should be near real-time
  • Fallback - Use webhook for web notifications when push isn’t available
  • Retry Logic - Implement retry for failed critical notifications
  • Analytics - Track notification open rates and stream conversion

Platform Support Matrix

PlatformDirect PushWebhooksRich MediaActionsBackground
iOSβœ… APNsβœ…βœ… Imagesβœ… Join/Shareβœ…
Androidβœ… FCMβœ…βœ… Imagesβœ… Join/Shareβœ…
React Nativeβœ…βœ…βœ… Imagesβœ… Customβœ…
Flutterβœ…βœ…βœ… Imagesβœ… Customβœ…
WebβŒβœ…βœ… Imagesβœ… Join/Shareβœ… Service Worker

Next Steps

  1. Stream Events - Implement comprehensive stream event handling
  2. Broadcasting Setup - Configure broadcasting with notifications
  3. Platform Guides: Configure per platform:
  1. Troubleshooting - Common notification issues
Production Checklist: Ensure APNs/FCM certificates are configured, webhook endpoints are secured with HTTPS, and notification permissions are properly requested before going live.