Search code examples
iosswiftfacebookswiftuifacebook-login

Facebook Login Swift UI granting permissions


I have a swiftUI function that is successfully logging in to facebook, but only if the permissions are just publicProfile and email, if I add any other permissions like the following

loginManager.logIn(permissions: [.publicProfile, .email, .user_friends], viewController: nil) { loginResult in

Then I get the following error: Type Array<Permission>.ArrayLiteralElement (aka Permission) has no member user_friends

I've tested with several different permissions in facebook's documentation. What am I missing?


Solution

  • The issue does seem to be that the names should be written in camelcase like publicProfile or userFriends. However for some of the other permissions I was using, specifically manage_fundraisers, there isn't an option for it directly as manageFundraisers. For anyone else with that issue I was able to solve it by using

    .custom("manage_fundraisers")