         }
     }
     
-    private func permPublish(command: CDVInvokedUrlCommand, permissions: [String], finish: (() -> Void)? = nil) {
-        FBSDKLoginManager.init().logInWithPublishPermissions(permissions)  { (result: FBSDKLoginManagerLoginResult!, err: NSError!) -> Void in
+    fileprivate func permPublish(_ command: CDVInvokedUrlCommand, permissions: [String], finish: (() -> Void)? = nil) {
+        FBSDKLoginManager.init().logIn(withPublishPermissions: permissions)  { (result: FBSDKLoginManagerLoginResult!, err: NSError!) -> Void in
             log("Result of logInWithPublishPermissions: \(result), Error: \(err)")
             if err != nil {
                 self.finish_error(command, msg: String(err))

class FBConnect: CDVPlugin {
    // MARK: - Plugin Commands
    
    func login(command: CDVInvokedUrlCommand) {
        fork {
            var perms = command.arguments.map { $0 as! String }
            if perms.count < 1 {

            } else {
                assert(!reads.isEmpty || !pubs.isEmpty)
                
                func finish(_ ac: FBSDKAccessToken!) { self.finish_ok(command, result: ac.tokenString as AnyObject?) }
                
                if !reads.isEmpty {
                    self.accessToken.getCurrent({ self.permRead(command, permissions: reads) }, taker: finish)
