[ios] Updated ParseFacebookUtilsV4 framework.

This commit is contained in:
Илья Гречухин 2015-12-21 12:56:49 +03:00
parent 3e0611fe09
commit 597327c795
3 changed files with 80 additions and 74 deletions

View file

@ -11,17 +11,19 @@
#import <Bolts/BFTask.h>
#import <FBSDKCoreKit/FBSDKAccessToken.h>
#import <FBSDKLoginKit/FBSDKLoginManager.h>
#import <Parse/PFConstants.h>
#import <Parse/PFUser.h>
#import <FBSDKCoreKit/FBSDKAccessToken.h>
#if TARGET_OS_IOS
#import <FBSDKLoginKit/FBSDKLoginManager.h>
#endif
NS_ASSUME_NONNULL_BEGIN
/*!
The `PFFacebookUtils` class provides utility functions for using Facebook authentication with <PFUser>s.
/**
The `PFFacebookUtils` class provides utility functions for using Facebook authentication with `PFUser`s.
@warning This class supports official Facebook iOS SDK v4.0+ and is available only on iOS.
*/
@ -31,10 +33,10 @@ NS_ASSUME_NONNULL_BEGIN
/// @name Interacting With Facebook
///--------------------------------------
/*!
@abstract Initializes Parse Facebook Utils.
/**
Initializes Parse Facebook Utils.
@discussion You must provide your Facebook application ID as the value for FacebookAppID in your bundle's plist file
You must provide your Facebook application ID as the value for FacebookAppID in your bundle's plist file
as described here: https://developers.facebook.com/docs/getting-started/facebook-sdk-for-ios/
@warning You must invoke this in order to use the Facebook functionality in Parse.
@ -43,35 +45,39 @@ NS_ASSUME_NONNULL_BEGIN
*/
+ (void)initializeFacebookWithApplicationLaunchOptions:(nullable NSDictionary *)launchOptions;
/*!
@abstract `FBSDKLoginManager` provides methods for configuring login behavior, default audience
#if TARGET_OS_IOS
/**
`FBSDKLoginManager` provides methods for configuring login behavior, default audience
and managing Facebook Access Token.
@warning This method is available only on iOS.
@returns An instance of `FBSDKLoginManager` that is used by `PFFacebookUtils`.
@return An instance of `FBSDKLoginManager` that is used by `PFFacebookUtils`.
*/
+ (FBSDKLoginManager *)facebookLoginManager;
#endif
///--------------------------------------
/// @name Logging In
///--------------------------------------
/*!
@abstract *Asynchronously* logs in a user using Facebook with read permissions.
/**
*Asynchronously* logs in a user using Facebook with read permissions.
@discussion This method delegates to the Facebook SDK to authenticate the user,
and then automatically logs in (or creates, in the case where it is a new user) a <PFUser>.
This method delegates to the Facebook SDK to authenticate the user,
and then automatically logs in (or creates, in the case where it is a new user) a `PFUser`.
@param permissions Array of read permissions to use.
@returns The task that has will a have `result` set to <PFUser> if operation succeeds.
@return The task that has will a have `result` set to `PFUser` if operation succeeds.
*/
+ (BFTask PF_GENERIC(PFUser *)*)logInInBackgroundWithReadPermissions:(nullable NSArray PF_GENERIC(NSString *)*)permissions;
/*!
@abstract *Asynchronously* logs in a user using Facebook with read permissions.
/**
*Asynchronously* logs in a user using Facebook with read permissions.
@discussion This method delegates to the Facebook SDK to authenticate the user,
and then automatically logs in (or creates, in the case where it is a new user) a <PFUser>.
This method delegates to the Facebook SDK to authenticate the user,
and then automatically logs in (or creates, in the case where it is a new user) a `PFUser`.
@param permissions Array of read permissions to use.
@param block The block to execute when the log in completes.
@ -80,23 +86,23 @@ NS_ASSUME_NONNULL_BEGIN
+ (void)logInInBackgroundWithReadPermissions:(nullable NSArray PF_GENERIC(NSString *)*)permissions
block:(nullable PFUserResultBlock)block;
/*!
@abstract *Asynchronously* logs in a user using Facebook with publish permissions.
/**
*Asynchronously* logs in a user using Facebook with publish permissions.
@discussion This method delegates to the Facebook SDK to authenticate the user,
and then automatically logs in (or creates, in the case where it is a new user) a <PFUser>.
This method delegates to the Facebook SDK to authenticate the user,
and then automatically logs in (or creates, in the case where it is a new user) a `PFUser`.
@param permissions Array of publish permissions to use.
@returns The task that has will a have `result` set to <PFUser> if operation succeeds.
@return The task that has will a have `result` set to `PFUser` if operation succeeds.
*/
+ (BFTask PF_GENERIC(PFUser *)*)logInInBackgroundWithPublishPermissions:(nullable NSArray PF_GENERIC(NSString *)*)permissions;
/*!
@abstract *Asynchronously* logs in a user using Facebook with publish permissions.
/**
*Asynchronously* logs in a user using Facebook with publish permissions.
@discussion This method delegates to the Facebook SDK to authenticate the user,
and then automatically logs in (or creates, in the case where it is a new user) a <PFUser>.
This method delegates to the Facebook SDK to authenticate the user,
and then automatically logs in (or creates, in the case where it is a new user) a `PFUser`.
@param permissions Array of publish permissions to use.
@param block The block to execute when the log in completes.
@ -105,23 +111,23 @@ NS_ASSUME_NONNULL_BEGIN
+ (void)logInInBackgroundWithPublishPermissions:(nullable NSArray PF_GENERIC(NSString *)*)permissions
block:(nullable PFUserResultBlock)block;
/*!
@abstract *Asynchronously* logs in a user using given Facebook Acess Token.
/**
*Asynchronously* logs in a user using given Facebook Acess Token.
@discussion This method delegates to the Facebook SDK to authenticate the user,
and then automatically logs in (or creates, in the case where it is a new user) a <PFUser>.
This method delegates to the Facebook SDK to authenticate the user,
and then automatically logs in (or creates, in the case where it is a new user) a `PFUser`.
@param accessToken An instance of `FBSDKAccessToken` to use when logging in.
@returns The task that has will a have `result` set to <PFUser> if operation succeeds.
@return The task that has will a have `result` set to `PFUser` if operation succeeds.
*/
+ (BFTask PF_GENERIC(PFUser *)*)logInInBackgroundWithAccessToken:(FBSDKAccessToken *)accessToken;
/*!
@abstract *Asynchronously* logs in a user using given Facebook Acess Token.
/**
*Asynchronously* logs in a user using given Facebook Acess Token.
@discussion This method delegates to the Facebook SDK to authenticate the user,
and then automatically logs in (or creates, in the case where it is a new user) a <PFUser>.
This method delegates to the Facebook SDK to authenticate the user,
and then automatically logs in (or creates, in the case where it is a new user) a `PFUser`.
@param accessToken An instance of `FBSDKAccessToken` to use when logging in.
@param block The block to execute when the log in completes.
@ -134,26 +140,26 @@ NS_ASSUME_NONNULL_BEGIN
/// @name Linking Users
///--------------------------------------
/*!
@abstract *Asynchronously* links Facebook with read permissions to an existing <PFUser>.
/**
*Asynchronously* links Facebook with read permissions to an existing `PFUser`.
@discussion This method delegates to the Facebook SDK to authenticate
the user, and then automatically links the account to the <PFUser>.
This method delegates to the Facebook SDK to authenticate
the user, and then automatically links the account to the `PFUser`.
It will also save any unsaved changes that were made to the `user`.
@param user User to link to Facebook.
@param permissions Array of read permissions to use when logging in with Facebook.
@returns The task that will have a `result` set to `@YES` if operation succeeds.
@return The task that will have a `result` set to `@YES` if operation succeeds.
*/
+ (BFTask PF_GENERIC(NSNumber *)*)linkUserInBackground:(PFUser *)user
withReadPermissions:(nullable NSArray PF_GENERIC(NSString *)*)permissions;
/*!
@abstract *Asynchronously* links Facebook with read permissions to an existing <PFUser>.
/**
*Asynchronously* links Facebook with read permissions to an existing `PFUser`.
@discussion This method delegates to the Facebook SDK to authenticate
the user, and then automatically links the account to the <PFUser>.
This method delegates to the Facebook SDK to authenticate
the user, and then automatically links the account to the `PFUser`.
It will also save any unsaved changes that were made to the `user`.
@param user User to link to Facebook.
@ -165,26 +171,26 @@ NS_ASSUME_NONNULL_BEGIN
withReadPermissions:(nullable NSArray PF_GENERIC(NSString *)*)permissions
block:(nullable PFBooleanResultBlock)block;
/*!
@abstract *Asynchronously* links Facebook with publish permissions to an existing <PFUser>.
/**
*Asynchronously* links Facebook with publish permissions to an existing `PFUser`.
@discussion This method delegates to the Facebook SDK to authenticate
the user, and then automatically links the account to the <PFUser>.
This method delegates to the Facebook SDK to authenticate
the user, and then automatically links the account to the `PFUser`.
It will also save any unsaved changes that were made to the `user`.
@param user User to link to Facebook.
@param permissions Array of publish permissions to use.
@returns The task that will have a `result` set to `@YES` if operation succeeds.
@return The task that will have a `result` set to `@YES` if operation succeeds.
*/
+ (BFTask PF_GENERIC(NSNumber *)*)linkUserInBackground:(PFUser *)user
withPublishPermissions:(NSArray PF_GENERIC(NSString *)*)permissions;
/*!
@abstract *Asynchronously* links Facebook with publish permissions to an existing <PFUser>.
/**
*Asynchronously* links Facebook with publish permissions to an existing `PFUser`.
@discussion This method delegates to the Facebook SDK to authenticate
the user, and then automatically links the account to the <PFUser>.
This method delegates to the Facebook SDK to authenticate
the user, and then automatically links the account to the `PFUser`.
It will also save any unsaved changes that were made to the `user`.
@param user User to link to Facebook.
@ -196,25 +202,25 @@ NS_ASSUME_NONNULL_BEGIN
withPublishPermissions:(NSArray PF_GENERIC(NSString *)*)permissions
block:(nullable PFBooleanResultBlock)block;
/*!
@abstract *Asynchronously* links Facebook Access Token to an existing <PFUser>.
/**
*Asynchronously* links Facebook Access Token to an existing `PFUser`.
@discussion This method delegates to the Facebook SDK to authenticate
the user, and then automatically links the account to the <PFUser>.
This method delegates to the Facebook SDK to authenticate
the user, and then automatically links the account to the `PFUser`.
It will also save any unsaved changes that were made to the `user`.
@param user User to link to Facebook.
@param accessToken An instance of `FBSDKAccessToken` to use.
@returns The task that will have a `result` set to `@YES` if operation succeeds.
@return The task that will have a `result` set to `@YES` if operation succeeds.
*/
+ (BFTask PF_GENERIC(NSNumber *)*)linkUserInBackground:(PFUser *)user withAccessToken:(FBSDKAccessToken *)accessToken;
/*!
@abstract *Asynchronously* links Facebook Access Token to an existing <PFUser>.
/**
*Asynchronously* links Facebook Access Token to an existing `PFUser`.
@discussion This method delegates to the Facebook SDK to authenticate
the user, and then automatically links the account to the <PFUser>.
This method delegates to the Facebook SDK to authenticate
the user, and then automatically links the account to the `PFUser`.
It will also save any unsaved changes that were made to the `user`.
@param user User to link to Facebook.
@ -230,16 +236,16 @@ NS_ASSUME_NONNULL_BEGIN
/// @name Unlinking Users
///--------------------------------------
/*!
@abstract Unlinks the <PFUser> from a Facebook account *asynchronously*.
/**
Unlinks the `PFUser` from a Facebook account *asynchronously*.
@param user User to unlink from Facebook.
@returns The task, that encapsulates the work being done.
@return The task, that encapsulates the work being done.
*/
+ (BFTask PF_GENERIC(NSNumber *)*)unlinkUserInBackground:(PFUser *)user;
/*!
@abstract Unlinks the <PFUser> from a Facebook account *asynchronously*.
/**
Unlinks the `PFUser` from a Facebook account *asynchronously*.
@param user User to unlink from Facebook.
@param block The block to execute.
@ -251,12 +257,12 @@ NS_ASSUME_NONNULL_BEGIN
/// @name Getting Linked State
///--------------------------------------
/*!
@abstract Whether the user has their account linked to Facebook.
/**
Whether the user has their account linked to Facebook.
@param user User to check for a facebook link. The user must be logged in on this device.
@returns `YES` if the user has their account linked to Facebook, otherwise `NO`.
@return `YES` if the user has their account linked to Facebook, otherwise `NO`.
*/
+ (BOOL)isLinkedWithUser:(PFUser *)user;