Click here to Skip to main content
15,913,361 members

Comments by shweta2005mca (Top 1 by date)

shweta2005mca 13-Dec-17 15:24pm View    
HI did you get the answer i am facing the similar issue but with Non English Push Notification.

I have used below code for payload, which is working fine for English but for non English it shows me Unicode characters in Notification
/**/
writer.Write((byte)2); // The command (version 2)
// 4 bytes for the frameLength (this includes all the items ids listed below)
int frameLength = 1 + 2 + 32 + 1 + 2 + payload.Length; // (tokenCommand + tokenLength + token) + (payloadCommand + payloadLength + payload)
this.writeIntBytesAsBigEndian(writer, frameLength, 4);

// DEVICE ID
writer.Write((byte)1); // Command for Item ID: deviceId
byte[] tokenBytes = this.HexStringToByteArray(deviceToken.ToUpper());
this.writeIntBytesAsBigEndian(writer, tokenBytes.Length, 2);
writer.Write(tokenBytes);

// PAYLOAD
writer.Write((byte)2); // Command for Item ID: payload
this.writeIntBytesAsBigEndian(writer, payload.Length, 2);

writer.Write(System.Text.Encoding.UTF8.GetBytes(payload), 0, System.Text.Encoding.UTF8.GetBytes(payload).Length);


Thanks.