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

Add nickname to name projection on iOS. #121

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

gregzo
Copy link

@gregzo gregzo commented Jun 10, 2024

Very straightforward PR, I simply added nickname to the name projection and mapped Swift side to CNContactNicknameKey. I've no experience with Android, but it could be a tad more work, mapping to ContactsContract.CommonDataKinds.Nickname.NAME.

Closes #120 but only for iOS.

@tafelnl
Copy link
Member

tafelnl commented Jun 10, 2024

Thanks for the PR! I'm trying to keep the API and behavior of this plugin consistent across Android and iOS. I'm willing to merge this PR, but I would highly prefer it also having an Android implementation. But currently I don't have time available to do this myself

@@ -134,6 +134,7 @@ export interface NamePayload {
family: string | null;
prefix: string | null;
suffix: string | null;
nickname: string | null;
Copy link
Member

@tafelnl tafelnl Jun 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency it might make sense to use nick instead. As we're also not using displayName instead of display for example

Suggested change
nickname: string | null;
nick: string | null;

@gregzo
Copy link
Author

gregzo commented Jun 11, 2024

Thank you for the quick reply. I can handle the Android code fine, I think, but am not setup to test it. Shall I do it anyway?

@tafelnl
Copy link
Member

tafelnl commented Jun 11, 2024

but am not setup to test it

By this, you mean that you don't have Android Studio for coding and an emulator and/or an Android device to test the code on? Or that it's not completely clear how to test this project on an Android device? I could assist you with the latter

@gregzo
Copy link
Author

gregzo commented Jun 11, 2024

I don't have Android Studio, emulator, or device. We're developing for iOS first, Android to follow depending on market fit. Small team, sadly no time for exploratory work an Android right now...

@tafelnl
Copy link
Member

tafelnl commented Jun 11, 2024

Understood! No worries there. You could try and write it off the cuff. But you may have a hard time developing like that. And you don't have the added features Android Studio provides, like linting. So you could try, but it's sub-optimal indeed.

Off-topic: isn't Capacitor actually the kind of platform that could solve your problem? From my experience, I found that once when you've setup one of the platforms with Capacitor, adding another one is peanuts. Even if the developer hasn't got experience with said platform. But of course, depending on your use case and business case this might be a completely different story. But I think if you're mainly using the first party plugins, it shouldn't be much overhead

@gregzo
Copy link
Author

gregzo commented Jun 11, 2024

Gave Android code a go just now, but because the nickname field isn't part of ContactsContract.CommonDataKinds.StructuredName, it's a tad more work than iOS side and indeed not something I'd feel confortable pushing without a properly setup environment to test, sorry...

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

Successfully merging this pull request may close these issues.

Feat: Add nickname to name result type
2 participants