If your device is connected to the Internet via WiFi, and messages don’t get through to the device, please make sure APNs ports are not blocked by your firewall.
Push providers, iOS devices, and Mac computers are often behind firewalls. To send notifications, you will need to allow inbound and outbound TCP packets over port 2195. Devices and computers connecting to push service over Wi-Fi will need to allow inbound and outbound TCP packets over port 5223.
The IP address range for the push service can change; providers are expected to connect by hostname rather than IP address. Push service uses a load balancing scheme that yields a different IP address for the same hostname. However, the entire 18.104.22.168/8 address block is assigned to Apple, so you can specify that range in your firewall rules.