Giter Club home page Giter Club logo

awesome_notifications's Issues

Disable the Firebase functionality while still using firebase.

This might sound weird.
I'm using a lot of Firebase services including FCM.
And I love your Plugin and would like to use it.
But I have my own payload structure and would like to keep it.
Is there a way to use this plugin and firebase but not the firebase functionality of the plugin?
Currently I forked this plugin and disabled it on the android site by commenting out the FCMService from the Manifest. How would I disable it on iOS?

intl version mismatch

Trying to install it, I receive this error message:

Running "flutter pub get" in myApp...
Because every version of flutter_localizations from sdk depends on intl 0.17.0-nullsafety.2 and every version of awesome_notifications depends on intl ^0.16.1, flutter_localizations from sdk is incompatible with awesome_notifications. 

So, because myApp depends on both awesome_notifications ^0.0.5+2 and flutter_localizations any from sdk, version solving failed.
pub get failed

Looks like a version mismatch. A dependency update should do it.

flutter version:
Flutter (Channel master, 1.24.0-8.0.pre.374, on Microsoft Windows [Version 10.0.18363.1198], locale de-DE)

Getting receiveNotification: notification discarted

If the service does not wake up and do not get called, the attatch process will keep waiting forever. Sometimes the target extension is not wake up imediately after your app goes up, but instead when a new push notification arives. Put a break point on the first instruction inside didReceive method from AwesomeServiceExtension class:

If even in this cases the service extension is not beeing called, so theres something missing on your project configuration to activate your notification service extension.

Hi,

first of all thank you for this nice plugin! I am having some trouble making it work in IOS though. I am getting exactly the same error like @bysano and followed all tips from here, but i still cannot resolve it.
Like you stated above, that this method should be called, it is not in my case and i am running out of ideas.

I created everything and even compared it with the settings from https://github.com/bayuramadeza/Awesome-Notification-FCM.

I am getting all kinds of infos, that it is initiated and so on and everything is running fine on android f.e.
"Awesome Notifications - App Group : group.AwesomeNotifications.....
"AwesomeNotificationsPlugin: Awesome Notification service initialized"

but whenever i receive a notification i am getting:
"receiveNotification: notification discarted"

debuging shows that there is a message, but like you stated above, it is empty and 'didReceive method from AwesomeServiceExtension' is never called.

any ideas?

Thank you!

Edit: Apparently this only happens when the app is running, in the background or terminated it works fine ...

Edit2:
Looks like the same behaviour happens with your demo application:
2020-12-15 14:20:33.402160+0100 Runner[1426:376053] Metal API Validation Enabled 2020-12-15 14:20:33.487702+0100 Runner[1426:376053] [User Defaults] Couldn't read values in CFPrefsPlistSource<0x283120c80> (Domain: group.AwesomeNotifications.com.geektechware.do, User: kCFPreferencesAnyUser, ByHost: Yes, Container: (null), Contents Need Refresh: Yes): Using kCFPreferencesAnyUser with a container is only allowed for System Containers, detaching from cfprefsd "Awesome Notifications - App Group : group.AwesomeNotifications.com.geektechware.do" 2020-12-15 14:20:33.491409+0100 Runner[1426:376280] 6.34.0 - [Firebase/Core][I-COR000003] The default Firebase app has not yet been configured. Add [FIRApp configure]; (FirebaseApp.configure() in Swift) to your application initialization. Read more: https://goo.gl/ctyzm8. 2020-12-15 14:20:33.517902+0100 Runner[1426:376295] flutter: Observatory listening on http://127.0.0.1:52729/6bgLJaLs9U4=/ 2020-12-15 14:20:33.528743+0100 Runner[1426:376274] 6.34.0 - [Firebase/Analytics][I-ACS023007] Analytics v.60900000 started 2020-12-15 14:20:33.528865+0100 Runner[1426:376274] 6.34.0 - [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see http://goo.gl/RfcP7r) 2020-12-15 14:20:33.530028+0100 Runner[1426:376274] 6.34.0 - [Firebase/Messaging][I-FCM001000] FIRMessaging Remote Notifications proxy enabled, will swizzle remote notification receiver handlers. If you'd prefer to manually integrate Firebase Messaging, add "FirebaseAppDelegateProxyEnabled" to your Info.plist, and set it to NO. Follow the instructions at: https://firebase.google.com/docs/cloud-messaging/ios/client#method_swizzling_in_firebase_messaging to ensure proper integration. 2020-12-15 14:20:33.721138+0100 Runner[1426:376281] 6.34.0 - [Firebase/Analytics][I-ACS800023] No pending snapshot to activate. SDK name: app_measurement 2020-12-15 14:20:33.734969+0100 Runner[1426:376281] 6.34.0 - [Firebase/Analytics][I-ACS023012] Analytics collection enabled 2020-12-15 14:20:33.735102+0100 Runner[1426:376281] 6.34.0 - [Firebase/Analytics][I-ACS023220] Analytics screen reporting is enabled. Call +[FIRAnalytics logEventWithName:FIREventScreenView parameters:] to log a screen view event. To disable automatic screen reporting, set the flag FirebaseAutomaticScreenReportingEnabled to NO (boolean) in the Info.plist "AwesomeNotificationsPlugin: Awesome Notification service initialized" 2020-12-15 14:20:34.334012+0100 Runner[1426:376284] flutter: Firebase token: f98igwOi3UIbvOzxIcfIUq:APA91bFS8JTxekpzK0z3es4XZcbHrsOY_OjI1NR6YtQRHHXpnfsDuTZYo6bt00Bj84sh3vgfk7yRnJ7DXzFzVEK2eITxPWV9aqc5o_8mYzyepEe-WaamiQ5wJkGHemLJ6rCz9W4yYXsg "receiveNotification: notification discarted"

Tapping on action button doesn't bring app to foreground

I've set up some NotificationActionButtons with button type KeepOnTop and I'm receiving tap events correctly, but when the app is minimized tapping on a button doesn't bring app to foreground, however tapping outside the buttons, on the background panel does the expected effect. Is this an intended behavior or a bug?

IOS scheduled notification

hi, I'm trying to use scheduled notification on iOS, on android all chrono function works well, but on iOS dont work

this is the function that I tried:

Future<void> repeatMinuteNotificationOClock(int id) async { await AwesomeNotifications().createNotification( content: NotificationContent( id: id, channelKey: 'schedule', title: 'Notification at exactly every single minute', body: 'This notification was schedule to repeat at every single minute at clock.', ), schedule: NotificationSchedule( crontabSchedule: CronHelper.instance.minutely(initialSecond: 5))); }

if I schedule with this all work perfectly, but this dont repeat notification:

await AwesomeNotifications().createNotification( content: NotificationContent( id: id, channelKey: "scheduled", title: title, body: 'xClock è tempo di $title', payload: {'uuid': 'uuid-test'}), schedule: NotificationSchedule(initialDateTime: delayed.toUtc()));

Displayed Stream only triggers for the latest notification if the app is in background on Ios

So whenever a notification arrives to the ios device if the application is either in background or terminated if there is only 1 notification whenever the app is opened createdStream (or displayedStream both behave identically) triggers with that notification.

But if there is more than one notification only the latest one triggers the streams the prior ones are discarded.

Example: app is terminated I first send notification with title NOTIFICATION1 then 10 seconds later I send NOTIFICATION2 if I open the app I only see it triggers for NOTIFICATION2.

Localization

  • how can i display notifications in different languages? (my app is supports multiple languages)
  • If user is not logged in, notification should not be displayed to that user and the notification should be displayed if the user is logged in. How can I manage this?

is there any callback like onBackgroundMessage in this plugin? so i can manage it locally in the background.

Existing NotificationChannel does not update on initialize or setChannel

When calling AwesomeNotifications().initialize('blah', [existingChannel]) or AwesomeNotifications().setChannel(existingChannel) on a NotificationChannel existingChannel that has a channelKey for which a NotificationChannel has been created before, the channel is not updated. However the documentation says, they should update existing channels.

Creating a new channel using both methods, as well as removeChannel do work though.

Bad state: Stream has already been listened to.

Issue: I am calling notification in xyz.dart page I have made initialization correctly though when the notification displayed and when I clicked on it does not open the desired page but instead of any button click on the page it listening to that time and I am getting this issue.

Bad state: Stream has already been listened to.

log:

`════════ Exception caught by widgets library ═══════════════════════════════════════════════════════
The following StateError was thrown, building Builder:
Bad state: Stream has already been listened to.

The relevant error-causing widget was:
MaterialApp file:///D:/code/xyz/lib/main.dart:60:12
When the exception was thrown, this was the stack:
#3 _xyzState.initState (package:xyz.dart:136:47)
#4 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4765:58)
#5 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4601:5)
... Normal element mounting (132 frames)
#137 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3569:14)
...`

actionStream unstable

when app in background, click notification (firebase) actionLifeCycle is NotificationLifeCycle.AppKilled (test in android)

Cannot build on iOS

As the title states, i cannot build my app using your library on iOS.
Ich do not use the lib on iOS at all, i just need it for android and cannot exclude it from iOS build.

Environment:

  • MacOS 10.15.7
  • Flutter 1.22.4
  • XCode 12.1
  • lib version 0.0.5+2

It throws the following error:

awesome_notifications-0.0.5+2/ios/Classes/lib/SwiftAwesomeNotificationsPlugin.swift:104:17: error: parameter of 'messaging(:didReceiveRegistrationToken:)' has different optionality than required by protocol 'MessagingDelegate'
public func messaging(
messaging: Messaging, didReceiveRegistrationToken fcmToken: String) {
^
?
FirebaseMessaging.MessagingDelegate:2:19: note: requirement 'messaging(:didReceiveRegistrationToken:)' declared here
optional func messaging(
messaging: Messaging, didReceiveRegistrationToken fcmToken: String?)

Suggesting the parameter must be optional. I made it optional and unwrapped inside your swift plugin and the build succeeded. Maybe you can give more insight.

Error NotificationChannel.getImportance()

Hello, good morning, first of all, thank you very much for such a good notification package. Second, I had a problem, the library was working well at the beginning, then it started with this error that I show below, what could it be?

Exception has occurred.
PlatformException (PlatformException(Notification not created, Attempt to invoke virtual method 'int android.app.NotificationChannel.getImportance()' on a null object reference, java.lang.NullPointerException: Attempt to invoke virtual method 'int android.app.NotificationChannel.getImportance()' on a null object reference
at me.carda.awesome_notifications.AwesomeNotificationsPlugin.isNotificationEnabled(AwesomeNotificationsPlugin.java:714)
at me.carda.awesome_notifications.AwesomeNotificationsPlugin.channelMethodCreateNotification(AwesomeNotificationsPlugin.java:633)
at me.carda.awesome_notifications.AwesomeNotificationsPlugin.onMethodCall(AwesomeNotificationsPlugin.java:406)
at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:692)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:325)
at android.os.Looper.loop(Looper.java:147)
at android.app.ActivityThread.main(ActivityThread.java:6749)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:845)
, null))

Set a duration for notifications

Hey, i know this is a sort of an usually feature request. But is it possible to set a duration for notification's in which after the duration is complete the notification will cancel it's self and in the event the notification was never triggered (i.e the users phone was off) then dont trigger in the first instance if the duration has already passed. Or alternatively schedule a cancellation of a notification for a specific time, this would achieve the same effect.

vibration pattern issue

  • Vibration pattern does not work. It always uses default patterns. plz check this.

  • Code:
    vibrationPattern: Int64List.fromList([0, 1000, 500, 1000, 500, 1000])

/////
Device: Samsung m30s
Version: Android 10 (Q)
/////

NotificationChannel - soundSource not working [Android - iOS]

First of all thanks for this library 😀

I tried to use the soundSource param when defining the NotificationChannel but it doesn't work when the notification is displayed.

NotificationChannel(
      channelKey: 'channel_call',
      channelName: 'channel name',
      channelDescription: 'channel description',
      importance: NotificationImportance.Max,
      playSound: true,
      soundSource: 'asset://audio/ringtone.mp3',
);

Assertion Error while initializing on iOS

