Awesome Notifications add-on plugin to enable push notifications through Firebase Cloud Messaging with all awesome notifications features.

Overview

Awesome Notifications FCM

image

Flutter Firebase Discord

pub package Open Source Love

Awesome Notifications add-on to send push notifications using FCM (Firebase Cloud Messaging), with all awesome notifications features.

Features

  • Create Push Notifications for Android and iOS using Flutter and Firebase Cloud Messaging services (FCM).
  • Enable all Awesome Notifications images, layouts, emoticons, buttons and sounds on push notifications.
  • Dismiss and cancel notifications remotely by Notification ID, Group ID or Channel ID.
  • Use Firebase console (servless) or your backend server to send push notifications
  • Get the Firebase Device Token and the Native Device Token.
  • Execute remote background instructions using silent push notifications.
  • Send messages to multiple devices using topic subscription.

Exemplification of how you can send push notifications using awesome_notifications_fcm



⚠️ ATTENTION ⚠️
Users from firebase_messaging plugin

This plugin contains all features available in firebase_messaging plugin + all Awesome Notification features. Because of this, awesome_notifications_fcm plugin is incompatible with firebase_messaging, as both plugins will compete each other to acquire global notification resources.

So, you MUST not use firebase_messaging with awesome_notifications_fcm. All other Firebase plugins are compatible with awesome notification plugins.

To migrate firebase_messaging to awesome_notifications_fcm, please take a look at:
How to migrate firebase_messaging plugin.


Next steps

  • Include Web support
  • Include Windows support
  • Include MacOS support
  • Include Linux support

Donate via PayPal or BuyMeACoffee

Help us to improve and maintain our work with donations of any amount, via Paypal. Your donation will be mainly used to purchase new devices and equipments, which we will use to test and ensure that our plugins works correctly on all platforms and their respective versions.

Donate with PayPal

Buy Me A Coffee


Discord Chat Server

To stay tuned with new updates and get our community support, please subscribe into our Discord Chat Server:

Discord
https://discord.awesome-notifications.carda.me




📝 Important initial notes

  1. This plugin is an add-on of Awesome Notifications plugin and, because of it, depends on it.
  2. Push notifications, like local notifications, are not 100% reliable. That means your notification may be delayed or denied due to battery saving modes, background processing blocking, internet connection failures, etc. Keep this in mind when designing your business logic.
  3. On iOS, push notifications are only delivered to real devices, but all other features can be tested using simulators.
  4. To check what is happening with your notification while the app is terminated, you need to read all logs from the device. To do this on Android, use LogCat from Android Studio. On iOS, use the "Console.app" program available on MacOS.
  5. If your app was forced to stop on any platform, all notifications will no longer be delivered until your app is reopened.


🛠 Getting Started

In this section, you going to configue your Android and iOS project to use all features available in awesome_notifications_fcm:


Plugin Dependencies

Add the plugins bellow as a dependency in your pubspec.yaml file:

  firebase_core: ^1.24.1
  awesome_notifications: ^0.7.X
  awesome_notifications_fcm: ^0.7.X

OBS: Always certificate to use the last versions of all these plugins.



🤖 Android Configuration

1 - You MUST apply Google Play Services in your project to use FCM services. To do that, first you need to import com.google.gms:google-services package into your Android project, adding the line bellow in your build.gralde file, located at "android" folder. (Certifies to use the latest version)

buildscript {
    ...
    dependencies {
        ...
        classpath 'com.google.gms:google-services:4.3.10'
        ...
    }
    ...
}

2 - Them, you need to apply google play services, adding the line bellow at the end of build.gralde file, located at "android/app" folder.

apply plugin: 'com.google.gms.google-services'

Now, your Android project is configured to use awesome_notifications_fcm. Awesome!!



🍎 iOS Configuration

1 - First, ensure to have the last XCode version available instaled with at least Swift 5.5.7 (XCode version 14.A400).

image


2 - Run the command pod install inside your iOS project folder.

OBS: In case it returns some version conflict, run pod repo update to update your local repository and then rename/erase the file "Podfile.lock" inside your iOS folder. For last, try to execute the command pod install once again.

image


3 - To be able to add pictures and buttons on iOS push notifications, its necessary to create a Notification target extension using XCode. Target extensions are a type of lightweight application capable to run on background for specific tasks.

To do that, you need to open your Flutter project using XCode. Go to your iOS project folder and open the file Runner.xcfworkspace.

With your project opened, go to "File -> New -> Target"

image

... and chose "Notification Service Extension"

image

... and add a name to your target extension, ending with "ServiceExtension".

image


4 - Now, you need to include Flutter and Awesome Notifications FCM libraries to your Notification Service Extension. To do that you need to modify your "PodFile", adding the lines bellow at the end of the file, replacing the 2 mentions of MyAppServiceExtension by your service extension name:

################  Awesome Notifications FCM pod mod  ###################
awesome_fcm_pod_file = File.expand_path(File.join('plugins', 'awesome_notifications_fcm', 'ios', 'Scripts', 'AwesomeFcmPodFile'), '.symlinks')
require awesome_fcm_pod_file
target 'MyAppServiceExtension' do
  use_frameworks!
  use_modular_headers!
  
  install_awesome_fcm_ios_pod_target File.dirname(File.realpath(__FILE__))
end
update_awesome_fcm_service_target('MyAppServiceExtension', File.dirname(File.realpath(__FILE__)), flutter_root)
################  Awesome Notifications FCM pod mod  ###################

Them execute the command pod install to update your target extension.


5 - At this point, your target extension is able to use awesome notifications library. Inside your Target extension folder, edit the file NotificationService.swift, replacing the class UNNotificationServiceExtension by DartAwesomeServiceExtension and erasing all Notification Service content. The final file should look like this:

import UserNotifications
import awesome_notifications_fcm

@available(iOS 10.0, *)
class NotificationService: DartAwesomeServiceExtension {

}

6 - Also to build the app correctly, you need to ensure to set some build settings options for each of your app targets. In your project view, click on Runner -> Target Runner -> Build settings...

image

... and set the following options:

In Runner Target:

  • Build libraries for distribution => NO
  • Only safe API extensions => NO
  • iOS Deployment Target => 11 or greater

In your NotificationServiceExtension Target:

  • Build libraries for distribution => NO
  • Only safe API extensions => YES
  • iOS Deployment Target => 11 or greater

7 - Lastly, you need to add 3 capabilities to your XCode projec, specially "App Groups", allowing your target extensions to share data with each other.

To do this, run your application and search on debug console for the application group name automatically generated by Awesome Notifications. This name is unique for each application.

image

Them, open your XCode project, go to Targets -> Runner -> Singing and Capabilities -> Click on "+" icon and add "App Groups", "Push Notifications" and "Remote", checking "background fetching" and "remote notification" options.

image

On "App Groups", you need to add the app group name automatically generated by awesome notifications. This app group name MUST start with "group.". Them add the same "App Group" capability with the same app group name on your notification target extension.

image


Now, your iOS project is configured to use awesome_notifications_fcm. Awesome!! (phew!)


📝 Important notes

  1. Push notifications on iOS DO NOT support IDs/Identifiers.
  2. Push notifications are only delivered to real devices, all other features can be tested using simulators.
  3. Push notifications are always delivered, even in a catastrophic error in your configuration, json package or notification service extension. In these cases, your notification is displayed as simply as possible. To allow you to avoid such situation, awesome sets these notifications with category "INVALID", and you can filter this category editing your info.plist, but you need to ask Apple for permission to do it. To know more about, please check com.apple.developer.usernotifications.filtering.
  4. If you do not set "mutable_content" to true, your notification will not be delivered to NSE (Notification Service Extension) and modified to have awesome notification customizations. Instead, it will be delivered only with originals title and body content.
  5. If you do not set "content_available" to true, your silent push notification will not be delivered.
  6. Is recommended to set the badge value in the notification section at same time as in data, because in NSE failures, iOS will reade the badge value present in notification section. Meantime, Android FCM library does not delivery badge value inside notification section, so you need to set it inside data section.
  7. You must not use silent push notifications to often, otherwise Apple will starts to block your device to run on background. You can use "Console.app" on MacOS to get the device's logs and check if your app is getting blocked.
  8. Your push notifications can be denied on iOS if your users don't open your app for a long time. This limitation is canceled as soon as your user reopen your application manually.


📋 Creating a Firebase Project to send Push Notifications

To send push notifications using FCM (Firebase Cloud Message) you need to have an Firebase account with Cloud Messaging enable and copy the google-services.info (iOS) and google-services.json (Android) files at correct places. Also, you need to send to Firebase the APNs certificates to enable the comunication between Firebase and Apple servers. In this section we going to explain to you how to do all of that.

First, you need to create an Firebase account and activate the Firebase service called Cloud Messaging:

1 - Sign in Firebase at https://firebase.google.com
2 - Click Go to console
3 - Click + Add project and follow the prompts to create a project. You can name your project anything you want
4 - Once the project is created, the project configuration page is automatically open. Search for the link Cloud Messaging and add the service into your Firebase Account

After activate the service, a new configuration page will be displayed. This process can be repeated and edited if necessary at any time, for all platforms that you need.

In this configuration page, set correctly your app id and, on second section, download the file called google-services.info (iOS) or google-services.json (Android). The google-services.info must be placed inside the folder "ios/Runner" folder and the google-services.json must be placed inside "android/app/src" folder.


Adding APNs Certificate into your Firebase account

To allow Firebase send push notifications to iOS devices, its necessary to do an extra step to create the APNs certificate.


1 - Go to https://developer.apple.com, sing into an Apple Account and go to "Certificates" and click on "+" button.
2 - Go to Services section and check Apple Push Notification service SSL and click on "Continue"
3 - Insert the same iOS App ID configured in your Firebase Cloud Messaging.
4 - In your MacOS machine, Launch Keychain Access app, located in /Applications/Utilities.
5 - Choose Keychain Access > Certificate Assistant > Request a Certificate from a Certificate Authority.
6 - In the Certificate Assistant dialog, enter all informations needed, leaving the CA Email Address field empty.
7 - Choose “Saved to disk,” then click Continue.
8 - Now, go back to the online certificate process and upload the certificate generated in your local machine to Apple
9 - Attention: Download the file and store it in a safe place. This file can be donwload only once.
10 - Lastly, upload this last certificate to Firebase in Project View -> Cloud Messaging -> Apple App Configurations.


And that's it! Now your Firebase is fully configured to send push notifications to iOS and Android.



📫 Requesting Firebase Token

There is two ways to send push notifications to a device:

  • Getting the FCM token generated by Firebase. This token is unique for each user, device and app installed. Also, this token can be renewed by Firebase at any time.
  • Sending a multicast message to a topic where the devices are subscribed on.

So, to send notifications, first you need to initialize Firebase, AwesomeNotificationsFcm and them request the FCM token. Is not always possible to generate the FCM token and this process depends on Internet connection.

  //  *********************************************
  ///     INITIALIZATION METHODS
  ///  *********************************************

  static Future<void> initializeRemoteNotifications({
    required bool debug
  }) async {
    await Firebase.initializeApp();
    await AwesomeNotificationsFcm().initialize(
        onFcmSilentDataHandle: NotificationController.mySilentDataHandle,
        onFcmTokenHandle: NotificationController.myFcmTokenHandle,
        onNativeTokenHandle: NotificationController.myNativeTokenHandle,
        // This license key is necessary only to remove the watermark for
        // push notifications in release mode. To know more about it, please
        // visit http://awesome-notifications.carda.me#prices
        licenseKey: null,
        debug: debug);
  }

  //  *********************************************
  ///     REMOTE NOTIFICATION EVENTS
  ///  *********************************************

  /// Use this method to execute on background when a silent data arrives
  /// (even while terminated)
  @pragma("vm:entry-point")
  static Future<void> mySilentDataHandle(FcmSilentData silentData) async {
    print('"SilentData": ${silentData.toString()}');

    if (silentData.createdLifeCycle != NotificationLifeCycle.Foreground) {
      print("bg");
    } else {
      print("FOREGROUND");
    }

    print("starting long task");
    await Future.delayed(Duration(seconds: 4));
    final url = Uri.parse("http://google.com");
    final re = await http.get(url);
    print(re.body);
    print("long task done");
  }

  /// Use this method to detect when a new fcm token is received
  @pragma("vm:entry-point")
  static Future<void> myFcmTokenHandle(String token) async {
    debugPrint('FCM Token:"$token"');
  }

  /// Use this method to detect when a new native token is received
  @pragma("vm:entry-point")
  static Future<void> myNativeTokenHandle(String token) async {
    debugPrint('Native Token:"$token"');
  }
}

To request the FCM token, you can use await to wait for token be returned by the method requestFirebaseAppToken or intercept the token with your static method myFcmTokenHandle.

  // Request FCM token to Firebase
  Future<String> getFirebaseMessagingToken() async {
    String firebaseAppToken = '';
    if (await AwesomeNotificationsFcm().isFirebaseAvailable) {
      try {
        firebaseAppToken = await AwesomeNotificationsFcm().requestFirebaseAppToken();
      }
      catch (exception){
        debugPrint('$exception');
      }
    } else {
      debugPrint('Firebase is not available on this project');
    }
    return firebaseAppToken;
  }

Send this token to your backend server and this way you got the "device address" to send notifications. Its recommended to also send the native token to your server, as not all push services are available by Cloud Messaging.



📣 Sending Push Notifications

Using Firebase portal


To send notifications using Firebase console, you can check this excelent tutorial about how to send push notifications on Firebase Console: Complete guide on sending Push using Firebase Cloud Messaging Console


Using your backend server / Postman


To send push notifications in awesome notifications with all features available, you must use the standard below (Android and iOS sections are optional):

{
    "to" : "{{fcm_token_ios}}",
    "priority": "high",
    "mutable_content": true,
    "notification": {
        "badge": 42,
        "title": "Huston! The eagle has landed!",
        "body": "A small step for a man, but a giant leap to Flutter's community!"
    },
    "data" : {
        "content": {
            "id": 1,
            "badge": 42,
            "channelKey": "alerts",
            "displayOnForeground": true,
            "notificationLayout": "BigPicture",
            "largeIcon": "https://br.web.img3.acsta.net/pictures/19/06/18/17/09/0834720.jpg",
            "bigPicture": "https://www.dw.com/image/49519617_303.jpg",
            "showWhen": true,
            "autoDismissible": true,
            "privacy": "Private",
            "payload": {
                "secret": "Awesome Notifications Rocks!"
            }
        },
        "actionButtons": [
            {
                "key": "REDIRECT",
                "label": "Redirect",
                "autoDismissible": true
            },
            {
                "key": "DISMISS",
                "label": "Dismiss",
                "actionType": "DismissAction",
                "isDangerousOption": true,
                "autoDismissible": true
            }
        ],
        "Android": {
            "content": {
                "title": "Android! The eagle has landed!",
                "payload": {
                    "android": "android custom content!"
                }
            }
        },
        "iOS": {
            "content": {
                "title": "Jobs! The eagle has landed!",
                "payload": {
                    "ios": "ios custom content!"
                }
            },
            "actionButtons": [
                {
                    "key": "REDIRECT",
                    "label": "Redirect message",
                    "autoDismissible": true
                },
                {
                    "key": "DISMISS",
                    "label": "Dismiss message",
                    "actionType": "DismissAction",
                    "isDangerousOption": true,
                    "autoDismissible": true
                }
            ]
        }
    }
}

To send silent push notifications, you must not use "notification" section and you need to use "content_available" instead of "mutable_content":

{
    "to" : "{{fcm_token_ios}}",
    "content_available": true,
    "priority": "high",
    "data" : {
        "data1": "fb787aa2-6387-4f65-a5a2-125f96ab4c14",
        "data2": "call_voice",
        "data3": "3c3079b7-ab5e-48a5-8c61-b64ebb4910a9",
        "data4": "5469846578",
    }
}

It's not required to have a real server to send push notifications. You can use REST programs to emulate your backend sending push notifications, like Postman.

Below is a Postman project/collection containing all avaliable Awesome Notifications FCM features to be changed and tested at your will:
Firebase FMC Example.postman_collection.json

To use it, download the json file and import it as collection into your Postman, remembering to replace the variables according to your Firebase project keys and your devices' tokens.



🚚 How to migrate firebase_messaging plugin.

To migrate from firebase_messaging you just need to replace firebase methods by its equivalents on Awesome Notifications and Awesome Notifications FCM:

  • FirebaseMessaging.onMessageOpenedApp -> AwesomeNotifications.getInitialNotificationAction()

  • FirebaseMessaging.onMessage -> static Future <void> onActionReceivedMethod(ReceivedAction receivedAction)

  • FirebaseMessaging.onBackgroundMessage -> static Future<void> mySilentDataHandle(FcmSilentData silentData)

  • FirebaseMessaging.requestPermission -> AwesomeNotifications().requestPermissionToSendNotifications()

To access non-static resources inside the static methods, you can use some design patterns:

  • Singleton classes
  • Static Flutter Navigator Key defined in MaterialApp widget

To switch the execution from background isolate to the main isolate of your application, where you have a valid context to redirect the users, use ReceivePort and SendPort classes.


(work in progress)

🔑 License key.

image

Local notifications using Awesome Notifications are always 100% free to use. And you can also test all push notifications features on Awesome Notifications FCM for free, Forever.

But to use Awesome Notifications FCM on release mode without the watermark [DEMO], you need to purchase a license key. This license key is a RSA digital signature, validated with private and public keys in conjunction with plugin versionings and your App ID / Bundle ID. Because of it, once the license key is generated for your app, its forever. It will never expires and do not require internet connection to be validated.


The price of a license key is $ 9.99 / App, and it contains:

  • Push Notifications without watermark
  • 1 license Key, expandable to 4 id variations
  • Perpetual Licenses
  • 2 Dedicated Support Meetings
  • 1 Year exclusive support on Discord
  • 1 Year of Free Updates

That way, you only pay a small contribution and help keep the plugin evolving and supporting it, as well as purchasing new devices to test, hiring new developers, etc.

The Awesome Notification's portal to purchasing and managing your license keys is now in the final stages of development. So for now, to purchase the license key, get in contact with us on our Discord community at https://discord.awesome-notifications.carda.me .

Comments
  • Application group name haven't automatically generated.

    Application group name haven't automatically generated.

    Hi! I did all settings according to docs, but do not have application group name in the logs.

    My logs:

    D/Swift: [AWESOME NOTIFICATIONS] Received a new valid APNs token (AwesomeNotificationsFcm:196)
    9.6.0 - [FirebaseAnalytics][I-ACS023012] Analytics collection enabled
    9.6.0 - [FirebaseAnalytics][I-ACS023220] Analytics screen reporting is enabled. Call Analytics.logEvent(AnalyticsEventScreenView, parameters: [...]) to log a screen view event. To disable automatic screen reporting, set the flag FirebaseAutomaticScreenReportingEnabled to NO (boolean) in the Info.plist
    [VERBOSE-2:FlutterObservatoryPublisher.mm(101)] Failed to register observatory port with mDNS with error -65555.
    [VERBOSE-2:FlutterObservatoryPublisher.mm(103)] On iOS 14+, local network broadcast in apps need to be declared in the app's Info.plist. Debug and profile Flutter apps and modules host VM services on the local network to support debugging features such as hot reload and DevTools. To make your Flutter app or module attachable and debuggable, add a '_dartobservatory._tcp' value to the 'NSBonjourServices' key in your Info.plist for the Debug/Profile configurations. For more information, see https://flutter.dev/docs/development/add-to-app/ios/project-setup#local-network-privacy-permissions
    Debug service listening on ws://127.0.0.1:59030/d9wYgbm4AuI=/ws
    Syncing files to device Aleksei’s iPhone...
    D/Swift: [AWESOME NOTIFICATIONS] Awesome Notifications service initialized (AwesomeNotificationsPlugin:1007)
    D/Swift: [AWESOME NOTIFICATIONS] Awesome notifications 10764864640 attached to app instance (AwesomeNotifications:103)
    D/Swift: [AWESOME NOTIFICATIONS] Awesome Notifications - UTC timezone : GMT (fixed) (DefaultsManager:62)
    D/Swift: [AWESOME NOTIFICATIONS] Awesome Notifications - Local timezone : Asia/Jerusalem (autoupdatingCurrent) (DefaultsManager:63)
    D/Swift: [AWESOME NOTIFICATIONS] Awesome Notifications - last displayed date : 2022-10-30 15:06:14 GMT (DefaultsManager:69)
    
      awesome_notifications: ^0.7.4
      awesome_notifications_fcm: ^0.7.4
    

    Doctor:

    Doctor summary (to see all details, run flutter doctor -v):
    [✓] Flutter (Channel stable, 3.3.6, on macOS 12.6 21G115 darwin-arm, locale en-DE)
    [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    [✓] Xcode - develop for iOS and macOS (Xcode 14.0.1)
    [✓] Chrome - develop for the web
    [✓] Android Studio (version 2021.3)
    [✓] IntelliJ IDEA Community Edition (version 2022.2.2)
    [✓] VS Code (version 1.72.2)
    [✓] Connected device (3 available)
    [✓] HTTP Host Availability
    
    • No issues found!
    
    bug 
    opened by awaik 12
  • Is there an action button or input text area for killed app?

    Is there an action button or input text area for killed app?

    Hey, I want to use notifications for Soft OTP, message reply or accept/rejeect request. Can I do that when app completely killed(not on the background or foreground)with this lib? I look at the documentation but I couldn't find anything. On the foreground or background I can use this features with data notification but I need this feature for killed app.

    enhancement 
    opened by canibal1 4
  • Compilation Error

    Compilation Error

    Flutter doctor :

    doctor --verbose [√] Flutter (Channel stable, 3.0.5, on Microsoft Windows [Version 10.0.22000.1098], locale en-US) • Flutter version 3.0.5 at D:\SMSBApp.fvm\flutter_sdk • Upstream repository https://github.com/flutter/flutter.git • Framework revision f1875d570e (3 months ago), 2022-07-13 11:24:16 -0700 • Engine revision e85ea0e79c • Dart version 2.17.6 • DevTools version 2.12.2

    [√] Android toolchain - develop for Android devices (Android SDK version 30.0.3) • Android SDK at C:\Users\bhard\AppData\Local\Android\sdk • Platform android-33, build-tools 30.0.3 • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01) • All Android licenses accepted.

    [√] Chrome - develop for the web • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

    [!] Visual Studio - develop for Windows (Visual Studio Community 2022 17.3.2) • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community • Visual Studio Community 2022 version 17.3.32819.101 X Visual Studio is missing necessary components. Please re-run the Visual Studio installer for the "Desktop development with C++" workload, and include these components: MSVC v142 - VS 2019 C++ x64/x86 build tools - If there are multiple build tool versions available, install the latest C++ CMake tools for Windows Windows 10 SDK

    [√] Android Studio (version 4.1) • Android Studio at C:\Program Files\Android\Android Studio • Flutter plugin can be installed from: https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

    [√] VS Code (version 1.68.1) • VS Code at C:\Users\bhard\AppData\Local\Programs\Microsoft VS Code • Flutter extension version 3.42.0

    [√] Connected device (4 available) • sdk gphone x86 arm (mobile) • emulator-5554 • android-x86 • Android 11 (API 30) (emulator) • Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22000.1098] • Chrome (web) • chrome • web-javascript • Google Chrome 106.0.5249.119 • Edge (web) • edge • web-javascript • Microsoft Edge 106.0.1370.42

    [√] HTTP Host Availability • All required HTTP hosts are available

    On Compiling - getting below error

    /C:/Users/bhard/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/awesome_notifications-0.7.2/lib/src/utils/resource_image_provider.dart:40:26: Error: 'DecoderBufferCallback' isn't a type. ResourceImage key, DecoderBufferCallback decode) { ^^^^^^^^^^^^^^^^^^^^^ /C:/Users/bhard/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/awesome_notifications-0.7.2/lib/src/utils/resource_image_provider.dart:48:26: Error: 'DecoderBufferCallback' isn't a type. ResourceImage key, DecoderBufferCallback decode) async { ^^^^^^^^^^^^^^^^^^^^^ /C:/Users/bhard/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/awesome_notifications-0.7.2/lib/src/utils/resource_image_provider.dart:50:5: Error: 'Uint8List' isn't a type. Uint8List? bytes = ^^^^^^^^^

    help wanted 
    opened by yashhema 4
  • Stackoverflow when accesing FcmSilentData.createdLifeCycle

    Stackoverflow when accesing FcmSilentData.createdLifeCycle

    Trying to access FcmSilentData.createdLifeCycle field in the onFcmSilentDataHandle handler causes an stackoverflow.

    Code to reproduce:

        await _notifyFCM.initialize(
            onFcmTokenHandle: _awesomeNotificationFCMTokenHandler,
            onFcmSilentDataHandle: _awesomeNotificationFCMBackgroundHandler,
            licenseKey: null);
    ...
      @pragma("vm:entry-point")
      static Future<void> _awesomeNotificationFCMBackgroundHandler(
          FcmSilentData message) async {
    
        DartPluginRegistrant.ensureInitialized();
        if (message.createdLifeCycle != NotificationLifeCycle.Foreground) {
          print("bg");
        } else {
          print("FOREGROUND");
        }
      }
    
    

    Console Output:

    W/leraker.androi( 9467): Accessing hidden method Landroid/os/WorkSource;->add(I)Z (unsupported,test-api, reflection, allowed)
    W/leraker.androi( 9467): Accessing hidden method Landroid/os/WorkSource;->add(ILjava/lang/String;)Z (unsupported,test-api, reflection, allowed)
    W/leraker.androi( 9467): Accessing hidden method Landroid/os/WorkSource;->get(I)I (unsupported, reflection, allowed)
    W/leraker.androi( 9467): Accessing hidden method Landroid/os/WorkSource;->getName(I)Ljava/lang/String; (unsupported, reflection, allowed)
    D/Android: [Awesome Notifications]( 9467): A new Awesome FCM service has started (AwesomeFcmService:46)
    D/Android: [Awesome Notifications]( 9467): received a new fcm push (id: 0:1665002739800278%73e8ddfbf9fd7ecd) (AwesomeFcmService:134)
    D/Android: [Awesome Notifications]( 9467): A new silent background service has started (FcmSilentService:23)
    I/Android: [Awesome Notifications]( 9467): Initializing Flutter global instance. (FcmDartBackgroundExec:144)
    I/Android: [Awesome Notifications]( 9467): Creating background FlutterEngine instance. (FcmDartBackgroundExec:157)
    D/EGL_emulation( 9467): eglCreateContext: 0xb400007d27de2290: maj 3 min 0 rcv 3
    D/EGL_emulation( 9467): eglCreateContext: 0xb400007d27dd8d50: maj 3 min 0 rcv 3
    D/HostConnection( 9467): createUnique: call
    D/HostConnection( 9467): HostConnection::get() New Host Connection established 0xb400007d27de2e90, tid 9594
    D/HostConnection( 9467): HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV_Cache ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_has_shared_slots_host_memory_allocator ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit ANDROID_EMU_vulkan_queue_submit_with_commands ANDROID_EMU_sync_buffer_data ANDROID_EMU_read_color_buffer_dma GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_3_0 
    D/EGL_emulation( 9467): eglMakeCurrent: 0xb400007d27dd8d50: ver 3 0 (tinfo 0x7f3a87d280) (first time)
    W/MediaSessionCompat( 9467): Couldn't find a unique registered media button receiver in the given context.
    D/Android: [Awesome Notifications]( 9467): Awesome Notifications plugin attached to Android 32 (AwesomeNotificationsPlugin:155)
    D/Android: [Awesome Notifications]( 9467): Awesome Notifications attached to engine for Android 32 (AwesomeNotificationsPlugin:137)
    D/Android: [Awesome Notifications]( 9467):  subscribed to receive FCM events (AwesomeFcmEventsReceiver:51)
    D/Android: [Awesome Notifications]( 9467):  subscribed to receive FCM events (AwesomeFcmEventsReceiver:71)
    I/Android: [Awesome Notifications]( 9467): Executing background FlutterEngine instance for silent FCM. (FcmDartBackgroundExec:180)
    D/EGL_emulation( 9467): app_time_stats: avg=28.29ms min=13.10ms max=63.60ms count=36
    I/flutter ( 9467): Awesome Notifications FCM: An error occurred in your background messaging handler:
    I/flutter ( 9467): Stack Overflow
    I/Android: [Awesome Notifications]( 9467): All silent data fetched. (FcmDartBackgroundExec:249)
    I/Android: [Awesome Notifications]( 9467): Shutting down background FlutterEngine instance. (FcmDartBackgroundExec:208)
    D/Android: [Awesome Notifications]( 9467): Awesome Notifications plugin detached from Android 32 (AwesomeNotificationsPlugin:180)
    D/Android: [Awesome Notifications]( 9467):  unsubscribed from notification events (AwesomeFcmEventsReceiver:59)
    D/Android: [Awesome Notifications]( 9467):  unsubscribed from notification events (AwesomeFcmEventsReceiver:79)
    I/Android: [Awesome Notifications]( 9467): FlutterEngine instance terminated. (FcmDartBackgroundExec:215)
    
    bug help wanted 
    opened by Clon1998 4
  • Type 'DecoderBufferCallback' not found and 'Uint8List' not found.

    Type 'DecoderBufferCallback' not found and 'Uint8List' not found.

    Running Gradle task 'assembleDebug'... ../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/awesome_notifications-0.7.4+1/lib/src/utils/resource_image_provider.dart:40:26: Error: Type 'DecoderBufferCallback' not found. ResourceImage key, DecoderBufferCallback decode) { ^^^^^^^^^^^^^^^^^^^^^ ../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/awesome_notifications-0.7.4+1/lib/src/utils/resource_image_provider.dart:48:26: Error: Type 'DecoderBufferCallback' not found. ResourceImage key, DecoderBufferCallback decode) async { ^^^^^^^^^^^^^^^^^^^^^ ../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/awesome_notifications-0.7.4+1/lib/awesome_notifications_method_channel.dart:186:10: Error: Type 'Uint8List' not found. Future<Uint8List?> getDrawableData(String drawablePath) async { ^^^^^^^^^ ../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/awesome_notifications-0.7.4+1/lib/src/utils/resource_image_provider.dart:21:7: Error: The non-abstract class 'ResourceImage' is missing implementations for these members:

    • ImageProvider.load Try to either
    • provide an implementation,
    • inherit an implementation from a superclass or mixin,
    • mark the class as abstract, or
    • provide a 'noSuchMethod' implementation.

    class ResourceImage extends ImageProvider { ^^^^^^^^^^^^^ ../../../development/flutter/packages/flutter/lib/src/painting/image_provider.dart:567:24: Context: 'ImageProvider.load' is defined here. ImageStreamCompleter load(T key, DecoderCallback decode); ^^^^ ../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/awesome_notifications-0.7.4+1/lib/src/utils/resource_image_provider.dart:40:26: Error: 'DecoderBufferCallback' isn't a type. ResourceImage key, DecoderBufferCallback decode) { ^^^^^^^^^^^^^^^^^^^^^ ../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/awesome_notifications-0.7.4+1/lib/src/utils/resource_image_provider.dart:48:26: Error: 'DecoderBufferCallback' isn't a type. ResourceImage key, DecoderBufferCallback decode) async { ^^^^^^^^^^^^^^^^^^^^^ ../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/awesome_notifications-0.7.4+1/lib/src/utils/resource_image_provider.dart:50:5: Error: 'Uint8List' isn't a type. Uint8List? bytes = ^^^^^^^^^ ../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/back_button_interceptor-5.0.2/lib/src/back_button_interceptor.dart:29:74: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.

    • 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../../../development/flutter/packages/flutter/lib/src/widgets/binding.dart'). static Future Function() handlePopRouteFunction = WidgetsBinding.instance!.handlePopRoute; ^ ../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/back_button_interceptor-5.0.2/lib/src/back_button_interceptor.dart:32:22: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
    • 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../../../development/flutter/packages/flutter/lib/src/widgets/binding.dart'). WidgetsBinding.instance!.handlePushRoute as Future Function(String?); ^

    FAILURE: Build failed with an exception.

    • Where:

    [✓] Flutter (Channel stable, 3.0.0, on macOS 12.6 21G115 darwin-arm (Rosetta), locale en-EG) • Flutter version 3.0.0 at /Users/development/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision ee4e09cce0 (6 months ago), 2022-05-09 16:45:18 -0700 • Engine revision d1b9a6938a • Dart version 2.17.0 • DevTools version 2.12.2

    [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc1) • Android SDK at /Users/Library/Android/sdk • Platform android-33, build-tools 33.0.0-rc1 • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840) • All Android licenses accepted.

    [✓] Xcode - develop for iOS and macOS (Xcode 14.0.1) • Xcode at /Applications/Xcode.app/Contents/Developer • CocoaPods version 1.11.2

    [✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome) ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

    [✓] Android Studio (version 2021.2) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)

    [✓] IntelliJ IDEA Ultimate Edition (version 2022.2) • IntelliJ at /Applications/IntelliJ IDEA.app • Flutter plugin version 69.0.5 • Dart plugin version 222.3345.108

    [✓] Connected device (2 available) • SM G610F (mobile) • 5203fd5afa51b33f • android-arm • Android 8.1.0 (API 27) • macOS (desktop) • macos • darwin-arm64 • macOS 12.6 21G115 darwin-arm (Rosetta) ! Error: sayed is not connected. Xcode will continue when sayed is connected and unlocked. (code -13)

    [✓] HTTP Host Availability • All required HTTP hosts are available

    ! Doctor found issues in 1 category. Process finished with exit code 0

    help wanted 
    opened by tebalink 3
  • target overrides the

    target overrides the "xy" build setting defined in Pods-MyAppServiceExtension/Pods-MyAppServiceExtension.debug.xcconfig

    Hey, I get these issues on pod install and cant fix them as they get overwritten every time. I'm debugging an issue where the app does crash on startup on the App Store review. I have that issue now for two weeks straight and searching for every possible cause. But it correlates with upgrading awesome_notifications, so I better check.

    So that's a try to validate if that output could cause some harm or if it's safe!?

    If so, sorry for the noise.

    [!] The `MyAppServiceExtension [Debug]` target overrides the `ENABLE_BITCODE` build setting defined in `Pods/Target Support Files/Pods-MyAppServiceExtension/Pods-MyAppServiceExtension.debug.xcconfig'. This can lead to problems with the CocoaPods installation
        - Use the `$(inherited)` flag, or
        - Remove the build settings from the target.
    
    [!] The `MyAppServiceExtension [Debug]` target overrides the `APPLICATION_EXTENSION_API_ONLY` build setting defined in `Pods/Target Support Files/Pods-MyAppServiceExtension/Pods-MyAppServiceExtension.debug.xcconfig'. This can lead to problems with the CocoaPods installation
        - Use the `$(inherited)` flag, or
        - Remove the build settings from the target.
    
    [!] The `MyAppServiceExtension [Debug]` target overrides the `BUILD_LIBRARY_FOR_DISTRIBUTION` build setting defined in `Pods/Target Support Files/Pods-MyAppServiceExtension/Pods-MyAppServiceExtension.debug.xcconfig'. This can lead to problems with the CocoaPods installation
        - Use the `$(inherited)` flag, or
        - Remove the build settings from the target.
    
    [!] The `MyAppServiceExtension [Release]` target overrides the `ENABLE_BITCODE` build setting defined in `Pods/Target Support Files/Pods-MyAppServiceExtension/Pods-MyAppServiceExtension.release.xcconfig'. This can lead to problems with the CocoaPods installation
        - Use the `$(inherited)` flag, or
        - Remove the build settings from the target.
    
    [!] The `MyAppServiceExtension [Release]` target overrides the `APPLICATION_EXTENSION_API_ONLY` build setting defined in `Pods/Target Support Files/Pods-MyAppServiceExtension/Pods-MyAppServiceExtension.release.xcconfig'. This can lead to problems with the CocoaPods installation
        - Use the `$(inherited)` flag, or
        - Remove the build settings from the target.
    
    [!] The `MyAppServiceExtension [Release]` target overrides the `BUILD_LIBRARY_FOR_DISTRIBUTION` build setting defined in `Pods/Target Support Files/Pods-MyAppServiceExtension/Pods-MyAppServiceExtension.release.xcconfig'. This can lead to problems with the CocoaPods installation
        - Use the `$(inherited)` flag, or
        - Remove the build settings from the target.
    
    [!] The `MyAppServiceExtension [Profile]` target overrides the `ENABLE_BITCODE` build setting defined in `Pods/Target Support Files/Pods-MyAppServiceExtension/Pods-MyAppServiceExtension.profile.xcconfig'. This can lead to problems with the CocoaPods installation
        - Use the `$(inherited)` flag, or
        - Remove the build settings from the target.
    
    [!] The `MyAppServiceExtension [Profile]` target overrides the `APPLICATION_EXTENSION_API_ONLY` build setting defined in `Pods/Target Support Files/Pods-MyAppServiceExtension/Pods-MyAppServiceExtension.profile.xcconfig'. This can lead to problems with the CocoaPods installation
        - Use the `$(inherited)` flag, or
        - Remove the build settings from the target.
    
    [!] The `MyAppServiceExtension [Profile]` target overrides the `BUILD_LIBRARY_FOR_DISTRIBUTION` build setting defined in `Pods/Target Support Files/Pods-MyAppServiceExtension/Pods-MyAppServiceExtension.profile.xcconfig'. This can lead to problems with the CocoaPods installation
        - Use the `$(inherited)` flag, or
        - Remove the build settings from the target.
    
    help wanted in discussion 
    opened by appinteractive 2
  • Could not find module 'awesome_notifications_fcm' for target 'x86_64-apple-ios-simulator'

    Could not find module 'awesome_notifications_fcm' for target 'x86_64-apple-ios-simulator'

    1 - Describe the bug

    I get the following warning in Xcode, could that be an issue? As far as I can tell, debug does work for now. If it is not an issue, there should maybe be a note in the README.

    Could not find module 'awesome_notifications_fcm' for target 'x86_64-apple-ios-simulator'; found: arm64-apple-ios-simulator, at: /Users/Greg/Library/Developer/Xcode/DerivedData/Runner-ggvlrwomhxdzqybvllkuxzmqawmi/Index.noindex/Build/Products/Debug-iphonesimulator/awesome_notifications_fcm/awesome_notifications_fcm.framework/Modules/awesome_notifications_fcm.swiftmodule
    

    3 - How To Reproduce the Error

    Follow the instructions in the README on a M1 Mac and see the issue in Xcode

    4 - Expected behavior

    Should also build on arm64 (mac M1 & M2)

    5 - Screenshots

    grafik help wanted in discussion 
    opened by appinteractive 2
  • cloud_functions incompability

    cloud_functions incompability

    After adding cloud_functions ^4.0.3 i get an error:

    FAILURE: Build failed with an exception.

    • What went wrong: Execution failed for task ':app:checkDebugDuplicateClasses'.

    A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable Duplicate class com.google.firebase.iid.FirebaseInstanceIdReceiver found in modules jetified-firebase-iid-20.0.1-runtime (com.google.firebase:firebase-iid:20.0.1) and jetified-firebase-messaging-23.1.0-runtime (com.google.firebase:firebase-messaging:23.1.0)

     Go to the documentation to learn how to <a href="d.android.com/r/tools/classpath-sync-errors">Fix dependency resolution errors</a>.
    
    • Try:

    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

    • Get more help at https://help.gradle.org

    BUILD FAILED in 14s Exception: Gradle task assembleDebug failed with exit code 1

    Using: awesome_notifications: ^0.7.4+1 awesome_notifications_fcm: ^0.7.4+1

    bug in discussion 
    opened by proczak1 2
  • `onNotificationCreatedMethod` does not do any actions on iOS

    `onNotificationCreatedMethod` does not do any actions on iOS

    Rules

    To report a bug and help us to provide the solution as fast as possible, please follow the instructions below:

    1 - Describe the bug

    When a notification comes, onNotificationCreatedMethod does not do any actions. It is only on iOS.

    2 - Provide us as much information as possible

    To help us to understand your issue, provide with your bug report all the relevant informations, such as:

    • Your plugins list inside the file pubspec.yaml (at least all notification plugins) :
      awesome_notifications: ^0.7.4+1
      awesome_notifications_fcm: ^0.7.4+1
    
    • What platform did you found the issue: iOS 16.2
    • What devices did you found the issue: iPhone X
    • How are you initializing the plugin:
    static Future<void> initializeLocalNotifications(
          {required bool debug}) async {
        await AwesomeNotifications()
            .initialize(null, [NotificationChannel(
      channelKey: 'channel.key',
      channelName: 'channel.name',
      channelDescription: 'channel.desc',
      playSound: true,
      importance: NotificationImportance.Max,
      soundSource: 'resource://raw/res_sound'
      enableVibration: true,
      channelShowBadge: true,
    )], debug: debug);
    
        // Get initial notification action is optional
        _instance.initialAction = await AwesomeNotifications()
            .getInitialNotificationAction(removeFromActionEvents: false);
      }
    

    Initializing Notification Events:

    static Future<void> startListeningNotificationEvents() async {
        AwesomeNotifications().setListeners(
            onActionReceivedMethod: onActionReceivedMethod,
            onNotificationCreatedMethod: onNotificationCreated,
            onNotificationDisplayedMethod: onNotificationDisplayed);
      }
    

    onNotificationCreated method:

    @pragma('vm:entry-point')
    static Future<void> onNotificationCreated(
          ReceivedNotification receivedNotification) async {
        print(
            '[NotificationController - onNotificationCreated] Notification Created!');
        showDialog(
            context: NavigationService.navigatorKey.currentContext!,
            builder: (_) => AlertDialog(
                  title: Text('Title here'),
                  content: Text('Content here'),
                ));
      }
    
    • How are you creating the notification:
    {
        "to": "{{ios_fcm_token}}",
        "mutable_content": true,
        "priority": "high",
        "notification": {
            "badge": 1,
            "title": "Notification Title",
            "body": "Notification body",
            "sound": "default"
        },
        "data": {
            "content": {
                "id": 1,
                "badge": 5,
                "channelKey": "channel.key",
                "displayOnForeground": true,
                "showWhen": true,
                "autoDismissible": true,
                "privacy": "Private",
                "payload": {
                    "foo" : "bar"
                }
            },
        }
    }
    
    • The output of flutter doctor command:
    [✓] Flutter (Channel stable, 3.3.9, on macOS 13.1 22C65 darwin-arm, locale
        en-ID)
    [✓] Android toolchain - develop for Android devices (Android SDK version
        32.1.0-rc1)
    [✓] Xcode - develop for iOS and macOS (Xcode 14.2)
    [✓] Chrome - develop for the web
    [✓] Android Studio (version 2021.3)
    [✓] VS Code (version 1.74.1)
    [✓] Connected device (4 available)
    [✓] HTTP Host Availability
    
    • No issues found!
    

    3 - How To Reproduce the Error

    Steps to reproduce the behavior:

    1. Send FCM notification with payload above
    2. The notification comes to the device
    3. onNotificationCreatedMethoddoes not do any actions.

    4 - Expected behavior

    The terminal should print [NotificationController - onNotificationCreated] Notification Created! and a dialog showed up.

    5 - Screenshots

    iOS terminal: image Android terminal: image

    6 - Additional context

    I checked in Console, It said No Service Extension record found for app. Here's the screenshot: image I already added Notification Service Extension in XCode. Are there any solutions for this issue? Thank you.

    bug 
    opened by adhityapaf 1
  • Firebase service is not available (check if you have google-services.json file)

    Firebase service is not available (check if you have google-services.json file)

    Rules

    To report a bug and help us to provide the solution as fast as possible, please follow the instructions below:

    1 - Describe the bug

    The bug is that the logs below are is being shown every time the app runs. Note: it doesn't show for some reason after a hot restart, also AwesomeNotificationsFcm().isFirebaseAvailable returns true after hot restart.

    E/Android: [Awesome Notifications](12070): Firebase service is not available (check if you have google-services.json file) (AwesomeNotificationsFcm:58)
    W/System.err(12070): me.carda.awesome_notifications.core.exceptions.AwesomeNotificationsException: Firebase service is not available (check if you have google-services.json file)
    W/System.err(12070): 	at me.carda.awesome_notifications.core.exceptions.ExceptionFactory.createNewAwesomeException(ExceptionFactory.java:31)
    W/System.err(12070): 	at me.carda.awesome_notifications_fcm.core.AwesomeNotificationsFcm.assertFirebaseServiceEnabled(AwesomeNotificationsFcm.java:231)
    W/System.err(12070): 	at me.carda.awesome_notifications_fcm.core.AwesomeNotificationsFcm.requestFcmCode(AwesomeNotificationsFcm.java:221)
    W/System.err(12070): 	at me.carda.awesome_notifications_fcm.AwesomeNotificationsFcmPlugin.channelMethodGetFcmToken(AwesomeNotificationsFcmPlugin.java:388)
    W/System.err(12070): 	at me.carda.awesome_notifications_fcm.AwesomeNotificationsFcmPlugin.onMethodCall(AwesomeNotificationsFcmPlugin.java:211)
    W/System.err(12070): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:262)
    W/System.err(12070): 	at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
    W/System.err(12070): 	at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:319)
    W/System.err(12070): 	at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
    W/System.err(12070): 	at android.os.Handler.handleCallback(Handler.java:942)
    W/System.err(12070): 	at android.os.Handler.dispatchMessage(Handler.java:99)
    W/System.err(12070): 	at android.os.Looper.loopOnce(Looper.java:201)
    W/System.err(12070): 	at android.os.Looper.loop(Looper.java:288)
    W/System.err(12070): 	at android.app.ActivityThread.main(ActivityThread.java:7898)
    W/System.err(12070): 	at java.lang.reflect.Method.invoke(Native Method)
    W/System.err(12070): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
    W/System.err(12070): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
    

    2 - Provide us as much information as possible

    • A very important note is that I have flavors setup on the project and there's multiple Firebase projects for every flavor witch can be the reason.
    • Related Plugins list inside pubspec.yaml, there is a lot of packages but those are the ones that can be related:
        awesome_notifications: ^0.7.4+1
        awesome_notifications_fcm: ^0.7.4+1
        cloud_firestore: ^4.0.3
        cloud_functions: ^4.0.3
        firebase_analytics: ^10.0.3
        firebase_app_check: ^0.1.1+2
        firebase_auth: ^4.1.0
        firebase_core: ^2.1.1
        firebase_crashlytics: ^3.0.3
        firebase_dynamic_links: ^5.0.3
        firebase_performance: ^0.9.0+3
        firebase_remote_config: ^3.0.3
        firebase_storage: ^11.0.3
    
    • Platform: Android
    • Pixel 5 API 33
    • I am initializing the plugin inside of my Home page's initState (after user have logged in) like this:
        final allowed = await awn.requestPermissionToSendNotifications();
        if (!allowed) return;
    
        final defaultChannel = NotificationChannel(
          channelKey: kDefaultChannelKey,
          channelName: kDefaultChannelName,
          channelDescription: kDefaultChannelDescription,
        );
    
        await AwesomeNotificationsFcm().initialize(
          onFcmSilentDataHandle: NotificationsService.mySilentDataHandle,
          onFcmTokenHandle: NotificationsService.myFcmTokenHandle,
          onNativeTokenHandle: NotificationsService.myNativeTokenHandle,
          licenseKeys: null,
        );
        await awn.initialize(null, [defaultChannel]);
    
    • I am creating the notification using Postman
    • The output of flutter doctor command
    Doctor summary (to see all details, run flutter doctor -v):
    [✓] Flutter (Channel stable, 3.3.7, on macOS 13.0 22A380 darwin-arm, locale en-US)
    [✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
    [✓] Xcode - develop for iOS and macOS (Xcode 14.1)
    [✓] Chrome - develop for the web
    [✓] Android Studio (version 2021.2)
    [✓] VS Code (version 1.73.0)
    [✓] Connected device (3 available)
    [✓] HTTP Host Availability
    
    • No issues found!
    

    3 - How To Reproduce the Error

    Steps to reproduce the behavior:

    1. Setup flavors in your project
    2. Add at least two flavors and both of them has it's own google-services.json file
    3. Add the code to initialize awesome notifications fcm
    4. See error

    4 - Expected behavior

    Awesome notifications initialized without the printed error.

    5 - Screenshots

    image

    6 - Additional context

    Feel free to ask any questions and I will try to respond ASAP. I am also open to jump in a call like we did in the past. Thanks again for the incredible work!

    bug 
    opened by iabdousd 0
  • Tap notification not working when app terminated for ios

    Tap notification not working when app terminated for ios

    In foreground and background mode when I tap in notification it will show a dialog that is logic in my app, but when I tap into notification when app is terminated and open app it not show dialog, please help me

    bug 
    opened by dangminhchau1994 0
  • Could not resolve me.carda:fcmandroidcore:0.7.6 on android

    Could not resolve me.carda:fcmandroidcore:0.7.6 on android

    1 - Describe the bug

    Trying to run app with awesome_notifications_fcm: 0.7.4+1, getting 521 from jitpack.io

    2 - Provide us as much information as possible

    Could not resolve me.carda:fcmandroidcore:0.7.6.
             > Could not get resource 'https://jitpack.io/me/carda/fcmandroidcore/0.7.6/fcmandroidcore-0.7.6.pom'.
                > Could not GET 'https://jitpack.io/me/carda/fcmandroidcore/0.7.6/fcmandroidcore-0.7.6.pom'. Received status code 521 from server: 
    

    3 - How To Reproduce the Error

    Steps to reproduce the behavior: -Run or build app on android

    help wanted in discussion 
    opened by radroot1 3
  • IOS, build failed, Multiple commands produce

    IOS, build failed, Multiple commands produce

    Hey, Thanks for your effort. I am using the plugin and it is working perfect in android.

    When I add it to IOS and configure it as in the documentation, I receive 4 errors like that with different files:

    Multiple commands produce '/Users/ADMIN/Library/Developer/Xcode/DerivedData/Runner-duaptdlbwpoocrcocfoqaihozxzd/Build/Products/Debug-iphonesimulator/XCFrameworkIntermediates/IosAwnFcmDist/IosAwnFcmCore.framework'
    

    What is the problem? Thanks in advance

    bug 
    opened by a7mdragab 2
  • warning: The CFBundleVersion of an app extension ('1') must match that of its containing parent app ('289').

    warning: The CFBundleVersion of an app extension ('1') must match that of its containing parent app ('289').

    On Build, I do get a warning, that my fcm service extension has the wrong version which should match the parent app.

    warning: The CFBundleVersion of an app extension ('1') must match that of its containing parent app ('289').
    
    help wanted in discussion 
    opened by appinteractive 2
  • Corrected spelling error in Awesome Notifications FCM Readme file.

    Corrected spelling error in Awesome Notifications FCM Readme file.

    Link: https://pub.dev/packages/awesome_notifications_fcm

    Actual Result: 1 - Go to https://developer.apple.com/, sing into an

    Resolved: 1 - Go to https://developer.apple.com/, sign into an

    opened by chandra-enercent 0
  • Correct the spelling error in Awesome Notifications FCM Readme file

    Correct the spelling error in Awesome Notifications FCM Readme file

    Link: https://pub.dev/packages/awesome_notifications_fcm Actual Result: Go to https://developer.apple.com/, sing into an

    Expected Result: Go to https://developer.apple.com/, sign into an

    documentation 
    opened by chandra-enercent 0
Releases(0.7.4+1)
Owner
Rafael Setragni
Full Stack Developer, passionate with hard problems to solve.
Rafael Setragni
Aprendendo a usar notificações Push com o Firebase Cloud Messaging

Notificações Push com Firebase Esse projeto foi desenvolvido com base no curso "Flutter: Push notifications com Firebase Cloud Messaging", da Alura. P

Roger Bernardo De Melo Lima 0 Dec 28, 2021
Arissendpushntfctns - Send Push notifications with Flutter and Firebase messaging II

Push notifications with Firebase messaging II Send push notifications on Android

Behruz Hurramov 6 Feb 11, 2022
Plugin to implement APNS push notifications on iOS and Firebase on Android.

apns Plugin to implement APNS push notifications on iOS and Firebase on Android. Why this plugin was made? Currently, the only available push notifica

null 0 May 14, 2022
Build an example app for receiving notification from Firebase Cloud Messaging (FCM)

notify Build an app demo for receiving notifications from Firebase Cloud Messaging. Check more information: https://firebase.google.com/docs/cloud-mes

TAD 3 Dec 9, 2022
Flutter Image add drag sort, Image add drag sort, support click event, delete, add, long press drag sort.

flutter_image_add_drag_sort Flutter Image add drag sort, Image add drag sort, support click event, delete, add, long press drag sort, support video fi

null 5 Jun 23, 2020
Flutter Push Notifications

Flutter Push Notifications Flutter applications implementing push notifications.

Shametha K G 5 Oct 17, 2022
Memebaaz is a video/images sharing app, Anyone can share short videos and images through app, the media will go through admin's approval.

MemeBaaz - Memes & Short Videos App Memebaaz is a Video/images Sharing App, Anyone can share short videos and images through app, the media will go th

Rakesh K. 18 Nov 14, 2022
Ahmed Elsayed 257 Jan 7, 2023
Flutter Local Notifications - Learn how to implement local notifications into both Android and iOS using flutter_local_notifications plugin.

Flutter Local Notifications Example Flutter Local Notifications - Learn how to implement local notifications into both Android and iOS using flutter_l

Sandip Pramanik 12 Nov 29, 2022
Flutterbodydetection - A flutter plugin that uses MLKit on iOS/Android platforms to enable body pose and mask detection using Pose Detection and Selfie Segmentation APIs for both static images and live camera stream.

body_detection A flutter plugin that uses MLKit on iOS/Android platforms to enable body pose and mask detection using Pose Detection and Selfie Segmen

null 18 Dec 5, 2022
Create flutter project with all needed configuration in two minutes (theme, localization, connect to firebase, FCM, local notifications, safe API call, error handling, animation..etc)

Flutter GetX Template Flutter Getx template to make starting project fast and easy . Introduction We all face the same problem when we want to start a

Emad Beltaje 150 Jan 7, 2023
Add features to the Android / iOS keyboard in a simple way.

Keyboard Actions Add features to the Android / iOS keyboard in a simple way. Because the keyboard that Android / iOS offers us specifically when we ar

Diego Velásquez López 641 Dec 27, 2022
A Flutter step_tracker plugin is collect information from user and display progress through a sequence of steps. this plugin also have privilege for fully customization from user side. like flipkart, amazon, myntra, meesho.

step_tracker plugin A Flutter step_tracker plugin is collect information from user and display progress through a sequence of steps. this plugin also

Roshan nahak 5 Oct 21, 2022
Push notification in Flutter using Firebase.

push_notification [1]Firebase Integration in Flutter project. [2]Parsing message in the app using on Message Stream while the app is foreground. [3]Ha

hebaabdelwhab 2 Dec 29, 2021
Send notification to flutter app using firebase messaging

Welcome Push Notification with Flutter & Firebase ⚠️ ⚠️ there is no google-services.json file attached in this project because of security issues, you

Dineth Siriwardana 1 Aug 28, 2022
A server app built using Shelf, configured to enable running with Docker

A server app built using Shelf, configured to enable running with Docker. This sample code handles HTTP GET requests to / and /echo/<message> Requests

Tornike Gogberashvili 1 Jan 26, 2022
Tribally SDKs enable your users to create communities and bring in more people to talk about the things they love.

tribally Tribally SDKs enable your users to create communities and bring in more people to talk about the things they love. Getting Started This proje

Horum 0 Dec 28, 2021