Search code examples
iospassbook

passbook pass not enter newline using "\r\n"


I am using passbook, and have some input value, like this:

{
    "key" : "terms",
    "label" : "terms_contions",
    "value" : "1.aaaaaaa
               2.bbbbbbb 
               3.ccccccc
               4.ddddddd
} 

I use "enter" key, I want to newline to see the value, but the pass show mistake.

so I modify it to:

{
    "key" : "terms",
    "label" : "terms_contions",
    "value" : "1.aaaaaaa 2.bbbbbbb 3.ccccccc 4.ddddddd
}

and all is ok, but I do not want 1. 2. 3. 4. at one line. I want to have 4 lines. How can I accomplish this?


Solution

  • Newlines will only work on back fields. Encode the newlines into the JSON like below and you should be OK.

    {
        "key" : "terms",
        "label" : "terms_contions",
        "value" : "1.aaaaaaa\r\n2.bbbbbbb\r\n3.ccccccc\r\n4.ddddddd"
    }
    

    Example working pass with newlines in the last backfield.