I'm using iPhone 7, iOS 12.1.4.
Recently I notice that people can't call me via FaceTime me when I lock my iPhone, so it turns out the Wifi is only connected when the screen is on. I googled it a bit:
WiFi Disconnects when Lock Screen active
Wifi drops when phone is locked after 10.3.3 update
Some says it's a "feature" designed by Apple (to save battery, even when iPhone isn't in Low Power Mode), thus it can't be fixed, but some suggest solutions to fix (which doesn't work for me).
So if it is a feature, how can iPhone's users receive FaceTime/Facebook messenger calls, do they have to play with their iPhone all day long to make sure they don't miss any call, is there any official word from Apple?
Problem: VPN app disconnects wifi when the iPhone goes to sleep mode. (even when the VPN isn't used)
Solution: remove the VPN.
I think another solution is to use a VPN app that uses IKEv2 (Apple's native VPN framework):
For example, ProtonVPN can do this https://protonvpn.com/support/protonvpn-ios-manual-ikev2-vpn-setup/