搜尋套件、儲存庫與 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 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。