views:

57

answers:

2

Hello,

I have implemented successfully this code:

http://stackoverflow.com/questions/1020762/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

A: 

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) byte[] b1 = System.Text.Encoding.UTF8.GetBytes(payload); writer.Write((byte)b1.Length); //payload length (big-endian second byte)

Meir
A: 

Thank you! My head hurts from beating it against this wall.

Jeff Pajor