Facebook Login ACCOUNT PERMISSIONS: nil

I’ve created two apps attempting to install Facebook login. I’ve followed all of the steps on Facebook and at Backendless. I am having an issue that is intermittent. At times, the Facebook login works, and at other times it does not. When it does not work I get the following error.
ACCOUNT PERMISSIONS: nil
2017-02-28 10:37:22.246016 FacebookLoginWithBackendless[2702:941774] *** Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: '*** -[_NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[2]’
*** First throw call stack:
(0x19395d1b8 0x19239455c 0x19383b870 0x1938475fc 0x100101604 0x1000bc020 0x1000bd1c0 0x199aa2624 0x199aa20b0 0x1a1ec3fc0 0x1a1ebbec0 0x193963150 0x193855eac 0x19553392c 0x195533798 0x195533b40 0x19390ab5c 0x19390a4a4 0x1939080a4 0x1938362b8 0x1952ea198 0x19987d7fc 0x199878534 0x1000c3ae4 0x1928195b8)
For both applications I am running Backendless 3.0.44.
The code I am using to test the error above is below.
func application(
app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool
{
/************************* FACEBOOK *************************/
let result = FBSDKApplicationDelegate.sharedInstance().application(app, open: url, sourceApplication: options[UIApplicationOpenURLOptionsKey.sourceApplication] as! String, annotation: options[UIApplicationOpenURLOptionsKey.annotation])
if result
{
let token = FBSDKAccessToken.current()
let fieldsMapping = [
“id” : “facebookId”,
“name” : “name”,
“first_name”: “firstName”,
“last_name” : “lastName”,
“gender”: “gender”,
“email”: “email”
]

// TESTING CODE
let permissions = token?.value(forKey: “permissions”)
print(“ACCOUNT PERMISSIONS: (permissions)”)

backendless?.userService.login(withFacebookSDK: token, permissions: [“user_friends”, “email”, “public_profile”, “contact_email”], fieldsMapping: fieldsMapping, response: { (user : BackendlessUser?) -> Void in

print(“User email: (user?.email), User name: (user?.name)”)
self.validUserTokenSync()

}, error: { (fault :Fault?) -> Void in

print(“There is an error in AppDelegate’s loginWithFacebookSDK(): (fault)”)
})
}

return result
}
Any help would be appreciated.
Take care,
Jon

I was able to fix this issue. In my podfile I specified version 4.15.1 for the FBSDK.

platform :ios, '8.0'
use_frameworks!
pod 'Backendless'
pod 'Bolts'
pod 'FBSDKCoreKit', '4.15.1'
pod 'FBSDKShareKit', '4.15.1'
pod ‘FBSDKLoginKit', '4.15.1'

Sorry for the delay. Glad you managed to solve it!