Passbook: line breaks in PKBarcodeFormatQR

362 Views Asked by At

I'm trying to build a wallet card included a VCF contact in the QR Code.

I got an issue with the line breaks, that are mandatory in VCF contact format.

I included my VCF String like this (build in PHP):

'barcodes' => [
                0 => [
                    'format' => 'PKBarcodeFormatQR',
                    'message' => "$vCard",
                    'messageEncoding' => 'iso-8859-1',
                ],
            ],

And the generated QRCode included this string:

BEGIN:VCARD\nVERSION:3.0\nREV:2022-09-16T16:29:50Z\nN;CHARSET=utf-8:[...]END:VCARD\n

As you cas see, there is some \n instead of line breaks.

I need something like this:

BEGIN:VCARD
VERSION:3.0
REV:2022-09-16T16:29:50Z
N;CHARSET=utf-8:[...]
END:VCARD

Do you know how I can replace all \n with line breaks ?

Note: Everything working fine since iOS 16. I don't know what Apple changed in Wallet...

0

There are 0 best solutions below