2

I have implemented successfully this code:

Does anyone know how to write an Apple Push Notification Provider in C#?

It works great. But I have a question, can anybody help me how to send non english messages like Hebrew Or Arabic?

If the string contains any non english characters, it is not sent.

Thank you

Community
  • 1
  • 1
Meir
  • 994
  • 12
  • 25

1 Answers1

12

I found the solution.

The length was wrong. In the code we pass the length of the string before the counting. We should count it after the UTF encoding:

writer.Write((byte)0); //First byte of payload length; (big-endian first byte) 
enter code herebyte[] b1 = System.Text.Encoding.UTF8.GetBytes(payload);
writer.Write((byte)b1.Length);     //payload length (big-endian second byte) 
Daverix
  • 399
  • 2
  • 16
Meir
  • 994
  • 12
  • 25
  • @Meir can you please tell me that how you manage those non English messages at application side means through Xcode? have you done any other language settings for application – Vishal's p Aug 23 '13 at 07:32