check if user is logged in with facebook

how can i check if my current user is logged in with facebook ? (swift3)

and how can i keep my user logged in with facebook ?

so if the user closes the app and reopens it he will still be logged in with facebook

To check if user is logged in, you can try to get current user (see here in docs, tab Swift).

And as far as I know, to check if user is logged in through Facebook you can get user property called ‘socialAccount’ and check if it equals to ‘Facebook’.

and how can i keep my user logged in with facebook ?
does it logout user after closing the app?

Hi,

The internal task BKNDLSS-13266 is created.

Now you could fetch “socialAccount” with func like this:

func getSocialAccount() -> String? {
var result : String? = nil
Types.tryblock({ () -> Void in
let objectId = self.backendless!.userService.currentUser.objectId as String!
let user = self.backendless!.userService.find(byId: objectId ) as BackendlessUser
result = user.getProperty("socialAccount") as? String
},
catchblock: { (exception) -> Void in
print("getSosialAccount: server reported an error: \(exception as! Fault)")
})
return result
}

Regards,
Slava