Closed tyndria closed 1 year ago
Hi @tyndria thank you for opening this issue.
I see you mentioned that Notifications.Push.onNotificationOpened
is not triggered when notification is clicked for background app, however it looks like you are triggering Notifications.Push.onNotificationReceivedInForeground
Since this is for an app in the background, you may need to use .onNotificationReceivedInBackground
instead. [1]
Could you try this?
@nadetastic thanks a lot for the quick response!
Sorry, I'm not sure I totally got your proposal. My goal is to handle click on notification in order to navigate user to another screen.
So when:
onNotificationOpened
will be triggered.onNotificationReceivedInForeground
P.S. I also see a warning "Warning: Application delegate received call to -application:didReceiveRemoteNotification:fetchCompletionHandler: but the completion handler was never called." in xcode console when background notification comes:
2023-04-28 10:06:00.892244+0400 AstuvetMobile[9059:898783] Warning: Application delegate received call to -application:didReceiveRemoteNotification:fetchCompletionHandler: but the completion handler was never called.
2023-04-28 10:06:00.895976+0400 AstuvetMobile[9059:899134] [javascript] 'BACKGROUND', { body: 't',
title: 't ',
deeplinkUrl: 'astuvet://chat?intentName=GenericIntent&intent=PuppyCleanliness_Introduction',
data: { pinpoint: { deeplink: 'astuvet://chat?intentName=GenericIntent&intent=PuppyCleanliness_Introduction' } } }
@nadetastic hi again!
My fault, I haven't tried to:
yarn.lock
When I did it, onNotificationOpened
started working for background app.
But for now I wasn't able to make getLaunchNotification
working for terminated app, probably I will open issue later if I'm not able to solve it by myself
Probably this step with yarn.lock
and node_modules
could be added to the "Migration guide"
Before opening, please confirm:
JavaScript Framework
React Native
Amplify APIs
Authentication, Analytics, GraphQL API, Push Notifications
Amplify Categories
auth, function, api, analytics, notifications
Environment information
Describe the bug
Notifications.Push.onNotificationOpened
is not triggered when notification is clicked for background app. What's happening instead:Notifications.Push.onNotificationReceivedInForeground
is triggeredNotifications.Push.onNotificationOpened
is not triggeredPush Notifications are tested using Pinpoint "Test Messaging" service. Both
Open your app
andOpen a deep link
are tried.Expected behavior
Notifications.Push.onNotificationOpened
is triggered when notification is clicked for background appReproduction steps
@aws-amplify/pushnotification
and@react-native-community/push-notification-ios
.Migration guide
is used: https://docs.amplify.aws/lib/push-notifications/migrate-from-previous-version/q/platform/react-native/aws-exports.js
Manual configuration
No response
Additional configuration
AppDelegate.h
AppDelegate.mm
Podfile
index.js
App.ts
Mobile Device
iPhone 14
Mobile Operating System
iOS 16.4.1
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response