Closed nicdichiara closed 4 years ago
We are seeing this in two of our apps as well. Push works fine on Android with app in FG or BG, but only in BG on iOS, and neither pushNotificationReceived nor pushNotificationActionPerformed are firing.
For me, writing to the file CAPUNUserNotificationCenterDelegate.swift
worked. Just adding print("pushNotificationReceived")
here fixes it for me. I guess it's Xcode caching the files somehow.
That guide wasn't very good and had some problems, it got updated recently, but requires @capacitor/ios 1.4.0. Please, try updating to @capacitor/ios 1.4.0 and make sure you are getting the latest version of the guide.
For me, writing to the file
CAPUNUserNotificationCenterDelegate.swift
worked. Just addingprint("pushNotificationReceived")
here fixes it for me. I guess it's Xcode caching the files somehow.
Can you provide the solution on the "here" link with the push notifications?
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.
Bug Report
Capacitor Version
npx cap doctor
output:Latest Dependencies:
@capacitor/cli: 1.3.0
@capacitor/core: 1.3.0
@capacitor/android: 1.3.0
@capacitor/ios: 1.3.0
Installed Dependencies:
@capacitor/cli 1.2.1
@capacitor/core 1.2.1
@capacitor/android 1.3.0
@capacitor/ios 1.3.0
Affected Platform(s)
Current Behavior
When a notification comes in, and it is clicked, the app opens as expected, but the pushNotificationActionPerformed listener does not fire. For both iOS and Android we immediately alert to show that the listener has triggered. On Android it alerts, and on iOS it doesn't, leading us to believe there is an issue with the iOS pushNotificationActionPerformed implementation.
We are experiencing the same results for pushNotificationReceived as well.
We are receiving notifications on both iOS and Android properly, so we do not think there are any issues with our APN config or server-side messaging functions.
Expected Behavior
We expect an alert on iOS when the app is launched from a notification, calling the pushNotificationActionPerformed listener.
Sample Code or Sample Application Repo
From the server:
Reproduction Steps
We implemented the boiler-plate example code from https://capacitor.ionicframework.com/docs/guides/push-notifications-firebase/ on a blank ionic 4 capacitor application. We send the above message packet and the pushNotificationActionPerformed listener does not fire on iOS.
Other Technical Details
npm --version
output: 6.9.0node --version
output: v10.16.3pod --version
output (iOS issues only): 1.8.4Other Information
We have been testing on iOS 13+ devices.