我正在寻找可能构建一个iOS应用程序,我需要获取已登录用户的朋友列表,他们也在使用该应用程序,然后遍历该列表以获得更大的朋友列表该应用程序。 希望下面的小方案能更好地说明我的意思,如果不清楚的话
让我们说“山姆”使用我的应用程序,他有400个朋友,其中30个正在使用我的应用程序。 我想循环使用该应用程序的30位朋友获取他们的朋友列表,所以让我们说30岁的第一个人是“杰克”,他有10个朋友也在使用他们应该添加到阵列中的应用程序然后30人循环中的下一个人是“Jen”,她有15个人使用他们将被添加到Jake的10个朋友的应用程序,依此类推。
我知道根据这个链接可以在Facebook上获取朋友的朋友列表以获取朋友的朋友列表,但我主要担心的是速度。 您是否认为获取朋友的朋友列表对于iOS应用的用户来说会花费太长时间?
I'm looking to possibly build an iOS app where I would need to get a list of friends of the logged in user who are also using the app and then loop over that list to get an even bigger list of their friends who are also using the app. Hopefully the little scenario below will better illustrate what I mean if it's not clear
Lets say "Sam" uses my app and he has 400 friends of which 30 are using my app. I would like to loop the 30 friends who are using the app to get their friends list so lets say the first person of the 30 is "Jake" and he has 10 friends who are also using the app they should be added to an array and then the next person in the 30 people loop is "Jen" and she has 15 people using the app they would be added to Jake's 10 friends and so on.
I know it's possible according to this link Get a list of friends of a friend on Facebook to get the friends list of a friend but my main concern is speed. Do you think getting a list of friends of friends would take too long for a user of the iOS app?
最满意答案
该列表线性增长,因此我认为速度问题不会太多。 您始终可以设置呼叫总数的限制。 例如,如果我有200个朋友使用您的应用,并且您将通话次数限制为100,则只会显示前100位朋友的朋友。 这可能是一个非常广泛的清单。
您还可以通知您的用户他/她尝试执行的操作可能需要一段时间,并且他们有权随时取消。 取消后,您可以显示已收到的数据。
作为最后一个注释而不是使用数组来存储朋友列表的朋友,最好使用一个集合,因为很多人可能已经是彼此的朋友。 因此,如果“Jake”和“Jen”是朋友,他们就不会在列表中出现两次。
The list grows linearly, so I don't think there would be much of a speed issue. You can always set a limit to the total number of calls. For example, if I have 200 friends using your app and you limit the number of calls to 100, only the first 100 friends' friends will be shown. That can be quite an extensive list.
You could also inform your user that the operation he/she is trying to perform might take a while and give them the right to cancel at any time. When they cancel you could display the data you already received.
As a last note instead of using an array to store the friends of friends list, It would be better to use a set because chances are many of those people are already friends with each other. So if "Jake" and "Jen" are friends, they would not appear twice on the list.
循环朋友的朋友多久(How long to loop friends of friends)我正在寻找可能构建一个iOS应用程序,我需要获取已登录用户的朋友列表,他们也在使用该应用程序,然后遍历该列表以获得更大的朋友列表该应用程序。 希望下面的小方案能更好地说明我的意思,如果不清楚的话
让我们说“山姆”使用我的应用程序,他有400个朋友,其中30个正在使用我的应用程序。 我想循环使用该应用程序的30位朋友获取他们的朋友列表,所以让我们说30岁的第一个人是“杰克”,他有10个朋友也在使用他们应该添加到阵列中的应用程序然后30人循环中的下一个人是“Jen”,她有15个人使用他们将被添加到Jake的10个朋友的应用程序,依此类推。
我知道根据这个链接可以在Facebook上获取朋友的朋友列表以获取朋友的朋友列表,但我主要担心的是速度。 您是否认为获取朋友的朋友列表对于iOS应用的用户来说会花费太长时间?
I'm looking to possibly build an iOS app where I would need to get a list of friends of the logged in user who are also using the app and then loop over that list to get an even bigger list of their friends who are also using the app. Hopefully the little scenario below will better illustrate what I mean if it's not clear
Lets say "Sam" uses my app and he has 400 friends of which 30 are using my app. I would like to loop the 30 friends who are using the app to get their friends list so lets say the first person of the 30 is "Jake" and he has 10 friends who are also using the app they should be added to an array and then the next person in the 30 people loop is "Jen" and she has 15 people using the app they would be added to Jake's 10 friends and so on.
I know it's possible according to this link Get a list of friends of a friend on Facebook to get the friends list of a friend but my main concern is speed. Do you think getting a list of friends of friends would take too long for a user of the iOS app?
最满意答案
该列表线性增长,因此我认为速度问题不会太多。 您始终可以设置呼叫总数的限制。 例如,如果我有200个朋友使用您的应用,并且您将通话次数限制为100,则只会显示前100位朋友的朋友。 这可能是一个非常广泛的清单。
您还可以通知您的用户他/她尝试执行的操作可能需要一段时间,并且他们有权随时取消。 取消后,您可以显示已收到的数据。
作为最后一个注释而不是使用数组来存储朋友列表的朋友,最好使用一个集合,因为很多人可能已经是彼此的朋友。 因此,如果“Jake”和“Jen”是朋友,他们就不会在列表中出现两次。
The list grows linearly, so I don't think there would be much of a speed issue. You can always set a limit to the total number of calls. For example, if I have 200 friends using your app and you limit the number of calls to 100, only the first 100 friends' friends will be shown. That can be quite an extensive list.
You could also inform your user that the operation he/she is trying to perform might take a while and give them the right to cancel at any time. When they cancel you could display the data you already received.
As a last note instead of using an array to store the friends of friends list, It would be better to use a set because chances are many of those people are already friends with each other. So if "Jake" and "Jen" are friends, they would not appear twice on the list.
发布评论