사용자의 Facebook 친구 목록을 활용하는 앱을 만들고 있습니다. 구문 분석 백엔드에 fbFriendsList
이라는 배열 유형 열이 있습니다. 주변을 둘러 본 후 지금까지 다음과 같이했습니다.Facebook 친구 목록을 검색하고 구문 분석하도록 저장하는 방법?
//my permission array
NSArray *permissionsArray = @[ @"user_about_me",@"email", @"user_friends"];
//My fb request for friends after verifying that user is logging in the first time
[FBRequestConnection startForMyFriendsWithCompletionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
if (!error) {
NSArray *friendObjects = [result objectForKey:@"data"];
//fbFriendIds is a Mutable array i have declared
fbFriendIds = [NSMutableArray arrayWithCapacity:friendObjects.count];
// Create a list of friends' Facebook IDs
for (NSDictionary *friendObject in friendObjects) {
[fbFriendIds addObject:[friendObject objectForKey:@"id"]];
}
}
}];
이렇게하면 친구 목록을받지 못했습니다. 그래서 나는 이것을 시도했다.
FBRequest* friendsRequest = [FBRequest requestForMyFriends];
[friendsRequest startWithCompletionHandler: ^(FBRequestConnection *connection,
NSDictionary* result,
NSError *error) {
friends = [result objectForKey:@"data"];
NSLog(@"Found: %i friends", friends.count);
for (NSDictionary<FBGraphUser>* friend in friends) {
NSLog(@"I have a friend named %@ with id %@", friend.name, friend.id);
}
}];
그러나 나는 아직 친구를 얻지 못했다. 나중에 함수에 나는이
user[@"fbFriendsList"] = friends;
[user saveInBackground];
처럼 PFUser
에 배열을 저장하고 그러나 이것은 Found: 0
를 반환합니다. 왜 이러한 방법으로 친구 목록을 검색하지 못합니까? 내가 어떻게 그것을 수행하고 그것을 구문 분석 백엔드에 저장할 수 있습니까? 그래서, 당신의 앱을 승인하지 않았다 https://developers.facebook.com/docs/apps/changelog
사용자는 자신의 데이터를 저장할 수 있는지 알고 가능성이 없다 :
하지만 다른 앱 코드가 있습니다. 그것은 몇 달 전에 지어졌으며 여전히 동일한 방법을 사용하여 잘 작동합니다. – NSNoob
변경 로그를 읽습니다. 이전 앱 (2014 년 4 월 이전에 생성)은 여전히 v1.0을 사용할 수 있습니다.이 친구는 2015 년 4 월까지 모든 친구를 반환합니다. – luschn
이 부분에 대해 설명해 주실 수 있습니다. 초대장은 요청과 동일한 동작을하며 다음 중 하나의 수신자에게 전달됩니다. 장소 : Facebook 캔버스의 앱 iOS 또는 Android (설치된 경우)의 기본 앱 Apple App Store 또는 Google Play (설치되지 않은 경우) "? 이 물건을 사용하여 iOS 앱에 친구를 추가 할 수 있습니까? fb 캔버스를 사용하지 않더라도 – NSNoob