How display double quotes (") in an ios notification message?

Hi,


I'm sending an ios notification like this:



aps = {

alert = {

body = ""Test Comment"";

title = ""My Test Notification"";

}

"content-available" = 1;

sound = default;

}

But when it displays the message when my app is in the background, it doesn't unencode them. How do i format these so they display properly?

Normally you'd format/escape via nsstring - you may not have the option with an alert, in which case perhaps an action sheet is your friend, instead.

Why are you trying to use an HTML escape sequence in a JSON dictionary? 😕


The Apple documentation specifies that the message is formated according to RFC4627.


From that specification:

The representation of strings is similar to conventions used in the C family of programming languages. A string begins and ends with quotation marks. All Unicode characters may be placed within the quotation marks except for the characters that must be escaped: quotation mark, reverse solidus, and the control characters (U+0000 through U+001F). Any character may be escaped. If the character is in the Basic Multilingual Plane (U+0000 through U+FFFF), then it may be represented as a six-character sequence: a reverse solidus, followed by the lowercase letter u, followed by four hexadecimal digits that encode the character's code point. The hexadecimal letters A though F can be upper or lowercase. So, for example, a string containing only a single reverse solidus character may be represented as "\u005C". Alternatively, there are two-character sequence escape representations of some popular characters. So, for example, a string containing only a single reverse solidus character may be represented more compactly as "\\". To escape an extended character that is not in the Basic Multilingual Plane, the character is represented as a twelve-character sequence, encoding the UTF-16 surrogate pair. So, for example, a string containing only the G clef character (U+1D11E) may be represented as "\uD834\uDD1E".


In other words,

body = "\"Text in quotes\"";

How display double quotes (") in an ios notification message?
 
 
Q