Laravel + Google Cloud Messaging (Connection timed out)

后端 未结 1 1310
终归单人心
终归单人心 2020-12-20 01:24

I am using Laravel as Backend server for my android application. Here is the package I used for sending push messages: https://packagist.org/packages/davibennun/laravel-push

相关标签:
1条回答
  • 2020-12-20 01:36

    I've got the same error and trying to figure it out why.

    There are some possibility for this error.

    1. Your internet firewall block the connection to the google : pls try ping android.googleapis.com in your laravel host. or curl -v gcm-http.googleapis.com if doesn't response then it is blocked.

    2. Open your the port for google api to work, I open the port usually 443 , 5528-2230. you might configure in your firewall

    3. the gcm-http.googleapis.com has a lot of ip addresses, so you need to allow connection from these ip addresses this is one of their ip address : 172.217.3.170. mine solve the problem by allowing the connection between the range of their ip addresses. you can monitor the ip address in your firewall software.

    4. you can find the range of google api IP addresses here and here

    it depends on your firewall configuration you need to setup those with the guy who configure the firewall since I assume you work in the secure network environment.

    0 讨论(0)
提交回复
热议问题