i am doing an app using ionic 2 Typescript and angular 2 and i am including push notifications in it. The notifications are setup correctly on the client side. when i set up the server to send the notifications dynamically it responds with error: Permission denied to connect to 54.236.183.36.
That doesn’t really make sense as the PHP code adds a cURL Error #: before the error output. If this error is thrown by someone else in the script, make sure to find out where exactly and why.
I did echo the curl_errno and it returned 7
and this is the the definition if the number 7
CURLE_COULDNT_CONNECT (7)
Failed to connect() to host or proxy.
i think i need to add a parameter to the server’s configuration but i don’t know what to add.
Note : I have full access to the server i am hosting the php file on.
I fixed this actually by adding the IP that i get in the error message as an outgoing connection so that the server would let it pass. But what i noticed is that the ip in the error message changes from 52.xxx… to 54.xxx… so i can not exactly add all possible ip addresses as outgoing connections. I am still stuck with this now.
There is an option in the server i am using to host the php file called restrict outgoing connections. it restricts any connections or requests done by the server to external IPs, so i completely disabled that and the requests to ionic notification API are now working as intended.