Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cant import file type not supported #6

Open
ibrahem-kamal opened this issue Jun 25, 2021 · 7 comments
Open

cant import file type not supported #6

ibrahem-kamal opened this issue Jun 25, 2021 · 7 comments

Comments

@ibrahem-kamal
Copy link

it works fine on ios but on android i get the error in the title

@Gummibeer
Copy link
Member

Could you provide an example file somehow? 🤔
I haven't tested it yet with my phone. And which app and version you are using to import it? Official Google contact or any other one?

@ibrahem-kamal
Copy link
Author

i am using the basic example

Vcard::make()
    ->kind(Kind::INDIVIDUAL)
    ->gender(Gender::MALE)
    ->fullName('John Adam Smith')
    ->name('Smith', 'John', 'Adam')
    ->email('[email protected]')
    ->email('[email protected]', [Email::WORK, Email::INTERNET])
    ->tel('+1234567890', [Tel::HOME, Tel::VOICE])
    ->tel('+0987654321', [Tel::WORK, Tel::VOICE])
    ->tel('+0123456789', [Tel::CELL, Tel::VOICE])
    ->url('https://johnsmith.com')
    ->url('https://company.com')
    ->bday(Carbon::parse('1990-06-24'))
    ->photo('data:image/jpeg;base64,'.base64_encode(file_get_contents(__DIR__.'/stubs/photo.jpg')))
    ->title('V. P. Research and Development')
    ->role('Excecutive')
    ->org('Google;GMail Team;Spam Detection Squad')
    ->member('[email protected]', '550e8400-e29b-11d4-a716-446655440000')
;

also i am using redmi k20 or xiaomi mi 9 t and i am using the default phone app to import it

@Gummibeer
Copy link
Member

Hey,
I'm still on holiday right now but the org() line looks suspicious.
It should be three arguments without semicolon.

public function org(?string $company = null, ?string $unit = null, ?string $team = null): self

Could you change that. Right now I don't have any special encoding for semicolons in place. So it could be that the two additional semicolons made the file invalid. 🤔
At all I would reduce it to name only for example and advance from there.
This package is still pre v1 as it's so hard to find proper rules for vCard files. 😔

Haven't checked the readme yet, in case it's wrong: I'm happy to merge a PR that fixes the readme. 🥳

@ibrahem-kamal
Copy link
Author

i tried with only name but it still gives invalid on phones , but with mac it import it successfully

@Gummibeer
Copy link
Member

I assume it's because the package generates vCards in v4.0 but android seems to only support v3.x

@ibrahem-kamal
Copy link
Author

would u be able to make the version selection as a param ?

@Gummibeer
Copy link
Member

Gummibeer commented Jun 27, 2021

I would definitely accept a PR. Could imagine a Factory::vCard4() or only a new class Vcard4.
Ramsey UUID package could be a template for this as it also has multiple versions of UUIDs.

I'm still on holiday without any laptop - so can't write code till next week - first full July week.

Wikipedia had a cool table with the differences between the versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants