I am having probles with sending messages including special characters (such as 'łżźć') to FCM. When I send them through developer console - mobile apps display them correctly. But when I send them from our server they are replaced by '?????'.
I have below how I send the message itself to FCM server:
@Async
CompletableFuture<String> send(HttpEntity<String> entity, String accessToken) throws HttpClientErrorException {
RestTemplate restTemplate = new RestTemplate();
ArrayList<ClientHttpRequestInterceptor> interceptors = new ArrayList<>();
interceptors.add(new HeaderRequestInterceptor("Authorization", "Bearer " + accessToken));
interceptors.add(new HeaderRequestInterceptor("Content-Type", "application/json;charset=UTF-8"));
restTemplate.setInterceptors(interceptors);
String firebaseResponse = restTemplate.postForObject(FCM_API, entity, String.class);
return CompletableFuture.completedFuture(firebaseResponse);
}
I'd like to aviod converting message to e.g. base64 string if possible (this was one of the replies in other questions).