From the Header files of ParseFacebookUtilsV4
PFFacebookUtils.h
...
/*! @abstract FBSDKLoginManager provides methods for configuring
login behavior, default audience and managing Facebook Access Token.
@returns An instance of FBSDKLoginManager that is used by
PFFacebookUtils. */
+ (FBSDKLoginManager *)facebookLoginManager;
Therefore, supposedly, a declaration of "FBSDKLoginManager" is used by PFFacebookutils, let's see if this works. In fact, let's set the default to "system account", ... here's the code:
[[PFFacebookUtils facebookLoginManager] setLoginBehavior:FBSDKLoginBehaviorSystemAccount];
[PFFacebookUtils logInInBackgroundWithReadPermissions:FACEBOOK_READ_PERMISSIONS block:^(PFUser *user, NSError *error) {
}];
Yes, this code compiles, this code works, just make sure you declare the login behavior before you call the login stuff, and preferably in your AppDelegate when you are initializing your code bases, Parse, Parse Facebook Utilities, etc. ..
In fact, to make sure this works for you, I just downloaded the MOST up to date version of PARSE iOS SDK and it has this same functionality. Here are your options, this is from the Facebook SDK for iOS which feeds the PFFacebookUtils:
@typedef FBSDKLoginBehavior enum
@abstract Passed to the \c FBSDKLoginManager to indicate how Facebook
Login should be attempted.
@discussion Facebook Login authorizes the application to act on
behalf of the user, using the user's Facebook account. Usually a
Facebook Login will rely on an account maintained outside of the
application, by the native Facebook application, the browser, or
perhaps the device itself. This avoids the need for a user to enter
their username and password directly, and provides the most secure
and lowest friction way for a user to authorize the application to
interact with Facebook.
The \c FBSDKLoginBehavior enum specifies which log in method should
be attempted. Most applications will use the default, which attempts
a login through the Facebook app and falls back to the browser if
needed.
If log in cannot be completed using the specificed behavior, the
completion handler will be invoked with an error in the \c
FBSDKErrorDomain and a code of \c FBSDKLoginUnknownErrorCode. */
typedef NS_ENUM(NSUInteger, FBSDKLoginBehavior)
{
/*!
@abstract Attempts log in through the native Facebook app. If the Facebook app is
not installed on the device, falls back to \c FBSDKLoginBehaviorBrowser. This is the
default behavior.
*/
FBSDKLoginBehaviorNative = 0,
/*!
@abstract Attempts log in through the Safari browser
*/
FBSDKLoginBehaviorBrowser,
/*!
@abstract Attempts log in through the Facebook account currently signed in through Settings.
If no Facebook account is signed in, falls back to \c FBSDKLoginBehaviorNative.
*/
FBSDKLoginBehaviorSystemAccount,
/*!
@abstract Attemps log in through a modal \c UIWebView pop up
@note This behavior is only available to certain types of apps. Please check the Facebook
Platform Policy to verify your app meets the restrictions.
*/
FBSDKLoginBehaviorWeb,
};