Plugin.FirebasePushNotifications
Plugin.FirebasePushNotifications copied to clipboard
[Bug] do you have this working?
Hi I am looking for a plugin that I can hook Push notification in maui .net 7 and 8 and came across this. Did you actually manage to get it working?
Really interested to know.. I get all sorts of issue with path length on win11 even though I have shortened my nuget path to just C:/nuget
Can you receive notification for both iOS and android?
thanks
Yeah, I know what you mean. There are some plugins but most of them are outdated or not working at all. I’m migrating an app from XF to MAUI .NET 7, but just for Android and iOS. My goal was to have something similar to the exising plugin (Plugin.FirebasePushNotification). It looks like this plugin is not maintained anymore and since we have a tight migration schedule, I had to act quickly.
The code in this library works for our cases. There is yet alot of cleanup work to be done. The original code is full of static state and has some major quality issues. I gonna tackle them as soon as I have some time. I keep you updated.
@thomasgalliker I am absolutely in the same position... None works and outdated and its such a critical mobile functionality. I am thinking of re-inventing the wheel myself but there is a lot to grasp specially on android... Please keep me uptodate.
The plan is to leave the current code base as it is and publish it as version 1.x in nuget.org. Can you check if the latest version of the nuget package works for you? https://www.nuget.org/packages/Plugin.FirebasePushNotifications
Later, I want to rework the code base, add some queuing to the push notification events, and more stuff. These changes are planned for a version 2.x and will introduce breaking API changes.
hi the problem I have and I believe its a xamarin.iOS issue is that the path is too long - I have win11 and I have already enabled long path but I get
Just to be clear: This project here will not work with Xamarin, it targets .NET MAUI for Android and iOS.
that was not xamarin that was a brand new maui app net 7 or 8!! the packages used are not added by me but from your plugin..
- Create a maui app .net 7 or 8
- Add your plugin
- get that error on windows 11
also note that Microsoft did not rename any of their projects in either ios or android they still left the "xamarin namespace"
Obviously they left some nuget names. I have not a clue whats wrong there. I develop my app on MacOS with Rider IDE. But it slso works on Windows 10 with VS 2022. I would recommend to checkout code with short paths. Other than that, I‘m not a big help.
Hi I am not expecting anything , and thanks for sharing this.. but anyone with a windows 11 and using windows as the main developer machine will not be able to install it
https://developercommunity.visualstudio.com/t/An-error-occurred-on-client-Build1647054/10370055#T-ND10375724
and there are many issues around long path with workaround etc.. because of this my nugets are now on c:/nugets
thanks
Crazy, absolutely crazy. I was waiting with Windows 11.... just as I was waiting with Xamarin Forms >> MAUI migration. But after some time at the market we could expect things to be more mature and stable... Obviously not. I'm sorry to hear this.
use plugin.firebase.cloudmessaging instead of plugin.firebase. I finally got it working yesterday for maui7, atleast until this package of Thomas is working on all devices :) Really excited for your finished package Thomas!
You need a combo of plugin.firebase.cloudmessaging, plugin.firebase.auth and plugin.firebase.dynamiclinks. Use the Nuget package manager console NOT the nuget project editor, it wont work. I recommend always using the package manager console for all nuget packages to bypass the long path issue
@Jawah537 really interested in what you have it working . Do you have it working in both iOS and android? Do you use a PC or Mac. do you have a solution we can look at? many thanks
I‘m on it. Its a lot of legacy code to be cleaned up. There will also be a sample app which demonstrates all the features of the library. I‘m currently testing all the different notification types, if they‘re handled properly.
Can i check out your "Refactoring-cleanup" to see if this will solve our issues using notifications in MAUI .net 7 + .net 8
The current develop branch is published on nuget.org. The refactoring-cleanup branch is work-in-progress. Im still on it. I have some changes uncommited; so no guarantees that it works. 😏 Sorry for the delay. Its a lot going on right now.
Is anyone still interessted in this plugin? I just published a new pre-release of version 2.x on nuget.org: https://www.nuget.org/packages/Plugin.FirebasePushNotifications
If someone offers to integrate this nuget in their solution, I can assist with help. Most of the API calls should be self-explanatory or similar to the predecessor plugin.
There is also a pretty good sample app available under Samples/MauiSampleApp. Check it out. It demonstrates almost all features provided by the library.
I am using it, but am having issues getting it to work on IOS. It's probably unrelated though to your project :P i get a token, so that part works, but nothing else comes through. same pkg name as xamarin ver, same googleservice-info.plist.. so who knows
Is anyone still interessted in this plugin? I just published a new pre-release of version 2.x on nuget.org: https://www.nuget.org/packages/Plugin.FirebasePushNotifications
If someone offers to integrate this nuget in their solution, I can assist with help. Most of the API calls should be self-explanatory or similar to the predecessor plugin.
There is also a pretty good sample app available under Samples/MauiSampleApp. Check it out. It demonstrates almost all features provided by the library.
I'll give it a go! The issue I'm having right now with my current implementation is that notifications do not arrive on Android in release mode. Probably caused by AOT / trimming. Are you having similar issues?
I’ve been messing with the refactor branch and have got all the things working finally 😎
I’ve been messing with the refactor branch and have got all the things working finally 😎
Including android notifications in release mode? ❤️
Repro: deploy on Android in release mode. Close application. Send notification. Nothing happens?
I’ve been messing with the refactor branch and have got all the things working finally 😎
Including android notifications in release mode? ❤️
Repro: deploy on Android in release mode. Close application. Send notification. Nothing happens?
Yeppers, though I never had an issue with android in any of the branches, only ios was troublesome for me
I will try to reproduce your issues. Maybe its advisable if we deal with all these issues in separate threads (open new issue).
Please forgive my response times. I‘m very busy at the moment 🙃 (just as everyone of us, I guess).
I’ve been messing with the refactor branch and have got all the things working finally 😎
Including android notifications in release mode? ❤️ Repro: deploy on Android in release mode. Close application. Send notification. Nothing happens?
Yeppers, though I never had an issue with android in any of the branches, only ios was troublesome for me Thanks for that! That gave me the incentive to finally give it a go again! I also have the refactor branch op and running, thanks thomas for your work.
I think I've zeroed in on the issue, which is I think because I'm overriding FirebaseMessagingService in my own (Android) app to receive a data-only message and show it as a notication, thomas has created one too called PNFirebaseMessagingService but if I'm correct this code is not used in the sample. I suspect this will have the same issue.
Update: Confirmed, I now receive notifications with AOT and the high priority thing is working too if I just use the non-FirebaseMessagingService-override method, which is a lot farther I've ever made it.
Sorry for spamming the topic. As soon as I have time I'll verify using the PNFirebaseMessagingService and whether it too has the AOT bug.
First of all, thank you very much for your work. Since other plugins cannot be compiled in visual studio (the path size problem).
I have tested version 2.2.2 with .net 8 to see if I can use it in my applications and it has worked very well, for now I have only had one problem on iOS and that is that with the app stopped it does not show me the push, but for now I have only tested that it works in general for Android and iOS.
Soon I will start including it in one of the apps.
Thank you very much again!!
Thanks for your work, we do have an android application working through MAUI that we want to deploy on IOS. I've hit the "path size problem" wall and ended up here trying to implement this plugin. I had no issue so far with android, but when trying to run the IOS application on debug mode the application crash during start-up :
[0:] An error occurred: 'Object reference not set to an instance of an object.'. Callstack: ' at Plugin.FirebasePushNotifications.Platforms.FirebasePushNotificationManager.ConfigurePlatform(FirebasePushNotificationOptions options) at Plugin.FirebasePushNotifications.Platforms.FirebasePushNotificationManagerBase.Configure(FirebasePushNotificationOptions options) at Plugin.FirebasePushNotifications.MauiAppBuilderExtensions.<>c__DisplayClass0_0.<UseFirebasePushNotifications>b__3(UIApplication application, NSDictionary launchOptions) at Microsoft.Maui.MauiUIApplicationDelegate.<>c__DisplayClass6_0.<FinishedLaunching>b__1(FinishedLaunching del) at Microsoft.Maui.LifecycleEvents.LifecycleEventServiceExtensions.InvokeLifecycleEvents[FinishedLaunching](IServiceProvider services, Action`1 action) at Microsoft.Maui.MauiUIApplicationDelegate.FinishedLaunching(UIApplication application, NSDictionary launchOptions) ...
If you have any idea where this could come from i could definitly use some help. I'll keep on trying to resolve it anyway.
Thanks for your work, we do have an android application working through MAUI that we want to deploy on IOS. I've hit the "path size problem" wall and ended up here trying to implement this plugin. I had no issue so far with android, but when trying to run the IOS application on debug mode the application crash during start-up :
[0:] An error occurred: 'Object reference not set to an instance of an object.'. Callstack: ' at Plugin.FirebasePushNotifications.Platforms.FirebasePushNotificationManager.ConfigurePlatform(FirebasePushNotificationOptions options) at Plugin.FirebasePushNotifications.Platforms.FirebasePushNotificationManagerBase.Configure(FirebasePushNotificationOptions options) at Plugin.FirebasePushNotifications.MauiAppBuilderExtensions.<>c__DisplayClass0_0.b__3(UIApplication application, NSDictionary launchOptions) at Microsoft.Maui.MauiUIApplicationDelegate.<>c__DisplayClass6_0.b__1(FinishedLaunching del) at Microsoft.Maui.LifecycleEvents.LifecycleEventServiceExtensions.InvokeLifecycleEvents[FinishedLaunching](IServiceProvider services, Action`1 action) at Microsoft.Maui.MauiUIApplicationDelegate.FinishedLaunching(UIApplication application, NSDictionary launchOptions) ...
If you have any idea where this could come from i could definitly use some help. I'll keep on trying to resolve it anyway.
I will start with another MAUI migration in 1-2 weeks from now. I will for sure look into this issue by then. Maybe earlier. Can you open a new issue, so we can keep track of this!
I'm still working on it. It seems the issue is related to this https://github.com/xamarin/GoogleApisForiOSComponents/issues/486 I am indeed testing it on a local iphone and deploying it from visual studio on windows, paired to a mac.
Right now i'm updating to net8.0 and i'll go back to it later, i'll open an issue if needed then.
Has anybody got this or anything else to do cross platform push on MAUI working. Every time i try to import anything y whole project gets trashed and i have to stat over with a new project. Using Visual Studio 2022 .NET MAUI
I would also like to know if anyone has successfully gotten this to work on both iOS and Android under .Net 8? I have an app that is running up against a deadline and I'm wondering it I have to change to something else.
Please note that MS has deprecated the iOS side of it so either you create your own bindings or kind of stuffed.