Closed fuj1w4r4 closed 6 years ago
I did fudge up the releases at some point. With the next release I'll probably name it 2.0 to fix it.
The error that you are getting would be because your Google Credential "service_account.json" file is missing the 'type' field.
hey thanks, my bad. I didn't use the correct json file.
No worries, glad I could help.
I faced the same problem, and got 411 error code with message "that’s an error. post requests require a content-length header"
After tried, I found I used wrong json file, too.
To generate a valid .json, follow the instructions: https://firebase.google.com/docs/cloud-messaging/auth-server
I hope it can help someone else.
I check in maven, 1.1.0 is the latest. It is kinda confusing. Please advise.
in the version 1.0.1, it throws me this error:
Caused by: java.io.IOException: Server returned HTTP response code: 411 for URL: https://fcm.googleapis.com/v1/projects/olemojo-demo-fire/messages:sendResponse Code: 411
java.io.IOException: Error reading credentials from stream, 'type' field not specified. at com.google.api.client.googleapis.auth.oauth2.GoogleCredential.fromStream(GoogleCredential.java:254) at com.google.api.client.googleapis.auth.oauth2.GoogleCredential.fromStream(GoogleCredential.java:226) at us.raudi.pushraven.Pushraven.getAccessToken(Pushraven.java:132) at us.raudi.pushraven.Pushraven.push(Pushraven.java:78) at com.mojo.controller.PublicController.testPushRaven(PublicController.java:91)