-
Notifications
You must be signed in to change notification settings - Fork 283
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
iOS - on('notification') event is not fired when app in foreground using FCM #104
Comments
FYISeems to be related with: |
Any updates on this? I too am facing the same issue. |
@duca14036 Are you interested in merging your fixes with this repo? This is now more actively maintained. Thanks! |
Is this issue related or asme as this one #172 ? which I just opened yesterday . |
If I'm correct, in effect what you are doing is treating foreground notifications the same as background notifications by commenting those lines. I like the solution above better, because you'll still be able to differentiate between them. But if it works for you then it's good 😀 |
@gabn88 By 'solution above', do you mean changing the payload from @duca14036 ? https://github.com/phonegap/phonegap-plugin-push/issues/2783#issuecomment-621972933 |
same issue here |
same here!! anyone found a way to fix it ? |
The solution is waiting here: #186 for almost 9 months now for no reason |
Bug Report
Expected Behaviour
When i send a push notification by FCM to my app on an iOS device and the app is opened in foreground, the event on('notification') is called so i can retrieve and process the push message.
Actual Behaviour
When i send a push notification to my app on an iOS device and the app is opened in foreground, no event is fired. Nothing happens.
The only information i found, was, that for "silent notifications" (no idea what that is) with FCM there is a attribute
content_available: true
at the payload.https://github.com/havesource/cordova-plugin-push/blob/master/docs/PAYLOAD.md#fcm-payload-details
But this seems to be outdated, as i get an error, that this attribute is invalid when using it while sending (see code example below).
Reproduce Scenario (including but not limited to)
Steps to Reproduce
Send a push notification to your app when it is open in the foreground. See code below in the example.
Platform and Version (eg. Android 5.0 or iOS 9.2.1)
iPhone: 6S
iOS: 13.4.1
cordova info
PrintoutCordova Packages:
Project Installed Platforms:
Project Installed Plugins:
Environment:
android Environment:
ERROR: Command failed with ENOENT: android list target
spawn android ENOENT
Project Setting Files:
--- Start of Cordova JSON Snippet ---
--- End of Cordova JSON Snippet ---
Sample Push Data Payload
Sample Code that illustrates the problem
Logs taken while reproducing problem
The text was updated successfully, but these errors were encountered: