-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[firebase_messaging] Can't make 5.1.5 to work with instructions. #145
Comments
i was also facing this issue during the implementation by following the documentation. you can follow this link. |
I'm have the "Attempt to invoke virtual method 'android.app.Application android.app.Activity.getApplication()' on a null object reference" issue i made a super empty example and the issue still happening
|
i managed to get to a point where i dont get the error, for some reason when i removed flutter_downloader: ^1.1.7 from pubspec.ymal (update to ^1.1.7 did not helped) but when i put the app in the background and i am getting a push notification, the onBackgroundMessage handler is not invoke can some please explain (due to no documentation), when does the onBackgroundMessage handler supposed to be fire ? |
I've tried to find the issue, and I've created a new project for it, and tried to find the differences, because in the new application everything worked like a charm. What I found is that in my main project I have the 'flutter_typeahead: 1.6.1' plugin, and if I add that to the new project it throws the error and background messages do not work. It adds the keyboard_visibility 0.5.6 plugin too, and in its registerWith() method it throws the getApplication() on a null object error.
As I see YonatanAmitzur's flutter_downloader problem is the same, because in its registerWith() method it tries to get the application too. If I don't set up the flutter_messaging, the flutter_typeahead plugin works without errors. Should I move there with the issue, or stay here? |
Hi, I could configure well to the point that I can receive push notification with the app terminated (after it runs at least once). The notifications arrive, but when we click on them and it opens the app, it doesn't get the notification payload, doesn't trigger any of the configure methods. |
@cetorres if you receive all messages properly, but the onResume / onLaunch ist not triggered, then you forgot the "click_action" payload in your notification (not possible through firebase console) or didnt specifiy it in your manifest. Check readme.md for the exact implementation :) |
@markuspaschi I'm sending the "click_action" inside the data in my payload. And I also have it configured correctly in my Android manifest. Please see below: My payload that's being sent to https://fcm.googleapis.com/fcm/send {
"notification": {
"title": "New Customer",
"body": "A new customer was created."
},
"priority": "high",
"data": {
"click_action": "FLUTTER_NOTIFICATION_CLICK",
"customer_id": 1,
"customer_name": "Test Customer",
"user_name": "John Doe",
"user_id": 2
},
"to": "[DEVICE_ID]"
} Inside my AndroidManifest.xml <activity
android:name=".MainActivity"
...>
...
<intent-filter>
<action android:name="FLUTTER_NOTIFICATION_CLICK" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity> |
I have changed NOTHING . in my code and suddenly this error appeared, still haven't fixed :/ |
I'm using Flutter and I'm looking at the "[ZeroHung]zrhung_get_config: Get config failed for wp[0x0008]" that is network related error connected to Honor and Huawei devices, I want to know if the people here having issues with network connectivity, using HTPP package or using other network-related packages ( like firebase) have Honor or Huawei devices too. I have identified 2 models that have this issues ID: COR L29 that's an Honor Play phone and ID: SNE LX3 is a Huawei Mate 20. Thanks and sorry to bother. |
all the time my app is terminated an on debug console writen: D/AndroidRuntime( 2912): Shutting down VM my firebase_messaging: firebase_messaging: ^5.1.6 |
Did you write your onBackgroundMessage handler as a global function? If not, you might get this PluginRegistranrCallback error. |
I'm also having this issue. Yes, I have |
I have same error 5.1.6 version. If you add onBackgroundMessage callback will be another error:
Conclusion: Firebase Messaging full not works on Flutter, because not variant to use it. |
@iapicca it's not the same problem, This error is due to a bug that does not allow you to register plugins when using a custom Main in AndroidManifest.xml. Even though the class inherits from FlutterApplication, currentActivity is always null causing NullPointerException when trying to register a plugin. |
Same @banfger issue problem (the first post) with version |
In my case it conflict with flutter_blue. The same as you. Any solution or work-around for this problem. |
For DomingoMG's answer here and don't forget to remove
from the mainactivity file under the android folder. If not, you will get an error. |
I have the same conflict with flutter_blue. Maybe you found solution to fix it? |
This helped in my project:
|
Can you share your Application.kt & MainActivity.kt code? Would also be interesting to see what your android:name="" in AndroidManifest.xml is. Can you share that as well? |
Hey all 👋 As part of our roadmap (#2582) we've just shipped a complete rework of the If you can, please try out the dev release (see the migration guide for upgrading and for changes) and if you have any feedback then join in the discussion here. Given the scope of the rework I'm going to go ahead and close this issue in favor of trying out the latest plugin. Thanks everyone 🤓 |
Describe the bug
With 5.1.4 I get the notifications succesfully, but I need the background service in my app. The problem is with 5.1.5 I can't even get the basic notifications.
If the Application.java is not set (it is stated as optional), when I get a notification the app crashes with this error:
When the Application file is set properly along with the onBackgroundMessage, on app startup I get this:
Flutter doctor:
To Reproduce
Steps to reproduce the behavior:
Following the instructions of firebase_messaging.
Expected behavior
Messaging working properly after following the intstuctions.
Additional context
The text was updated successfully, but these errors were encountered: