Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

ios

passbook

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?

like image 857
pengwang Avatar asked Oct 26 '25 23:10

pengwang


2 Answers

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.

like image 189
PassKit Avatar answered Oct 28 '25 14:10

PassKit


{
    "key" : "terms",
    "label" : "terms_contions",
    "value" : "1.aaaaaaa\n 2.bbbbbbb\n 3.ccccccc\n 4.ddddddd
}
like image 41
pengwang Avatar answered Oct 28 '25 13:10

pengwang