FCM: Multiple users & One device - iOS the best practice when the app is terminated? #5974
Unanswered
devsportties
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I've been trying to work on the push notification on both Android and iOS App. For Android, I'd managed everything. However, I am stuck on the BackgroundHandler for iOS.
I could manage every setup on the backend. I wanted to have some logics on the frontend as well and trying to do that on the BackgroundHandler. It works perfectly okay when iOS is on foreground and background. However, when it is terminated, the backgroundhandler is not working.
I know that I must exclude the
notification
on .send() function (node.js), in order to fire the backgroundhandler. But, then if I only senddata-only
APNS. It does not get to the device at all. I've been trying solutions on the Internet likecontentAvailable: true
,apns
settings, including headers and so on.The push notification with the
notification
works fine. I was trying to use this to handle some custom logics behind the app. However, if I send thenotification
, the backgroundhandler will not be fired. Do I have to rely on backend only for iOS?What I want to do is like making sure that the logged out user's notification will not be sent to the device. In case my backend fails to delete the token on my database, then he or she will receive the notification. + I can't stop the user from logging out when he or she wants because of my server is not responding. So, I wanted to cross check on my
shared_preference
logged in user ID.So far, the best way is that when the user sign outs, then delete the token and then request another token to update the rest of the users. However, I still face the backend issues that it might fails to update the new token?
Is there anything I am missing right now? And, what would be the best way to do this. I am seriously wondering how instagram or such app does this with multiple users in one devices and different settings.
Beta Was this translation helpful? Give feedback.
All reactions