mc_custom_notification 0.0.1
mc_custom_notification: ^0.0.1 copied to clipboard
Custom notifications, call notifications, message notifications, call notifications, regular notifications, Firebase notifications.
MC Custom Notification #
Custom notifications, call notifications, message notifications, call notifications, regular notifications, Firebase notifications
Please contribute to the discussion with issues.
screenShot #
[
]
Platform support #
| Feature/platform | Android | iOS | Web | macOS | Windows | Linux |
|---|---|---|---|---|---|---|
| Notification | ✓ | ╳ | ╳ | ╳ | ╳ (1) | ╳ (1) |
Features #
- Show incoming call notification Event to answer Event to reject
- Notification of an ongoing call Call end event Microphone on event Call mute event
- Notification message with a reply event, a read event, and a hide event
- Regular notification with notification click event
- Cancel all notifications
- Cancel a specific notification
- Get all notifications
- All notices contain the title of the notice, the image of the notice, the body of the notice, the payload of the notice, the hands of the notice, and the tag of the notice
- You can use Firebase and cancel notifications for work in the background by sending a tag to this library, and the id must be =0
- When you click on the notification, if the application is closed, it opens it, and if it is running in the background, it opens it as well.
Installation #
flutter pub add mc_custom_notification
Example #
Initialized Library #
start with Initialized mc_custom_notification
import 'package:mc_custom_notification/mc_custom_notification.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
McCustomNotification().initialize(
onClick: (payload) {
//payload is detalis notification payload and tag
// set here what you want to do when the notification is clicked
},
);
runApp(const MyApp());
}
Here's a quick example that shows how to build a NotificationCall in your app
import 'package:mc_custom_notification/models/notification_call.dart';
await McCustomNotification().showNotificationCall(
model: NotificationCall(
id: 1,
tag: 'tag1',
title: 'New Notification',
body: 'This is the body of the notification',
image:
"https://vpsserver.meta-code-ye.com/files/image?name=IMG-20240314-WA0007.jpg",
payload: {'id': 55, "name": "ali"},
groupKey: "call",
onAccepted: (payload) {
//set here what you want to do when the notification call is accepted
},
onDenied: () {
//set here what you want to do when the notification call is denied
},
));
Here's a quick example that shows how to build a NotificationCalling in your app
import 'package:mc_custom_notification/models/notification_calling.dart';
await McCustomNotification().showNotificationCalling(
model: NotificationCalling(
id: 52,
tag: 'tag18',
title: 'Normal notification ',
body: 'This is the body of the notification',
payload: {'id': 55, "name": "ali"},
groupKey: "normal53",
onEndCall: (payload) {
//set here what you want to do when the notification call is ended
},
),
);
Here's a quick example that shows how to build a NotificationMessage in your app
import 'package:mc_custom_notification/models/notification_message.dart';
await McCustomNotification().showNotificationMessage(
model: NotificationMessage(
id: 2,
tag: 'tag12',
title: 'Younas Ali Ahmed',
body: 'This is the body of the notification',
image:
"https://vpsserver.meta-code-ye.com/files/image?name=IMG-20240314-WA0007.jpg",
payload: {'id': 55, "name": "ali"},
groupKey: "chat",
onRead: (payload) {
//set here what you want to do when the notification message is read
},
onReply: (payload) {
//set here what you want to do when the notification message is rplay
},
));
The rest of the things are explained in the example
About us #
Web site Meta Code.
Telegram Our business.
Telegram Meta Code.
