-
Notifications
You must be signed in to change notification settings - Fork 177
-
Notifications
You must be signed in to change notification settings - Fork 177
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
Not calling OnNotificationOpened event when app in terminated -Android #197
Comments
In my case, OnNotificationOpened is not called when on Android when the app is in the foreground. When the app is in the background or its killed everything works fine. |
@Mikilll94 - Foreground means app killed from taskbar. Background means app open in taskbar. So when app in foreground are you getting notifications? |
Foreground means app opened - not killed from taskbar. I am receiving notifications but the method OnNotificationOpened is not called on Android when the app is in the foreground. |
When app closed from task manager is it called background? & when app just closed(but open in task manager) what is called? |
'Not calling OnNotificationOpened event when app in terminated' is that not a known cloud messaging issue. As I recall it depends the the phone model and OS version but lots of them do not have inbuilt support for FCM unlike GCM which was more supported. So some phones will open the app when a notification is clicked and the app was killed previously and other phones will not. |
@raymondjstone - Thank you for your input. I am using moto c plus device with android version 7.0. On the same device I am checking notifications of Xamarin.android(FCM) working all good. So this is not the issue of device, fcm, gcm and device. It is probably the issue of plugin or I might missing something. |
That device is one which I believe does have an issue with handling FCM notifications when the app has been killed. Many if not most phones do. If you look on the FCM support pages there used to be something there that confirmed this was an FCM issue (and that GCM did not have the same level of problem) |
@raymondjstone - As I mentioned above that same device is working fine Xam.Droid. Last year I developed push notifications, still using today that product. So I am pretty sure it is not the device :). |
Well if you insist that it is not your device or the FCM known issue then there is nothing else I can suggest, this is what I have in my apps help for this issue but since it;s not your device this will not help you but may help others Push notifications not working on your Android app? Certain Android devices might have some problems receiving push notifications when the myAberdeenshire app is closed. Whether you run into this problem will depend on what device you're using. We've collected some instructions and resources below, to help you troubleshoot this problem. IMPORTANT NOTE: The exact steps for this process will vary depending on your device model. We recommend using the information here as a starting point. Some Googling with your precise model details should find instructions specific to your device. Huawei Lenovo: OnePlus: Oppo: Samsung: Vivo: Xiaomi NOTE: |
@Mikilll94 - Thank you for your detailed information. As you said above you are able to open specific view when app terminated. Can you please give me sample repository to just compare where I am making mistake. |
How is the payload being sent? |
When app in terminated (Killed from task-bar), And sending notification to app. When I tap on notification,
OnNotificationOpened
event not getting called. App navigating toMainPage
For more information visit this https://stackoverflow.com/questions/53594512/specific-view-not-opening-on-notification-tap-when-app-in-foreground
Bug Information
Version Number of Plugin:2.3.5
Device Tested On: Moto c plus
Simulator Tested On:
Version of VS: 15.8
Version of Xamarin: 3.4 XF
Versions of other things you are using:
Steps to reproduce the Behavior
Use code above & send notification when app in foreground
Expected Behavior
App should navigate to Targated screen when tapping on notification
Actual Behavior
When tapping on notification app going to
MainPage
Code snippet
Screenshots
The text was updated successfully, but these errors were encountered: