Find a suitable position in iOS

In my iOS application, I post some information on the wall of a Facebook user, now I want to find a similar record on the wall of friends of users posted by the same application, or match the text with the user wall with my friend wall, and then if the match finds out, read the information friend and all posts on friend’s wall, I am currently using facebook sdk for iOS. please offer me a solution for this.

+5
source share
1 answer

Well, this is done step by step; 1- You must obtain permission to the walls of friends of friends. 2- you should catch your messages (practically consuming) and compare your messages with them about the same application. 3- you have two options: you received the same post on one of your friends of friends, - you caught the user and received the necessary information. b- you will not find the slightest match - you return the message "No match found" or (404 - not found).

1-

NSArray *permissions = [[NSArray alloc] initWithObjects:
                        @"user_status",@"friends_status",
                        @"friends_about_me",@"friends_activities",
                        nil];
[FBSession openActiveSessionWithReadPermissions:permissions allowLoginUI:YES completionHandler: .....

`

2-

FBRequest *friendRequest = [FBRequest requestForGraphPath:@"me/friends?fields=name,status,picture,birthday,location"];
 [ friendRequest startWithCompletionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
NSArray *data = [result objectForKey:@"data"];
for (FBGraphObject<FBGraphUser> *friend in data) {
    if ("Your user status" == [friend status]){
       NsLog(@"friend @%,@% .. ",[friend name],[friend birthday], .... 
     }else {
        NSLog(@"No match found");
      }
}}];

`

0
source

All Articles