Skip to content
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

Fix receiving iOS foreground pushnotification #186

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gabn88
Copy link

@gabn88 gabn88 commented May 13, 2022

Fix receiving iOS foreground pushnotification

Description

Now the else actually does work to show the on('notification') event

Related Issue

#172
#156
#104

Motivation and Context

To fix the foreground issue on iOS

How Has This Been Tested?

Tested in a production app for a long time (2+ years)

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Fix receiving iOS foreground pushnotification
@sw-tt-jigneshvagh
Copy link

Hello @gabn88

This your commit also resolved the issue of notification click not working when the app is in the foreground for IOS 10/11?

Reference link : https://stackoverflow.com/questions/46314420/phonegap-pushplugin-handling-click-event-on-notification-in-ios

Thanks,
Jignesh

@gabn88
Copy link
Author

gabn88 commented Jun 27, 2022 via email

@sw-tt-jigneshvagh
Copy link

Hi @gabn88

Currently, we have used this plugin phonegap-plugin-push - 2.3.1 in our project which has angular version 7 & Cordova-ios 5.1.1 (Cordova 11).
But we are facing the issue of when the app is in the foreground the notifications coming but at the same time, we got notifications on subscribe event, which we don't want we need to only when we click on notification then it will fire the subscribe event.

Is there any way we can find a solution for it OR is there any other plugin in the market so we can check it. If you have any ideas please suggest your thoughts.

Thanks,
Jignesh

@Mister-CK
Copy link

We also had issues with iOS foreground notifications. However, we could just take the foreground value from the plugin and show a pop up if that is the case (on iOS).
const foreground = notification.additionalData.foreground;

@DennisRein
Copy link

Is this PR going to get merged in the near future? I am pretty in need of that function.

@EenPOOL
Copy link

EenPOOL commented Jan 23, 2023

@gabn88 I have tried your changes from your pull request.
Sadly I need to say that it still breaks.
Looks like if the application is in background and you click on the push notification itself to open the app, that the push is triggered twice for some reason.

Also now it works less, then the original plugin, when I receive the push notificaiton on foreground... (see screenshot)

Screenshot 2023-01-23 at 11 57 23

I'll look further to this issue... (will update this comment when I have found something)

@NityaSantosh26
Copy link

@EenPOOL Any update from your side.

I tried this fix but I don't receive push notifications when app is in the foreground. (It still breaks)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants