搜索插件、代码仓与 APP 分类

easy_notifications 封面
插件详情v1.2.6

easy_notifications

一个用于处理本地通知的 Flutter 插件,具备增强的安全性和隐私保护功能。支持 Android、iOS 和 Web 平台,并提供丰富的自定义选项。

AndroidiOSWeb
近 30 天下载
118
喜欢数
51
Pub 分数
130

安装插件

flutter pub add easy_notifications

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

Easy Notifications 是一个 Flutter 插件,旨在简化在 Android、iOS 和 Web 平台上的本地通知实现。它强调安全性和隐私保护,为通知数据提供强大的防护。通过丰富的自定义选项,开发者可以根据应用需求调整通知的外观和行为。该包确保通知的可靠传递和管理,同时保持跨平台的一致性。非常适合需要通过安全、注重隐私的提醒来及时与用户互动的应用。

适合场景

  • 发送基于时间的提醒
  • 显示实时更新
  • 通过类似推送的提醒提高用户参与度
  • 自动任务通知
  • 个性化警报调度

主要特点

  • 增强的安全性和隐私性
  • 跨平台支持(Android、iOS、Web)
  • 丰富的自定义选项
  • 安全的通知数据处理
  • 可靠的本地通知送达

适合对象

  • 需要安全本地提醒的应用程序
  • 注重用户隐私的开发者
  • 具有跨平台需求的项目
  • 通知密集型应用
  • 寻求简单集成的团队

使用建议

  • 需要平台特定的设置才能实现完整功能
  • Web 支持的功能可能比移动设备上的功能有限
  • 某些平台必须手动处理权限
  • 不适用于远程或服务器驱动的通知
  • 超出基本时间触发的高级调度功能有限

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

Easy Notifications

Easy Notifications Logo

Pub Version License: MIT Platform Support Flutter Support Pub Points Support me

A secure and privacy-focused Flutter plugin for handling local notifications with enhanced features and SOC 2 compliance considerations. Supports Android, iOS, Web platforms.

Features

  • 🔒 Secure handling of notification data
  • 🎯 Precise scheduling with timezone support
  • 🖼️ Rich media notifications (images, custom styles)
  • 📱 Cross-platform support (Android, iOS, Web)
  • 🔐 Granular permission controls
  • 📋 Action buttons support
  • ⏰ Exact timing with background wake-up support
  • 🛡️ Privacy-first approach
  • 🎨 Highly customizable appearance (NotificationStyle)
  • 🔧 Advanced configuration (NotificationSettings)
  • 🔄 JSON serialization support

Getting Started

Installation

Add this to your package's pubspec.yaml file:

dependencies:
  easy_notifications: ^1.2.5
Platform Setup
Android

Add the following permissions to your AndroidManifest.xml:

<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>

This plugin depends on flutter_local_notifications, which requires Android core library desugaring. Add this to your app's android/app/build.gradle.kts:

android {
  //...
  compileOptions {
    isCoreLibraryDesugaringEnabled = true
  }
}

dependencies {
  coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.4")
}

(build.gradle instead of build.gradle.kts? See the Android docs for the Groovy syntax.)

iOS

Add the following keys to your Info.plist:

<key>UIBackgroundModes</key>
<array>
    <string>fetch</string>
    <string>remote-notification</string>
</array>
Web

To enable web notifications, you need to add the following script to your index.html file:

<script>
  if ('Notification' in window) {
    Notification.requestPermission().then(permission => {
      if (permission === 'granted') {
        console.log('Notification permission granted.');
      }
    });
  }
</script>
Basic Usage
// Initialize the plugin
await EasyNotifications.init();

// Show a simple notification
await EasyNotifications.show(
  title: 'Hello!',
  body: 'This is a notification',
);

// Show notification with image and custom style
await EasyNotifications.show(
  title: 'Styled Notification',
  body: 'With custom appearance',
  style: NotificationStyle(
    backgroundColor: '#FFFFFF',
    titleColor: '#000000',
    padding: const EdgeInsets.all(16),
  ),
);

// Schedule a notification
await EasyNotifications.schedule(
  title: 'Reminder',
  body: 'Time for your meeting!',
  scheduledDate: DateTime.now().add(Duration(hours: 1)),
);

Usage

EasyNotifications.showMessage(
  title: 'New Message',
  body: 'You have a new notification',
  id: 1001, // Optional custom ID
);

Notifications Preview

Preview

Recent Updates

1.2.6
  • Removed inaccurate return-value docs on hide(), updateMessage(), and scheduleMessage()
  • Documented the Android core library desugaring setup required by flutter_local_notifications
1.2.5
  • Fixed web notifications registration
  • Added proper error handling for web platform
1.2.4
  • Added back NotificationLevel class for backwards compatibility
1.2.3
  • Fixed platform support documentation
  • Removed unsupported platforms from pubspec.yaml

Security & Privacy

Data Handling
  • 🔐 All sensitive data encrypted at rest
  • 🗑️ Automatic cleanup of temporary files
  • 📁 Secure local storage practices
Compliance
  • SOC 2 Type II compliant architecture
  • GDPR-ready data processing
  • CCPA privacy controls

Contributing

We welcome contributions! Please see our contributing guide.

License

MIT License - see LICENSE for details.

所属分类

依赖

依赖清单 11 项

源码仓库

使用此插件的项目

暂无相关数据。