flutter_downloaded_audio_play_in_notification 1.0.1
flutter_downloaded_audio_play_in_notification: ^1.0.1 copied to clipboard
A Flutter plugin for playing downloaded audio files in notifications with background playback support and terminated state handling.
Changelog #
1.0.1 #
Bug Fixes and Improvements #
Fixed Issues:
- ✅ Fixed syntax error in notification_service.dart (undefined
stopAudioAndTerminatemethod) - ✅ Fixed PlatformException issues with notification cancellation
- ✅ Fixed notification visibility - notifications now show properly at top of screen
- ✅ Fixed notification audio - notifications now play sound when app is in foreground
Code Simplification:
- ✅ Removed all try-catch blocks for cleaner, simpler code
- ✅ Streamlined audio stopping logic to direct
NotificationService().stopAudio()calls - ✅ Removed complex retry logic and aggressive stopping approaches
- ✅ Simplified background and terminated state handling for better reliability
Android Native Improvements:
- ✅ Updated notification channels from silent to visible/audible
- ✅ Changed notification importance from LOW to HIGH
- ✅ Enabled notification sound and visibility settings
Technical Details:
- Fixed Flutter Local Notifications plugin compatibility issues
- Improved notification ID handling to prevent edge cases
- Enhanced terminated state audio stopping reliability
1.0.0 #
Initial Release #
Features:
- ✅ Play custom audio files from URLs in notifications
- ✅ Background audio playback support
- ✅ Audio playback when app is terminated
- ✅ Stop audio from notification tap
- ✅ Android native implementation with ExoPlayer
- ✅ Firebase Cloud Messaging integration
- ✅ Robust audio stopping from terminated state
- ✅ Comprehensive error handling and retry logic
Technical Details:
- Native Android implementation using Kotlin
- ExoPlayer for audio playback
- Foreground service for background playback
- Broadcast receivers for cross-component communication
- Singleton pattern for audio management
- Aggressive stopping mechanisms for terminated state
- Comprehensive logging for debugging
Platform Support:
- Android: Full support (API 21+)
- iOS: Not supported (Android only)
Dependencies:
- Flutter SDK: ^3.6.1
- Firebase Messaging: ^14.7.10
- Flutter Local Notifications: ^17.2.4
- ExoPlayer: 2.19.1 (Android native)
Setup Requirements:
- Firebase configuration with google-services.json
- Android Gradle Plugin 8.1.1+
- Compile SDK 34+
- Min SDK 21+
Example App #
- Complete working example with Firebase integration
- Test interface with stop button
- FCM token display
- Notification testing instructions
- Terminated state testing capabilities
Documentation #
- Comprehensive README with usage examples
- API reference documentation
- Setup instructions
- Troubleshooting guide
- Testing procedures