-
Notifications
You must be signed in to change notification settings - Fork 764
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
Can't get an interactive action response when iOS app is in dead state #724
Comments
@mkizesov Did you checked in real device ? |
Of course. |
Any possibility share version and code snaps with me, because In my code base not any event get trigger in emulator and real device. |
@mkizesov I'm experiencing the same issue. I'm sure that this should be possible on iOS because there are apps out there that can handle this functionality. I'm stumped, been at it for the past 2 days and I've tried react-native-push-notification-ios From what I've gathered, I'm starting to wonder if there's a certain option that needs to be in the notification config or something. I've seen some say they have solved this but I think their case (not confirmed) is when the notification action launches the app into "foreground" from dead. |
@ninjz As I understand, when app is dead and you tap on action in notification, the native part of the app code works: But then it tries to call JS callback from your |
@ninjz So I forked the library and added a function similiar to https://github.com/mkizesov/react-native-notifications/commits/master |
@mkizesov Thanks for sharing. I've gotten to that stage where I'm able to retrieve the notification from the killed state using a similar method. However, now I've been testing these actions on the Apple Watch, and sometimes the phone receives the action, sometimes it doesn't – usually after the app has been backgrounded for at least 30 minutes. If I go to the phone and respond to the notification action it is properly handled. Do you think you can give this a try? I'm wondering if it has to do with React Native because I've made a sample app using native Swift and am able to consistently get callbacks on the It doesn't make sense for this to not work on the watch properly, as it would result in unexpected behavior by the users thinking these buttons actually do something... |
I'm facing the same issue right now. When pressing an action on the iPhone everything works fine and registerNotificationOpened() gets raised. But when clicking on the action on an AppleWatch "nothing" happens. The app get's started (background), but the event doesn't raise. |
Really strange. To the point, I'm ripping out every dependency one by one to try and isolate the issue. I've made a fresh new project using only |
@ninjz No, I'm not using Firebase, Sentry or wix/react-native-navigation currently. "@react-native-community/checkbox": "^0.5.7", |
Thanks for sharing that @mp8446 . I've given it a try and ripped out all the dependencies that we have in common. It did not seem to resolve the issue. Finally, I ended up adding a call to I have a theory as to why this is happening: That there might have been a bug with the permission request method in Do you mind giving this a try and seeing if this ends up fixing the issue on your end? I'm going to continue testing this over the next couple of days to see if it holds up. EDIT:
[[UIApplication sharedApplication] registerForRemoteNotifications];
[RCTSharedApplication() registerForRemoteNotifications]; For me it is working with the call from Anyways, in my app, I exclusively used |
@ninjz Thank you for your advice. But sadly it doesn't work for me. Neither with EDIT: |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
The issue has been closed for inactivity. |
The issue is still valid. |
@mkizesov would you be willing to submit a PR using the fix from your fork? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
This issue is still ongoing. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
The issue has been closed for inactivity. |
Hi is this going to be addressed? I see there's also a PR which was closed for inactivity. I believe actions not working when app is killed is a valid issue. Or is there a way how to workaround this with the current version? |
Facing the same issue as well. is there any workaround? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
The issue has been closed for inactivity. |
Version: [email protected]
System: iOS
registerNotificationOpened
callback is called and I getactionResponse
therenotification
fromNotifications.getInitialNotification()
Notifications.getInitialNotification()
returnsundefined
andregisterNotificationOpened
callback is not calledWill appreciate any comments. Thanks!
The text was updated successfully, but these errors were encountered: