Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Parse Rest - Push encode message

I am having issue with push utf8 encode message using Parse Rest, here is my body

{"where":{"$and":[{"email":{"$in":["[email protected]","[email protected]"]}},{"deviceType":{"$in":["ios"]}}]},"data":{"alert":"TEST: Giảm 40% Khi Mua Sách Harry Potter","sound":"default","page_type":"cms_key","page_value":"harry-potter"}}

Does anyone know how to encode utf8 message?

enter image description here

like image 714
Thang Pham Avatar asked May 10 '17 03:05

Thang Pham


1 Answers

Javascript code:

public bool SendPushNotification(string jsonContent)
{
...

    request.Headers.Add("X-Parse-Application-Id", appId);
    request.Headers.Add("X-Parse-REST-API-KEY", restApiKey);

    System.Text.UTF8Encoding encoding = new System.Text.UTF8Encoding();
    Byte[] byteArray = encoding.GetBytes(jsonContent);

...
}
like image 113
Jadav Bheda Avatar answered Oct 07 '22 03:10

Jadav Bheda