I am also looking forward for this, also on the external http callbacks doens't work as well, I had to do a workaround to convert them to unicode code and then convert it back inside the game
Any update on this issue?
Hi Katie
The work around is only working for cloud code initiated messages, all messages from GameSparks itself, e.g. GameWonMessage will still have this bug
Building a backend for a non english speaking audience this is a major problem.
Best Simon
Following this discussion as we have the same problem. A fix or a more complete workaround for this issue would be really appreciated, as we are approaching scheduled release.
We have the same issue with Danish letters. If we want to use the Segments for each language in the Messages section, it will not work with the provided fix. We then have to localize in Cloud Code which is really sad.
UTF-8 (or 16) really should be standard encoding these days..
Any ETA on a fix?
FYI, the fix that Katie posted works, but only if you don't use the iOS push service directly. You have to use FCM for both Android and iOS users, and you can't of course use the build in Messages feature that GameSparks provides and have to handle localization and segmentation in Cloud Code, so it is a bad work around..
Any new regarding this issue?
Any definitive solution in sight for that problem?
Mahei Innovation
We think we´ve found a bug in the platform, regarding firebase based push notifications on Android (we don´t know if this occurs on iOS too, we are only using firebase on android at the moment).
Firebase deletes some characters like acute accents (á é í ó ú and others), ñ, etc when we send push notifications.
We think this could be because you don´t specify to use the UTF-8 charset in your requests from GameSparks to Firebase or something similar.
To reproduce the problem, you just have to send a message through cloud code, with the following code:
msg.setPlayerIds([""]);
msg = msg.setMessageData({"title":"notificación prueba","body":"bódy","type":"tipo"});
msg = msg.setSendViaSocket(false);
msg = msg.setSendAsPush(true);
The notification arrives without the accented characters.
In our own events, when we send messages the native C++ side receives it correctly:
WebSocket callback: {"@class":".ScriptMessage","data":{ "contestname" : "contest_daily" , "contestid" : "59537319900bea04e91d3a33" , "rank" : 29},"extCode":"ContestClosedMessage","messageId":"5959e4c276803304f5e0b01d","notification":true,"playerId":"5959e45a2d91abaf5d16fc2a","summary":"Has quedado en la posición 29.","title":"Concurso finalizado"}
However, the Java side receives it incorrectly:
public void onMessageReceived(RemoteMessage remoteMessage) {
Log.d(TAG, "FROM: " + remoteMessage.getFrom());
//Check if the message contains data
if (remoteMessage.getData().size() > 0){
Log.d(TAG, "Message data: " + remoteMessage.getData());
}
//Check if the mesage contains notification
if (remoteMessage.getNotification() != null){
Log.d(TAG, "Message body: " + remoteMessage.getNotification().getBody());
sendNotification(remoteMessage.getNotification().getTitle(),remoteMessage.getNotification().getBody());
setNotificationType(remoteMessage.getData().get("type"));
}
}
D/MyFirebaseMsgService(10214): Message body: Has quedado en la posicin 29.
The firebase config is totally standard, we haven´t done anything special.
Could you check this?
Please tell me if you need any further info on this.
Thank you very much.
1 person has this problem