flutter_notification_channel 0.0.5 copy "flutter_notification_channel: ^0.0.5" to clipboard
flutter_notification_channel: ^0.0.5 copied to clipboard

outdated

firebase_messaging version 7.0.3 (current) and lower do not allow setting a channel for notification, thus notifications don't play any sounds. This plugin is made merely for the purpose of creation a [...]

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_notification_channel/flutter_notification_channel.dart';
import 'package:flutter_notification_channel/notification_importance.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Register Channel'),
        ),
        body: Center(
          child: Column(
            children: [
              FlatButton(
                onPressed: () async {
                  print('start registering');
                  var result = await FlutterNotificationChannel
                      .registerNotificationChannel(
                          description: 'My test channel',
                          id: 'com.softmaestri.testchannel',
                          importance: NotificationImportance.IMPORTANCE_HIGH,
                          name: 'Flutter channel test name');
                  print('Result: $result');
                },
                child: Text('Register channel'),
              )
            ],
          ),
        ),
      ),
    );
  }
}
29
likes
30
pub points
95%
popularity

Publisher

verified publishersoftmaestri.com

firebase_messaging version 7.0.3 (current) and lower do not allow setting a channel for notification, thus notifications don't play any sounds. This plugin is made merely for the purpose of creation a notification channel with difference importance. The channel then can be used in firebase

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter

More

Packages that depend on flutter_notification_channel