Skip to content

projection is returning more fields than expected #94

@RRGT19

Description

@RRGT19

Describe the bug
According to the docs here, if we use:

const {contacts} = await Contacts.getContacts({
      projection: {
        name: true // <======
      }
    });

It will only return two properties: contactId and name. This is not what is happening, I am receiving more fields, phones.

Example:

[
    {
        "contactId": "1",
        "name": {
            "display": "Juan Perez",
            "given": "Juan",
            "family": "Perez"
        },
        "phones": [
            {
                "type": "mobile",
                "number": "(809) 333-2222"
            },
            {
                "type": "custom",
                "label": "Flote",
                "number": "(849) 333-2222"
            }
        ]
    },
]

The same thing is happening with the pickContact() method. Example:

const result = await Contacts.pickContact({
      projection: {
        name: true
      }
});

Platforms

  • Android

iOS seems to be fine, but maybe you can re-validate the issue on iOS to be sure is not happening.

To Reproduce
Steps to reproduce the behavior:

  1. Install the latest version of the plugin
  2. Call getContacts() method with a projection with only name
  3. Call pickContact() method with a projection with only name

Expected behavior
Contacts should have only a name object, no more than that.

Example:

[
    {
        "contactId": "1",
        "name": {
            "display": "Juan Perez",
            "given": "Juan",
            "family": "Perez"
        },
    },
]

Screenshots
None.

Smartphone (please complete the following information):

  • Device: Android Emulator Nexus 6
  • OS: API 31 Android 12

Additional context
None.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions