question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

withPhoneLike( ) does not work properly

See original GitHub issue

i have 3 contacts with below numbers:

+631230001234
+11230001234
01230001234

Below code only reterive 1 contact that is incorrect and must be 3 contacts

contactList = (new ContactsGetterBuilder(getContext())
                    .withPhoneLike("1230001234")
                    .allFields()
                    .buildList()
            );

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
blainepwnzcommented, Sep 25, 2019

@aliakbarRashidi check 1.12.2 please

1reaction
aliakbarRashidicommented, Sep 25, 2019

i think a possible way is that: change FilterUtils.withPhoneLikeFilter (line 33) and first format the filterData to the Standard E164 or clean it from space,dash and other characters except +, then compare to the pattern.

i found this regex useful for cleaning the phone "+63 123 000 1234".replaceAll("[^0-9+]", "")

    @Test
    public void testCleanPhoneNumberFromUnNecessaryCharacters() {
        assertEquals("+631230001234", cleanPhone("+63 123 000 1234"));
        assertEquals("01230001234", cleanPhone("0123 000 1234"));
        assertEquals("+631230001234", cleanPhone("tel:+63-123-000-1234"));
        assertEquals("+11230001234", cleanPhone("(+1)-123-(000)-1234"));
    }

    private String cleanPhone(String phone) {
        return phone.replaceAll("[^0-9+]", "");
    }
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to get a fault Iphone replaced - Apple Support Communities
... i am daily facing issues with phone like freezing, hanging, ... with 3rd party apps freezing plus something about the keyboard as...
Read more >
unlock my hawie smart phone without rese - iFixit
Hi tyric. If you have forgotten the password to unlock your phoen and you have created your Huawei account you can reset password...
Read more >
How to fix common smartphone problems - Popular Science
Most smartphone problems fall into just a few categories, like low battery life or buggy apps. Here's how to solve the most annoying...
Read more >
PUBG touch latency (Movement Issue) - OnePlus Community
It all went fine for few months but since past month , this new set of issue started ... If I keep all...
Read more >
Customer reviews - Amazon.com
How customer reviews and ratings work ... Receipt clearly stated for LG as well. ... did not work with phone like it said...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found