ios - Unable to get Facebook permissions after HTTPMethod DELETE in Swift -
i working on app logs in facebook using fbsdk in swift. have been able make requests wall posts using
var request: fbsdkgraphrequest request = fbsdkgraphrequest(graphpath: "me/feed"), parameters: ["access_token": fbsdkaccesstoken.currentaccesstoken().tokenstring], httpmethod:"get") request.startwithcompletionhandler({(connection, result, error) -> void in if error != nil { } else { } })
but have been unable results after used following log out
var deletepermission = fbsdkgraphrequest(graphpath: "me/permissions/", parameters: nil, httpmethod: "delete") deleterpermission.startwithcompletionhandler({(connection, result, error) -> void in if error != nil { } else { } })
when log in app, again asked accept permissions, when check expiration date current token fbsdkaccesstoken.currentaccesstoken().expirationdate
date before tried httpmethod: delete.
so wondering how possible permission app or renew access token because don't think it's working logging in , accepting permissions. have used following log out of app
// log out of database i'm using try! firauth.auth()!.signout() // log out of facebook, clear current token , logged user fbsdkaccesstoken.setcurrentaccesstoken(nil) fbsdkprofile.setcurrentprofile(nil)
i using `fbsdkloginbutton()' , setting following permissions log in
var loginbutton = fbsdkloginbutton() loginbutton.readpermissions = ["public_profile", "user_friends", "user_about_me", "user_posts"] loginbutton.delegate = self .... func loginbutton(loginbutton: fbsdkloginbutton!, didcompletewithresult result: fbsdkloginmanagerloginresult!, error: nserror!) { if error == nil { let credential = firfacebookauthprovider.credentialwithaccesstoken(fbsdkaccesstoken.currentaccesstoken().tokenstring) // firebase authentication firauth.auth()?.signinwithcredential(credential) {(user, error) in if error == nil { // no error found user credentials through firebase } else { } }}
but again after logging in , going viewcontroller segue , check current token "me/feed" not getting reply , token's expiration date has expired. easier create new app in facebook developer , set in xcode or there can user posts?
Comments
Post a Comment