简体   繁体   中英

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?

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")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM