IO Exception while accessing Google Cloud message?

2019-08-23 05:35发布

I have written the code for GCM both in server and Android. I am getting the Registration ID successfully.But I am not able to register to GCM,while making a post to register it shows an IO exception.I have used Android hive tutorial for this.I have gmail id and registration id with me and also created a Url to post.Any idea please share with me.Thanks in advance

1条回答
该账号已被封号
2楼-- · 2019-08-23 06:22

These are the line of code that creates the exception:

int status = conn.getResponseCode();
if (status != 200) {
   throw new IOException("Post failed with error code " + status);

Basically this methods is responsible for sending a POST request to the server. Have you configured the endpoint URL correctly in the client app?

Edit: The status code 302 is "Found: The requested resource resides temporarily under a different URI." See here for more info: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html

查看更多
登录 后发表回答