facebook / facebook/facebook-ios-sdk
friendIDs always nil when using Limited Login
- Dominant language
- Swift
- Stars
- 8.1k
- Forks
- 3.7k
- PR merge metrics
- No merged PRs in 30d
Description
### Checklist before submitting a bug report
- [x] I've updated to the latest released version of the SDK
- [x] I've searched for existing [GitHub issues](https://github.com/facebook/facebook-ios-sdk/issues)
- [x] I've looked for existing answers on [Stack Overflow](https://facebook.stackoverflow.com), the [Facebook Developer Community Forum](https://developers.facebook.com/community/) and the [Facebook Developers Group](https://www.facebook.com/groups/fbdevelopers)
- [x] I've read the [Code of Conduct](https://github.com/facebook/facebook-ios-sdk/blob/main/CODE_OF_CONDUCT.md)
- [x] This issue is not security related and can safely be disclosed publicly on GitHub
### Xcode version
16.2
### Facebook iOS SDK version
18.0.0
### Dependency Manager
SPM
### SDK Framework
Core
### Goals
Retrieve list of `friendIDs`
### Expected results
List of `friendIDs` for the user who have also given permission to the app.
### Actual results
With limited login, the friendIDs are always `nil`. If I use an earlier version of the SDK 15, and then make a GraphRequest for friends, I get the entire list.
### Steps to reproduce
Use the sample code in https://developers.facebook.com/docs/facebook-login/limited-login/ios
Login with account, give permissions.
The friendIDs value is nil.
### Code samples & details
```swift
let loginManager = LoginManager()
// Ensure the configuration object is valid
guard let configuration = LoginConfiguration(
permissions:["email", "user_friends", "public_profile"],
tracking: .limited,
nonce: "123"
)
else {
return
}
loginManager.logIn(configuration: configuration) { result in
switch result {
case .cancelled, .failed:
// Handle error
break
case .success:
// getting user ID
let userID = Profile.current?.userID
// getting pre-populated friends list
let friendIDs = Profile.current?.friendIDs
// friendIDs is always nil
}
}
```
Contributor guide
Assessment
This issue has not been assessed yet.