पैकेज, रिपॉज़िटरी और ऐप श्रेणियाँ खोजें

पैकेज विवरणv3.2.0

flutter_notification_channel

एंड्रॉइड पर नोटिफिकेशन चैनल सेटअप के लिए एक प्लगइन

AndroidiOS
30-दिन डाउनलोड
3.9 हज़ार
लाइक
33
Pub अंक
120

पैकेज इंस्टॉल करें

flutter pub add flutter_notification_channel

पैकेज अवलोकन

सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।

flutter_notification_channel पैकेज डेवलपर्स को फ्लटर एप्लिकेशन में एंड्रॉइड डिवाइस पर सूचना चैनल को आसानी से कॉन्फ़िगर और प्रबंधित करने में सक्षम बनाता है। यह एक सीधा-आईपी ऑफर करता है, जिससे सूचना चैनल बनाने, अपडेट करने और कस्टमाइज़ करने में आसानी होती है, और यह सुनिश्चित करता है कि सूचनाएं एंड्रॉइड के सूचना चैनल आवश्यकताओं के अनुसार सही ढंग से वर्गीकृत और प्रदर्शित हों। यह पैकेज एंड्रॉइड और आईओएस दोनों प्लेटफॉर्म को सपोर्ट करता है, हालांकि इसकी प्राथमिक कार्यक्षमता एंड्रॉइड के चैनल-आधारित सूचना प्रणाली पर केंद्रित है। यह उपयोगकर्ता अनुभव को बेहतर बनाने में मदद करता है, क्योंकि यह सूचना व्यवहार (जैसे ध्वनि, कंपन और महत्व के स्तर) के लिए विस्तृत नियंत्रण प्रदान करता है।

उपयोग

  • कस्टम नोटिफिकेशन चैनल का सेटअप करें
  • सूचना महत्व स्तरों का प्रबंधन करें
  • नोटिफिकेशन ध्वनि और कंपन कस्टमाइज़ करें
  • Android 8.0+ नोटिफिकेशन आवश्यकताओं का पालन सुनिश्चित करना
  • संगठित नोटिफिकेशन के साथ उपयोगकर्ता अनुभव में सुधार करना

मुख्य विशेषताएँ

  • सूचना चैनल बनाने के लिए सरल API
  • Android 8.0+ चैनल आवश्यकताओं के लिए समर्थन
  • क्रॉस-प्लेटफ़ॉर्म सुविधा (Android और iOS)
  • महत्व और ध्वनि जैसे कॉन्फ़िगरेबल चैनल प्रॉपर्टीज़
  • मौजूदा नोटिफिकेशन प्रणालियों के साथ आसान एकीकरण

इनके लिए उपयुक्त

  • संरचित नोटिफिकेशन प्रबंधन की आवश्यकता वाले ऐप्स
  • Android 8.0+ उपकरणों के लिए विकासकर्ता
  • कस्टमाइज़ किए गए नोटिफिकेशन व्यवहार की आवश्यकता वाले प्रोजेक्ट
  • बहुत सूचना प्रकार वाले ऐप्स के निर्माण करने वाली टीमें
  • पुश नोटिफिकेशन का उपयोग करने वाले Flutter ऐप्स

विचार योग्य बातें

  • मुख्य कार्यक्षमता Android तक सीमित है
  • iOS समर्थन न्यूनतम है (चैनल निर्माण नहीं)
  • प्लेटफॉर्म-विशिष्ट तर्क के हस्तचालित संभाल की आवश्यकता होती है
  • पुराने एंड्रॉइड संस्करणों पर मूलभूत अधिसूचनाओं के लिए आवश्यक नहीं है
  • अन्य नोटिफिकेशन प्लगइन के साथ उपयोग करने पर सबसे अच्छा है

मूल README

संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।

flutter_notification_channel

https://pub.dev/packages/flutter_notification_channel

This plugin is made to register notification channels with custom configurations on Android. For more details read this https://developer.android.com/training/notify-user/channels Why is it necessary? E.g. firebase_messaging version 7.0.3 (current) and lower do not allow to set up a notification channel, thus notifications don't play any sounds or do not display on locked screen, or don't bubble and so on. This plugin is made merely for the purpose of creation a notification channel with custom configurations on Android. The channels then can be used along with firebase_messaging.

How to use

Simply call it like this

var result = await FlutterNotificationChannel().registerNotificationChannel(
    description: 'Your channel description',
    id: 'your_channel_id',
    importance: NotificationImportance.IMPORTANCE_HIGH,
    name: 'Your channel name',
    visibility: NotificationVisibility.VISIBILITY_PUBLIC,
    allowBubbles: true,
    enableVibration: true,
    enableSound: true,
    showBadge: true,
);
print(result);

Importance Levels

The plugin supports the following notification importance levels:

  • NotificationImportance.IMPORTANCE_MIN (1): Minimal importance, might not be shown
  • NotificationImportance.IMPORTANCE_LOW (2): Low importance, shows in shade and potentially status bar but not audibly intrusive
  • NotificationImportance.IMPORTANCE_DEFAULT (3): Default importance, shows everywhere and makes noise but doesn't visually intrude
  • NotificationImportance.IMPORTANCE_HIGH (4): Higher importance, shows everywhere, makes noise and peeks, may use full screen intents
  • NotificationImportance.IMPORTANCE_MAX (5): Maximum importance, most intrusive level, should be used sparingly for critical notifications only
Example with Maximum Importance

For critical notifications that require immediate user attention:

var result = await FlutterNotificationChannel().registerNotificationChannel(
    description: 'Critical system alerts',
    id: 'critical_channel_id',
    importance: NotificationImportance.IMPORTANCE_MAX,
    name: 'Critical Alerts',
    visibility: NotificationVisibility.VISIBILITY_PUBLIC,
    allowBubbles: true,
    enableVibration: true,
    enableSound: true,
    showBadge: true,
);

Then, when you send a message to firebase like this, specify your android_channel_id and sound: "default" in order to play a default sound if you set "enableSound" in plugin. If you don't do this, the sound wont play at all on android 9 (I have no idea why)

{
  "notification": {
    "title": "Your message title",
    "body": "Your message body",
    "android_channel_id": "your_channel_id",
    "sound": "default"
  },
  "data": {
    "click_action" : "FLUTTER_NOTIFICATION_CLICK",
  },
  "priority": "high",
  "content_available": true,
  "to": "YOUR_FIREBASE_PUSH_TOKEN_GOES_HERE"
}

श्रेणियाँ

निर्भरताएँ

निर्भरता सूची 1 आइटम

  • plugin_platform_interface^2.1.8

सोर्स रिपॉज़िटरी

इस पैकेज का उपयोग करने वाले प्रोजेक्ट

अभी कोई डेटा उपलब्ध नहीं है।