Giter VIP home page Giter VIP logo

fcmchannelsmanager's Introduction

The fcm_channels_manager is a flutter package that using to create and manage Notification in Android

Features

1. The plugin provide an API for Android to manage notification channels.

Support Android 8.0 (API level 26) and above. For more information, visit Create and Manage Notification Channels

  • Create a new channel
  • Get all channels that have been registered
  • Delete a channel

2. Provide app notification settings in iOS

An option indicating the system should display a button for in-app notification settings. Support iOS 12.0 and above

/example/notification_settings.png

Installation

In the pubspec.yaml of your flutter project, add the following dependency:

dependencies:
  fcm_channels_manager: <latest_version>

In your library add the following import:

import 'package:fcm_channels_manager/fcm_channels_manager.dart';

Usage

1. Create new channel

Return success message if channel registered successfully.

final result =  await FcmChannelsManager().registerChannel(
        id: "1001",
        name: "Feedback notification",
        description: "Receive new feedback and system's notification",
        importance: NotificationImportance.importanceHight,
        visibility: NotificationVisibility.public,
        bubbles: true,
        vibration: true,
        sound: true,
        badge: true,
      );
  • Notification importance level
Plugin value Android Reference
NotificationImportance.disabled IMPORTANCE_NONE
NotificationImportance.importanceMin IMPORTANCE_MIN
NotificationImportance.importanceLow IMPORTANCE_LOW
NotificationImportance.importanceDefault IMPORTANCE_DEFAULT
NotificationImportance.importanceHight IMPORTANCE_HIGH
  • Notification visibility
Plugin value Description
NotificationVisibility.public Show this notification in its entirety on all lockscreens
NotificationVisibility.private Show this notification on all lockscreens, but conceal sensitive or private information on secure lockscreens
NotificationVisibility.secret Do not reveal any part of this notification on a secure lockscreen

2. Get all registered channels

You can get all registered channels with base informations about this channel: id, name, description, importance. You can check the importance level then handle your businesses.

final channesl = await FcmChannelsManager().getChannels();

3. Delete a channel

Remove registered channel by channel's id. Return success message if channel deleted

final result = await FcmChannelsManager().unregisterChannel('1001')

4. Provide app notification settings

Return true if update .providesAppNotificationSettings successfully. The function should call after request notification permission by using firebase_messaging

FcmChannelsManager()
  .providesAppNotificationSettings()
  .then((value) => log('Permission status: $value'));

Example

Follow the example: /example

Demo:

/example/demo_channels.gif

Contributions

Feel free to contribute to this project.

If you find a bug or want a feature, but don't know how to fix/implement it, please fill an issue. If you fixed a bug or implemented a feature, please send a pull request.

fcmchannelsmanager's People

Contributors

tuyenponos avatar

Stargazers

Fathi wehba avatar A.M. avatar  avatar Tuyen Nguyen avatar  avatar Simon Pham avatar Hiếu avatar

Watchers

Tuyen Nguyen avatar  avatar

Forkers

tapeo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.