heuer / segno

Python QR Code and Micro QR Code encoder
https://pypi.org/project/segno/
BSD 3-Clause "New" or "Revised" License
606 stars 52 forks source link

url info not importing via QR vCard #119

Open Torvicio opened 1 year ago

Torvicio commented 1 year ago

Here is the code I used. The contact1.png works, and when I use "Android Lens", it asks to save the info, but it does not import the website url info: I have not tested it on iPhone.

import segno from segno import helpers

vcard = segno.helpers.make_vcard( name='Pie;Rasberry', displayname='Rasberry Pie',

email can be multiple values, seperated by commas or make ['xx@gsomeemail.com','xg@someother.com']

email=('rpie.@some.com'),
url =[
    'https://www.amazon.com',
    'https://www.google.com',
],
phone='+1111111111',
# extra items that can be used per testing - originated by chatgpt

title = 'Boss',
org = 'MyBiz-NotYours',

)

img = vcard.to_pil(scale=6, dark="#FF7D92").rotate(45, expand=True) img.save('contact1.png')

heuer commented 1 year ago

Thanks for your report.

Android may only support one URL.

vCard 4 defines that multiple URLs can be named: https://www.rfc-editor.org/rfc/rfc6350#section-6.7.8

As far as I know, vCard 3 makes no statement about cardinality.

Please try the code with just one URL and report back if it works.

Torvicio commented 1 year ago

I tried it with only one url .. shortened it to : url = 'https://www.amazon.com', then tried : url = [https://www.amazon.com']

Code does its thing, but when saved, the URL is not saved at all. I am using Android 13 as a reference.