Bug Report
Plugin(s)
@capacitor/push-notifications: 6.0.0
Capacitor Version
💊 Capacitor Doctor 💊
Latest Dependencies:
@capacitor/cli: 7.1.0
@capacitor/core: 7.1.0
@capacitor/android: 7.1.0
@capacitor/ios: 7.1.0
Installed Dependencies:
@capacitor/cli: 6.1.0
@capacitor/core: 6.1.0
@capacitor/ios: 6.1.0
@capacitor/android: 6.1.0
Platform(s)
iOS
Current Behavior
When the app is not running and a push notification is tapped, the iOS pushNotificationActionPerformed handler does not pick up the tapped notification, but android does. When a push notification is tapped while the app is in the background both platforms trigger the listener.
Expected Behavior
iOS would also trigger pushNotificationActionPerformed, and not just Android.
In the above code the alert with "2" is only shown on android when launching the app initially, if launching from running state (backgrounded) it will alert "2" on both iOS and Android
Code Reproduction
if (isPlatform("ios") || isPlatform("android")) {
PushNotifications.addListener('pushNotificationReceived', (notification) => { alert("1"); this.handleNotification(notification, false, true) } );
PushNotifications.addListener('pushNotificationActionPerformed', (notification) => { alert("2"); this.handleNotification(notification.notification, true, true) } );
}
Other Technical Details
Followed all instructions on the plugin details page, AppDelegate file contains the required
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
NotificationCenter.default.post(name: .capacitorDidRegisterForRemoteNotifications, object: deviceToken)
}
func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {
NotificationCenter.default.post(name: .capacitorDidFailToRegisterForRemoteNotifications, object: error)
}
Additional Context
Bug Report
Plugin(s)
@capacitor/push-notifications: 6.0.0
Capacitor Version
Platform(s)
iOS
Current Behavior
When the app is not running and a push notification is tapped, the iOS pushNotificationActionPerformed handler does not pick up the tapped notification, but android does. When a push notification is tapped while the app is in the background both platforms trigger the listener.
Expected Behavior
iOS would also trigger pushNotificationActionPerformed, and not just Android.
In the above code the alert with "2" is only shown on android when launching the app initially, if launching from running state (backgrounded) it will alert "2" on both iOS and Android
Code Reproduction
Other Technical Details
Followed all instructions on the plugin details page, AppDelegate file contains the required
Additional Context