How to filter quickblox user based on his phone number?

不打扰是莪最后的温柔 提交于 2019-12-02 17:48:42

问题


I'm able to filter users with their phone numbers using [QBRequest usersWithPhoneNumbers:] method, but having problem with following scenario.

Suppose, I've a quickblox user with 1234567890 phone number in my app. Now, in my contact list, I've the same phone number but with +91 (caller code of India), so the number I in my phone book is, +91 1234567890, once I'll fetch all my contacts from phone book, it'll be look like, 911234567890 (+ and space will be removed), and I'll query for quickblox user with the number I've fetched, and it'll return me [no user] because there's 91 in the number I'm requesting.

I think, quickblox comparing entire number and not the part of the number. That's the reason I'm not getting the user. Any idea to solve this?

I found a 3rd party library, which removes country code from the number, but I don't want to use it, because I want to make it general and not to dependent and more complex.

Thanks in advance.


回答1:


You are right, QuickBlox compares entire string, there is no intelligent comparison. So the only solution for you right now is to remove country code from phone number before saving user to QuickBlox.



来源:https://stackoverflow.com/questions/27055128/how-to-filter-quickblox-user-based-on-his-phone-number

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!