-
Notifications
You must be signed in to change notification settings - Fork 130
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
conact.name.first contains the whole contact full name and contact.name.last is always null #153
Comments
➜ airplaza git:(main) ✗ flutter doctor -v [✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0-rc1) [✓] Xcode - develop for iOS and macOS (Xcode 15.3) [✓] Chrome - develop for the web [✓] Android Studio (version 2023.2) [✓] VS Code (version 1.87.2) [✓] Connected device (3 available) [✓] Network resources • No issues found! |
Hi @Valent1 This is probably because that's how your contact was saved. Many contact apps don't automatically split first and last name when you add a contact. You can use an app like Quis (http://quis.co) to change that :) If your contact shows as first name and last name properly separated on the default contact app, feel free to reopen this thread. |
if it was that trivial, I wouldn't have posted this. All my contacts are saved with First name and Last name, they are saved in Google Contacts and I sync them with my iPhone. I access them via Google Contacts or the native Apple Contacts/Phone apps, no problem. However, as I said in my original post, contacts are imported in my flutter app with a null last name via flutter_contacts. Would you mind trying to replicate this on your physical iOS device? Just sync your contacts and then print some out, the ones that you know are saved correctly with first and last name. |
How do I reopen this? |
I have the same setup as you and never had this problem. So I'm not sure what's going on. You can see from this line that Could you try logging the whole contact name? And can you also try logging what CNContact looks like at this point? |
With no additional info, it's difficult to help. Please re-open with more details (code, |
I just noticed that my contacts don't have any last name after import.
The first name contains the whole full name, and the last name is null.
I put a log on first and last and this is the output (note that in this method, firstName and lastName are passed as contact?.name.first and contact?.name.last.
Sample of log output:
...
[Log] 2024-04-02 22:28:02.853410: SHOUT: LastName: null
[Log] 2024-04-02 22:28:02.911795: SHOUT: FirstName: Alessandra Stefanini
[Log] 2024-04-02 22:28:02.911894: SHOUT: LastName: null
[Log] 2024-04-02 22:28:14.073969: SHOUT: FirstName: Alessandra Stefanini
[Log] 2024-04-02 22:28:14.074276: SHOUT: LastName: null
[Log] 2024-04-02 22:28:14.098594: SHOUT: FirstName: Alessandro Alabastri
[Log] 2024-04-02 22:28:14.098744: SHOUT: LastName: null
[Log] 2024-04-02 22:28:14.136106: SHOUT: FirstName: Alessandro Bellan
[Log] 2024-04-02 22:28:14.136235: SHOUT: LastName: null
...
The text was updated successfully, but these errors were encountered: