Closed MPoels closed 1 month ago
I'll try to reproduce it, thanks. I refactored the startup and DI registration code. Maybe something is wrong there. Thanks for the repro code, I'll care about it as soon as I get some time.
Strangly, I cannot reproduce this issue. The situation described is pretty much what we have in the MauiSampleApp in this repository. In this sample app we inject IFirebasePushNotification into MainViewModel - which is essentially nothing else than what you do with your class FirebaseMessaging.
Can you give following information:
What could also help is if you run the clean.bat or clean.sh (from this repo) in your app solution (copy it to the root of your solution). Just to make sure your using the latest version of this nuget - and no cached data.
Hi Thomas,
I will first try your clean stuff and test if the problem is gone then. Let you know today. As I’m in the process of finalizing the application for release!
What I was just trying to solve is an iOS issue in the 2.2.37-pre. This is the use-case were I receive a notification and the application is not started and I click on the notification icon, or just start the application. In both use-cases I do not receive a notification. This might be resolved in the latest version, so makes is worth trying.
Again let you know within an hour what the outcome is with the latest version.
Martien
Hi Thomas,
No idea why, but the problem is gone. Probably because of the cleaning. So that’s great.
However I’m still wrestling with the use-case when on iOS the application is not running in the background and is started clicking the notification, or just starting with a notification pending. On android I’m reading the intent.Extra’s to receive the notification data (I used this with the 2.2.37-pre, have not tested this with the latest release yet if this is still working).
On iOS I see an interface IFirebasePushNotification.DidReceiveRemoteNotification(NSDictionary info). Is that something I should use for that situation? Tried in the AppDelegate to read the “launchoptions” which is null, also to retrieve pending notifications with the UNNotification class, no pending notifications could be found either?
Kind greetings,
Martien
@MPoels can we track the issue regarding 'not receiving notifications on iOS' in a new issue, please?! But yeah, first, update to latest stable, clean, try again 👍🏻
Hi Thomas,
I have finished testing and it all works. You can savely close this bug-report. We will take this version into production as the use-cases:
are all working like a charm for both iOS and Android.
The problem I was struggling with is when the app is started by clicking the app-icon. This is a special situation that has nothing to do with your package. In this case for iOS the launchoptions dictionary is empty but notifications can be present and we have the read them manually an act on it. This process is pretty straightforward in iOS using the notificationCenter. For iOS this use-case is working.
In Android, clicking on the app item with notifications pending. The situation is identical the intent has no extra's. but notifications exist. However have not found a way yet to read the data part of the pending notifications, I can read title and text, but no way of reading the data. Still trying to find a solution for this use-case.
Thanks for your support!
Martien
First let me say you are doing a great job on this project. And has helped me a lot.
I upgraded from the pre-release version to the most recent version v2.4.22.
The android version runs fine, although I have not tested all situations yet. But looks promising sofar. If I try to run the iOS version, during initialization I get reported that the "Plugin.FirebasePushNotifications,IFirebasePushNotification" is not found. While previously the code ran without problem. I have not tried to use the "Current" interface but as you recommend to use the IFirebasePushNotification interface this way and not use the static version.
Note that I have disabled AutoInitEnabled as I first want to setup internal messagehandlers first and then Register the service so that I'm ready to process the messages that might be coming in very quickly after the call to "RegisterForPushNotificationsAsync();". And this was working like a charm before.
this is the relevant part of my singleton service FirebaseMessaging.
This is the MauiProgram code
If you have any further questions I'm happy to assist answering them.