Skip to content Skip to sidebar Skip to footer

Access Denied From Curl On Remoter Server

I'm working on push notification service for android and followed some tutorial for that. I tried to implement the technique in localhost and succeeded. But While I tried with my r

Solution 1:

You should include the API Key (obtained from your Google API Project) in the headers of the HTTP request:

Authorization: key=YOUR_API_KEY

That's what authorizes you to send a GCM message from your server to your app.

EDIT, now that you added the GCM.php code:

Why do you disable SSL?

// Disabling SSL Certificate support temporarly

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

I don't know PHP, but I don't see this line in other PHP GCM samples, such as this.

And where do you define GOOGLE_API_KEY?

Post a Comment for "Access Denied From Curl On Remoter Server"