For some reason I am not able to initialize the plugin on iOS. I believe it's because I am incorrectly accessing the native assets. How do I correctly choose an xcasset for initializing the plugin? Is there any way to simply choose the app icon?

await AwesomeNotifications().initialize(
    Platform.isIOS ? 'AppIcon' : 'resource://drawable/notification',
    [
      NotificationChannel(
        channelKey: 'basic_channel',
        channelName: 'Basic notifications',
        channelDescription: 'Notification channel for basic tests',
        defaultColor: Colors.blueAccent,
        ledColor: Colors.blueAccent,
        channelShowBadge: true,
        importance: NotificationImportance.Max,
      ),
	],
);

image

Question about ios behaviour

Hi, Sorry for this issue but I have a quick question,

I need to catch the notification payload and save it to the local storage even if the ios app is terminated
or
I need to catch the notification and show/update the badge on the launcher icon.

I've been trying to accomplish this using several different versions of fcm
Ios shows the notification but it seems like there is no way to actually handle it before the app opens.

Can this plugin achieve this behavior?
Thanks.

InputField Not Working on android 6 and 5.1and maybe more

Hi. Thanks for this awesome package. I created a notification with InputField as NotificationActionButton. I want the user type something and hit send. I have been using this package with my android 8 device and it is working without any problem. But when I tried it on android 6 and android 5.1 devices, the InputField did not work. I is showing the notification AND the InputField, but when I click on it, it does not let me put any text and just runs the AwesomeNotifications().actionStream with an empty (null) string.

I am using 0.0.5+2 version with flutter 1.22.0

My Code:

AwesomeNotifications().initialize(
      'resource://drawable/app_icon',
      [
        NotificationChannel(
            channelKey: 'seller_channel',
            channelName: 'seller notifications',
            channelDescription: 'Notification channel for basic tests',
            importance: NotificationImportance.Max,
            defaultPrivacy: NotificationPrivacy.Public,
            defaultColor: Color(0xFF9D50DD),
            ledColor: Colors.orange)
      ]);

And The method to show the notification:

void showAwesomeNotification(String product) {
    AwesomeNotifications().isNotificationAllowed().then((isAllowed) {
      if (!isAllowed) {
    AwesomeNotifications().requestPermissionToSendNotifications();
  }
  AwesomeNotifications().createNotification(
    content: NotificationContent(
        id: 10,
        channelKey: 'seller_channel',
        title: '$product',
        payload: {'name': product},
        autoCancel: false,
        color: primaryColor,
        body: 'my body'),
    actionButtons: [
      NotificationActionButton(
          buttonType: ActionButtonType.InputField,
          autoCancel: false,
          key: 'inputPrice',
          icon: "images/logo.png",
          label: 'Enter Price...')
    ],
  );
});
  }

Please help me on this.

Arm64 and linker errors after adding Service or content extension in iOS.

hello everyone,

I've been trying to use your Awesome_notification in my flutter app but I cannot install the app on my ios device after adding the extension for push notification. The app works perfectly and receives remote notifications without adding the service or content extensions. But, as soon as I implement those changes listed on the readme page on Pub.dev it starts giving me errors. here is my recent log:

Launching lib/main.dart on Nomo in debug mode...
Automatically signing iOS for device deployment using specified development team in Xcode project: XL56NXU54B
Running Xcode build...
Xcode build done. 14.6s
Failed to build iOS app
Error output from Xcode build:

2020-11-28 11:01:08.863 xcodebuild[74450:2246789] [MT] iPhoneConnect: 📱<DVTiOSDevice (0x7fb4395c4590), Nomo, iPhone,
14.2 (18B92), e55v116b7b14ce6c0fe3ggcb5f9cd4ed08i8be40> == END: Underlying device preparation errors ==
** BUILD FAILED **

Xcode's output:

ld: warning: Could not find or use auto-linked framework 'Flutter'
Undefined symbols for architecture arm64:
"OBJC_CLASS$_FlutterStandardTypedData", referenced from:
objc-class-ref in awesome_notifications(SwiftAwesomeNotificationsPlugin.o)
"OBJC_CLASS$_FlutterError", referenced from:
objc-class-ref in awesome_notifications(SwiftAwesomeNotificationsPlugin.o)
"OBJC_CLASS$_FlutterMethodChannel", referenced from:
objc-class-ref in awesome_notifications(SwiftAwesomeNotificationsPlugin.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
Could not build the precompiled application for the device.
Error launching application on Nomo.

Also, I've realized that xcode doesn't generate an AwesomeNotification (with the header file in it) folder like those two example apps(provided on the readme page). it only makes two folders for the extensions.

would you please let me know of any possible solution? Most errors I received were about arm64 and linkers.

Thank you.
Esan

Issue creating Xcode Archive

Just wanted to let you in on an issue with latest commit in master. When I click archive in Xcode I can't build the project because of an error in these two variable definitions in Definitions.swift:

Definitions.NOTIFICATION_DEFAULT_COLOR: 0xFF000000,
Definitions.NOTIFICATION_LED_COLOR: 0xFFFFFFFF,

The specific error is that it can't store those values in an int saying that these values will overflow. What's weird is that I can still build fine through VSCode or terminal. I changed both of them to 0x00000000 for the time-being. Of course I realize you're still hard at work finishing the iOS plugin so issues like these are not uncommon but I just wanted to let you know if you weren't aware. Nice work man!

Action Buttons don't appears on IOS 14

AwesomeNotifications().createNotification( content: NotificationContent( id: 11, channelKey: 'big_picture', title: 'asdasd!!!', bigPicture: 'https://media.wired.com/photos/598e35994ab8482c0d6946e0/master/w_2560%2Cc_limit/phonepicutres-TA.jpg', body: 'Hi there!', notificationLayout: NotificationLayout.BigPicture ), actionButtons: [ NotificationActionButton( key: 'REPLY', label: 'Reply', autoCancel: true, buttonType: ActionButtonType.InputField, ), NotificationActionButton( key: 'READ', label: 'Mark as read', autoCancel: true), NotificationActionButton( key: 'ARCHIVE', label: 'Archive', autoCancel: true) ]);

Simulator Screen Shot - iPhone 11 Pro - 2020-11-02 at 22 59 13

Can we customise firebase push notification with action Button?

Hi, It's more like a question. Can we customize the firebase push notification with awesome_notifcations? if so, how?
Also, the example in the repo is not working for IOS. it's asking for GoolgeService-Info.plist even though firebase is optional
Thanks for help

I get this error about icon when I run the example code

java.lang.IllegalArgumentException: Invalid notification (no valid small icon): Notification(channel=basic_channel pri=1 contentView=null vibrate=null sound=null tick defaults=0x0 flags=0x11 color=0xff9d50dd vis=UNKNOWN(2) semFlags=0x0 semPriority=0 semMissedCount=0)

Keep notification appears in the system tray for sometime ?

Hi,

Is it possible to keep notification in the system tray for atleast 30 seconds ?

I have checked this : https://github.com/rafaelsetragni/flutter_local_notifications

I am implementing video calling app and want action buttons in notification. I have checked other related packages callkeep. But it does require unnecessary permissions for telephone account and connection services, logs etc. Simply i want notification with answer and decline buttons with call back actions.

rafaelsetragni/flutter_local_notifications project is perfect match for me. But problem is notification disappears after 2 seconds.

Screenshot_20201124-010255

Screenshot_20201121-201752

Disable the transition to system settings when the user turned off the permission before

Hello! Excellent library, I really like API and functionality.

Unfortunately, our project doesn't need logic to go to system settings in iOS.. Can you add a parameter to the permission request method? For example like this:

  Future<bool> requestPermissionToSendNotifications(bool openSettingsWhenDenied) async {
    // TODO: Add [openSettingsWhenDenied] to platform channel arguments
    final bool isAllowed =
        await _channel.invokeMethod(CHANNEL_METHOD_REQUEST_NOTIFICATIONS);
    return isAllowed;
  }

Feature Request

Can we have an option like flutter_local_notification that if the channel doesn't exist create new one?

Cannot receive notification sent via Firebase admin SDK

Hello I am trying to send push notifications via firebase admin sdk , nothing happens when i do as stated in the example but when i change content to a string then this gets logged

FCM received
Invalid Firebase notification content

My question is why FCM received is not logged when I change the content as mentioned in the documentation?

KeepOnTop notification button action is not fired when app is killed

I am trying to develop an application which will be able to perform a REST API call when user clicked on scheduled notification button, without bringing an app to foreground.

So I am showing a scheduled notification with KeepOnTop action button. When app is in foreground or in background action from click on this button is received. But when app is killed - no action is received. Is there a way to achieve this behavior?

Can I change the notification priority/importance?

First of all thanks for this amazing simple notification package, the local_notification looks way too overcomplicated for my simple use case. Anyways is there any support to change notification property? My notifications aren't that important I was thinking if I could give them the lowest priority so they just silently slide into the notification tray.

onlyAlertOnce time

Is it possible to set onlyAlertOnce true for longer? My alert is hidden in 4 seconds.

IOS - getting "receiveNotification: notification discarted" if i send notification from FCM

notofocation example

{
    "mutable_content": true,
    "notification": {
        "title": " "
    },
    "data": {
        "content": {
            "id": 100,
            "channelKey": "big_picture",
            "title": "Huston!\nThe eagle has landed!",
            "body": "A small step for a man, but a giant leap to Flutter's community!",
            "notificationLayout": "BigPicture",
            "bigPicture": "https://www.dw.com/image/49519617_303.jpg",
            "showWhen": true,
            "autoCancel": true,
            "privacy": "Private",
            "payload": {
                "actions": "[{\"actionKey\": \"REDIRECT\",\"actionValue\": \"https://www.google.com/\"},{\"actionKey\": \"DISMISS\",\"actionValue\": null}]"
            }
        },
        "actionButtons": [
            {
                "key": "REDIRECT",
                "label": "Redirect",
                "autoCancel": true
            },
            {
                "key": "DISMISS",
                "label": "Dismiss",
                "autoCancel": true
            }
        ]
    },
    "to": "eZ0dsST_qUJqo-O82IUR27:APA91bGwwEP1OiZ_Gm1520n2va7CpzVCTBfl7OURXvvw7hktKZ4oB9hxeH-lIbtge2rvvD1600mzSy8lwd37PKZvPK7OSteVRAf2FRpz9FyZfeKM54i_2ASK_KcR822N0Zl-HALUBSa6"
}

i've sopped in debug in SwiftAwesomeNotificationPlugin.swift
line 255 let jsonData:String? = nil
image

Notification Importance (show as pop-up)

  • Notifications does't show as pop-up. I tried with NotificationImportance.Max and NotificationImportance.High in Importance: but it doesn't work. it's also not working in this demo project. It worked in previous version "0.0.4+4".

  • check attachment.

/////
Device: Samsung m30s
Version: Android 10 (Q)
/////

/// Attachment:

device-2020-11-11-150125

issue with iOS debug

hi, I'm trying to implement your package but when I try to debug, vs code give me this output
Schermata 2020-10-16 alle 14 21 56
pls help me :(

Scheduling Specific DateTimes

Hey, is it possible to schedule 2 or more Specific dateTimes with cron expression. For example how might i write these two UTC times.

2020-09-16 19:34:11.448002Z
2020-09-17 22:57:11.449339Z

Thanks

PlatformException getFirebaseToken could not fetch instanceID, types and labels must be unique

I'm trying to use awesome notification on my app, when on debug mode it's work well, but when on release mode there's an error caught. i'm using awesome_notifications: ^0.0.3+3.

PlatformException(getFirebaseToken could not fetch instanceID, types and labels must be unique,
java.lang.IllegalArgumentException: types and labels must be unique
    at i.a.a.d.b.a(Unknown Source:35)
    at i.a.a.d.b.a(Unknown Source:4)
    at i.a.a.f.i.a(Unknown Source:28)
    at i.a.a.f.i.a(Unknown Source:0)

and here's my initialize code.

 try {
      bool status = await awesomeNotifications.initialize('resource://drawable/app_icon',
        [
          NotificationChannel(
            channelKey: "local_notification",
            channelName: "Local Notification",
            channelDescription: "Channel for showing local notification",
            defaultColor: mainColor.themeColor,
            ledColor: mainColor.backgroundColor
          )
        ]
      );

      if(status == true) {
        awesomeNotifications.actionStream.listen((ReceivedNotification receivedNotification) {
          print(receivedNotification.body);
        });
      }
    } catch (e) {
      ErrorHandleProduct().errorHandle(e, ErrorHandleProductType.basic, callback: () async {
        await Future.delayed(Duration(seconds: 2));
        initialize();
      });
    }

is there any clue why this error happen? or there's some extra configuration for release. looking forward for the solution

Edit
i have solve the issue right now, im using minifyEnable true on my release gradle configuration, so i can't initialize awesome notification if minifyEnable is true, i'm curious why this package won't work if minifyEnable is true. or there's a way to use it but with extra configurations?

MissingPluginException(No implementation found for method createNewNotification on channel awesome_notifications)

Hi, I followed your instruction about how to use this package.
So, I added initialize channel in my main.dart
Then I call create notification from the app, it's work
But, when i call it from background, push notification, i got the error mesage

Unable to handle incoming background message.
I/flutter (20190): MissingPluginException(No implementation found for method createNewNotification on channel awesome_notifications)

What's wrong?

NotificationLayout

macOS Catalina (10.15.5)
Samsung m30s
Android 10 (Q)
awesome_notifications: ^0.0.5+2

  • i'm getting the following error when i used notificationLayout: NotificationLayout.BigText. but when i passed more texts in body then it's working. why it's not working for small text?.

(not working)
body: "Lorem ipsum dolor sit amet, consectetur".

(working)
body: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation."

//////////////// ERROR

W/System.err: java.lang.IndexOutOfBoundsException: getChars (0 ... 49) ends beyond length 11 W/System.err: at android.text.SpannableStringBuilder.checkRange(SpannableStringBuilder.java:1325) W/System.err: at android.text.SpannableStringBuilder.getChars(SpannableStringBuilder.java:1205) W/System.err: at android.text.TextUtils.getChars(TextUtils.java:154) W/System.err: at android.text.SpannableStringBuilder.<init>(SpannableStringBuilder.java:68) W/System.err: at android.text.SpannableStringBuilder.subSequence(SpannableStringBuilder.java:1197) W/System.err: at me.carda.awesome_notifications.notifications.NotificationBuilder.setBigTextStyle(NotificationBuilder.java:586) W/System.err: at me.carda.awesome_notifications.notifications.NotificationBuilder.setLayout(NotificationBuilder.java:514) W/System.err: at me.carda.awesome_notifications.notifications.NotificationBuilder.getNotificationBuilderFromModel(NotificationBuilder.java:185) W/System.err: at me.carda.awesome_notifications.notifications.NotificationBuilder.createNotification(NotificationBuilder.java:83) W/System.err: at me.carda.awesome_notifications.notifications.NotificationSender.showNotification(NotificationSender.java:190) W/System.err: at me.carda.awesome_notifications.notifications.NotificationSender.doInBackground(NotificationSender.java:121) W/System.err: at me.carda.awesome_notifications.notifications.NotificationSender.doInBackground(NotificationSender.java:25) W/System.err: at android.os.AsyncTask$3.call(AsyncTask.java:378) W/System.err: at java.util.concurrent.FutureTask.run(FutureTask.java:266) W/System.err: at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:289) W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) W/System.err: at java.lang.Thread.run(Thread.java:919)

_////////////////

  • When i use notificationLayout: NotificationLayout.BigText body content is displayed 2 times. how can i remove it?
  • check below images.

- NotificationLayout.BigText

img_bigtext_notif

- DEFAULT
img_default_notif

Scheduling not working

I've scheduled a notification with NotificationSchedule but it is not shown.

var fiveSecondsDelayed = DateTime.now().add(Duration(seconds: 5));
await AwesomeNotifications().createNotification(content: NotificationContent(id: 111, channelKey: "alarm", title: 'scheduled title', body: 'scheduled body'), schedule: NotificationSchedule(initialDateTime: fiveSecondsDelayed));```

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.