I am using react-native-notification module to send a local notification when I receive a socket.io event sent from the server. The notification is properly configured and works on both iOS and Android in foreground mode. However, due to the fact that Apple doesn't allow Apps to run on the background except for (Audio, navigation map, etc.), I am not able to receive any socket events when my app is not on the background and temporarily suspended.
I'm therefore not able to send a local notification to the iOS device since the app isn't really running once I switch the app to background.
Here I'm asking for possible solutions to my current problem.
This could be a general question regarding react native or iOS native.
Everything works well on Android devices and I don't think there is anything wrong with my code so I don't know what code I should display here.
In short, I just want to know how to receive socket events when the app is in the background on an iOS device, or if that can't be achieved. I would like to know how most apps even send notifications to their users when their apps are in the background.(I do not want to cheat the system and set the background mode to audio).