如何根据他的电话号码过滤quickblox用户? [英] How to filter quickblox user based on his phone number?

查看:179
本文介绍了如何根据他的电话号码过滤quickblox用户?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以使用 [QBRequest usersWithPhoneNumbers:] 方法过滤使用者的电话号码,但遇到以下情况的问题。



假设,我有一个quickblox用户,在我的应用中有 1234567890 电话号码。
现在,在我的联系人列表中,我有相同的电话号码,但是 +91 (印度的来电显示),所以我的电话号码是, +91 1234567890 ,一旦我从电话簿中取得所有的联系人,就会看起来像911234567890( + 空格将会被删除),然后我将使用我提取的数字来查询quickblox用户,并且它会返回我[没有用户]因为我要求的号码有91个。

我认为,quickblox比较了整个数字而不是数字的一部分。这是我没有得到用户的原因。任何想法解决这个问题?

我发现第三方库,从数字中删除国家代码,但我不想使用它,因为我想使其一般,而不是依赖和更复杂。

感谢提前。

解决方案

你是对的,QuickBlox比较整个字符串,没有智能比较。因此,现在唯一的解决方案是在将用户保存到QuickBlox之前从电话号码中删除国家/地区代码。


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.

解决方案

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.

这篇关于如何根据他的电话号码过滤quickblox用户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