A simple Java library to interface with Firebase Cloud Messaging (FCM) API. Pushraven allows you to push notifications to clients in very few lines of code.
MIT License
78
stars
34
forks
source link
Issue in sending notification with utf-8 title and body #3
Hi
Already after sending a notification which has utf-8 title and body ( i test sending Persian characters ), in client side characters are not encoded correctly.
I modified a part of code in Pushraven class and i fixed it.
// Send POST body
con.setDoOutput(true);
DataOutputStream wr = new DataOutputStream(con.getOutputStream());
wr.writeBytes( n.toJSON() );
wr.flush();
wr.close();
changed to:
// Send POST body
con.setDoOutput(true);
DataOutputStream wr = new DataOutputStream(con.getOutputStream());
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(wr, "UTF-8"));
writer.write(n.toJSON());
writer.close();
wr.close();
wr.flush();
wr.close();
Hi Already after sending a notification which has utf-8 title and body ( i test sending Persian characters ), in client side characters are not encoded correctly. I modified a part of code in Pushraven class and i fixed it.
changed to: