Fcm Grails - invalidTopicString - firebase-cloud-messaging

I'm trying to send messages through FCM, through topics. But I am getting the following error.
topicstring: "/topics/test_municipio184"
com.google.api.client.http.HttpResponseException: 400 Bad Request
{"error":"InvalidTopicString"}
at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1070)
at com.google.api.client.http.HttpRequest$execute$1.call(Unknown Source)
at transporteLegal.NotificationService$_executeRequest_closure1.doCall(NotificationService.groovy:95)
at transporteLegal.NotificationService$_executeRequest_closure1.doCall(NotificationService.groovy)

Related

How do you get request error's logs using WizTools REST Client?

I'm making GET and POST requests using WizTools REST Client, but I got HTTP 500 errors. I would like to get logs. Any tips?
HTTP Response
HTTP/1.1 500 Internal Server Error

Why does get my response error message got truncated

I'm new to the WorldPay integration development.
I'm having difficulty when I am sending an authorization request from one of our applications and I got this response from the api .
Client error: POST https://try.access.worldpay.com/payments/authorizations resulted in a 400 Bad Request response: {"errorName":"bodyDoesNotMatchSchema","message":"The json body provided does not match the expected schema","validationE (truncated...)
My problem is I was unable to see the complete error message because the response has been truncated. Is there a way to prevent that issue?

Google GCM server returns Unauthorized Error 401 while subscribing

I get subscription success in app. But I see Google GCM server returns Unauthorized Error 401 in the server logs.
When I push a message from adapter, I get an authorization failure in server logs. But My adapter gives success response Notification sent to set user.
Can somebody tell me what could be the mistake I would be doing. (can this error also occur when my firewall is restricting this call.)
While subscribing i was getting Reason: 401 unable to authenticate with gcm services. something like this. And While pushing a notification from adapter i was getting reason : unable to authenticate for Api key "ASYI-" with GCM. the error messages may not be exact but the message means just like above
I am getting below error while sending notification
Failed to invoke Google GCM push service.
GCM Service invocation failed (reason: Authentication has failed for sender key starting with 'AIzaSyCk')
also getting below error
GCM push token 'ssdsddsdsdsds' is not added to GCM notification key. GCM Service invocation failed (reason: Returned HTTP/1.1 401 Unauthorized when invoking GCM push service to get the notification key.)
GCM Service invocation failed (reason: Returned HTTP/1.1 401 Unauthorized when invoking GCM push service to get the notification key.)
on the Android studio i see below error :
GCMAPIClient$BackgroundRegistrationHandler.run in GCMAPIClient.java:130 :: Failed to register with GCM using Google Play Services. Error:Error :INVALID_SENDER
Finally it worked for me, two things i did it to work.
Took the GCM.jar file from the sample project and placed it in my project . removed the other gcm dependencies
Created a project in FCM Console (https://console.firebase.google.com/)
and took the google-services.json and placed it in my android studio project under app. Took the web API key from FCM Console and placed it in the mobilefirst app project.(There are two keys now one for app and other for web).
I had to create a new project in the fcm console and new keys..

getting lot of 502 errors from gcm servers

I am using gcm json protocol to send notifications. Somrtimes for certain period of time gcm endpoints are responding with 502 error code.
Is there a status dashboard for gcm service api ?
And
What could be reason of these 502 error codes ?

HTTP Status Code: 401 in GCMDemo

Reference:http://developer.android.com/google/gcm/demo.html
Server 401 when trying to send a message to my android device.
HTTP Status 500 - HTTP Status Code: 401
type Exception report
message HTTP Status Code: 401
description The server encountered an internal error (HTTP Status Code: 401) that prevented it from fulfilling this request.
exception
com.google.android.gcm.server.InvalidRequestException: HTTP Status Code: 401
com.google.android.gcm.server.Sender.sendNoRetry(Sender.java:177)
com.google.android.gcm.server.Sender.send(Sender.java:121)
com.google.android.gcm.demo.server.SendAllMessagesServlet.doPost(SendAllMessagesServ let.java:83)
javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.29 logs.
Could anybody tell me how to solve?Thank you!
You should take a look at the GCM docs where it explains the GCM response: http://developer.android.com/google/gcm/gcm.html#response and troubleshooting the 401 error code: http://developer.android.com/google/gcm/gcm.html#auth_error
Description from the docs:
Authentication Error
The sender account that you're trying to use to
send a message couldn't be authenticated. Possible causes are:
Authorization header missing or with invalid syntax.
Invalid project number sent as key.
Key valid but with GCM service disabled.
Request originated from a server not whitelisted in the Server Key IPs.
So I would check to make sure that you are setting you authorization header properly and that you Google Project number is properly setup with GCM and accepting your servers IP.