I’m trying to create a network speed monitoring app, kind of like Internet Speed Meter Lite on android. I don’t know if it’s available in IOS or not. But the thing is, I’m trying to achieve a certain kind of notification feature.
Once the user allows all the permissions required, the app has a function run in background. Its purpose is to display real-time network speed in the notification. The notification should not pop-up as any normal pop-up would. It should be in the background and shown only in the notification center. There will be no sound, vibration or alert, only the notification banner is shown in the notification center. Kind of like when you set a timer in android, and it shows the progress in the notification center but there is not notification shown. I have attached the image for the feature I want to achieve.
Plugins tried
I have using:
- flutter_local_notification
- awesome_notifications (currently using)
The following is my code to attempt to achieve the feature:
NOTIFICATION INITIALIZATION
AwesomeNotifications().initialize(
null,
[
NotificationChannel(
channelGroupKey: 'network_info_channel_key',
channelKey: 'network_info_channel',
channelName: 'Network Info Notifications',
channelDescription: 'Notification channel for Network Info',
onlyAlertOnce: true,
channelShowBadge: false,
playSound: false,
enableVibration: false,
enableLights: false,
defaultPrivacy: NotificationPrivacy.Private,
importance: NotificationImportance.None,
)
],
channelGroups: [
NotificationChannelGroup(
channelGroupKey: 'network_info_channel_group',
channelGroupName: 'Network Info group',
)
],
debug: true);
DISPLAYING NOTIFICATION
AwesomeNotifications().createNotification(
content: NotificationContent(
id: -1,
criticalAlert: false,
channelKey: 'network_info_channel',
autoDismissible: true,
locked: true,
displayOnForeground: false,
displayOnBackground: false,
title: 'Network Info',
body: notificationModel.body,
category: NotificationCategory.Event,
));
Any help is appreciated.
Please and thank you.
Reference Image taken from Internet Speed Meter Lite
Abik Vaidhya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.