LuxChat  2.0
Instant messenger for iOS
List of all members
PFFacebookUtils Class Reference

#import <PFFacebookUtils.h>

Inheritance diagram for PFFacebookUtils:

Class Methods

Interacting With Facebook


(void) + initializeFacebookWithApplicationLaunchOptions:
 
Logging In


(BFTask< PFUser * > *) + logInInBackgroundWithReadPermissions:
 
(void) + logInInBackgroundWithReadPermissions:block:
 
(BFTask< PFUser * > *) + logInInBackgroundWithPublishPermissions:
 
(void) + logInInBackgroundWithPublishPermissions:block:
 
(BFTask< PFUser * > *) + logInInBackgroundWithAccessToken:
 
(void) + logInInBackgroundWithAccessToken:block:
 
Linking Users


(BFTask< NSNumber * > *) + linkUserInBackground:withReadPermissions:
 
(void) + linkUserInBackground:withReadPermissions:block:
 
(BFTask< NSNumber * > *) + linkUserInBackground:withPublishPermissions:
 
(void) + linkUserInBackground:withPublishPermissions:block:
 
(BFTask< NSNumber * > *) + linkUserInBackground:withAccessToken:
 
(void) + linkUserInBackground:withAccessToken:block:
 
Unlinking Users


(BFTask< NSNumber * > *) + unlinkUserInBackground:
 
(void) + unlinkUserInBackground:block:
 
Getting Linked State


(BOOL) + isLinkedWithUser:
 

Detailed Description

Copyright (c) 2015-present, Parse, LLC. All rights reserved.

This source code is licensed under the BSD-style license found in the LICENSE file in the root directory of this source tree. An additional grant of patent rights can be found in the PATENTS file in the same directory. The PFFacebookUtils class provides utility functions for using Facebook authentication with PFUsers.

Warning
This class supports official Facebook iOS SDK v4.0+ and is available only on iOS.

Method Documentation

+ (void) initializeFacebookWithApplicationLaunchOptions: (nullable NSDictionary *)  launchOptions

Initializes Parse Facebook Utils.

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.
Parameters
launchOptionsThe launchOptions as passed to [UIApplicationDelegate application:didFinishLaunchingWithOptions:].
+ (BOOL) isLinkedWithUser: (PFUser *)  user

Whether the user has their account linked to Facebook.

Parameters
userUser 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.
+ (BFTask<NSNumber *> *) linkUserInBackground: (PFUser *)  user
withAccessToken: (FBSDKAccessToken *)  accessToken 

Asynchronously* links Facebook Access Token to an existing 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.

Parameters
userUser to link to Facebook.
accessTokenAn instance of FBSDKAccessToken to use.
Returns
The task that will have a result set to @YES if operation succeeds.
+ (void) linkUserInBackground: (PFUser *)  user
withAccessToken: (FBSDKAccessToken *)  accessToken
block: (nullable PFBooleanResultBlock)  block 

Asynchronously* links Facebook Access Token to an existing 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.

Parameters
userUser to link to Facebook.
accessTokenAn instance of FBSDKAccessToken to use.
blockThe block to execute when the linking completes. It should have the following signature: ^(BOOL succeeded, NSError *error).
+ (BFTask<NSNumber *> *) linkUserInBackground: (PFUser *)  user
withPublishPermissions: (NSArray< NSString * > *)  permissions 

Asynchronously* links Facebook with publish permissions to an existing 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.

Parameters
userUser to link to Facebook.
permissionsArray of publish permissions to use.
Returns
The task that will have a result set to @YES if operation succeeds.
+ (void) linkUserInBackground: (PFUser *)  user
withPublishPermissions: (NSArray< NSString * > *)  permissions
block: (nullable PFBooleanResultBlock)  block 

Asynchronously* links Facebook with publish permissions to an existing 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.

Parameters
userUser to link to Facebook.
permissionsArray of publish permissions to use.
blockThe block to execute when the linking completes. It should have the following signature: ^(BOOL succeeded, NSError *error).
+ (BFTask<NSNumber *> *) linkUserInBackground: (PFUser *)  user
withReadPermissions: (nullable NSArray< NSString * > *)  permissions 

Asynchronously* links Facebook with read permissions to an existing 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.

Parameters
userUser to link to Facebook.
permissionsArray of read permissions to use when logging in with Facebook.
Returns
The task that will have a result set to @YES if operation succeeds.
+ (void) linkUserInBackground: (PFUser *)  user
withReadPermissions: (nullable NSArray< NSString * > *)  permissions
block: (nullable PFBooleanResultBlock)  block 

Asynchronously* links Facebook with read permissions to an existing 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.

Parameters
userUser to link to Facebook.
permissionsArray of read permissions to use.
blockThe block to execute when the linking completes. It should have the following signature: ^(BOOL succeeded, NSError *error).
+ (BFTask<PFUser *> *) logInInBackgroundWithAccessToken: (FBSDKAccessToken *)  accessToken

Asynchronously* logs in a user using given Facebook Acess Token.

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.

Parameters
accessTokenAn instance of FBSDKAccessToken to use when logging in.
Returns
The task that has will a have result set to PFUser if operation succeeds.
+ (void) logInInBackgroundWithAccessToken: (FBSDKAccessToken *)  accessToken
block: (nullable PFUserResultBlock)  block 

Asynchronously* logs in a user using given Facebook Acess Token.

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.

Parameters
accessTokenAn instance of FBSDKAccessToken to use when logging in.
blockThe block to execute when the log in completes. It should have the following signature: ^(PFUser *user, NSError *error).
+ (BFTask<PFUser *> *) logInInBackgroundWithPublishPermissions: (nullable NSArray< NSString * > *)  permissions

Asynchronously* logs in a user using Facebook with publish permissions.

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.

Parameters
permissionsArray of publish permissions to use.
Returns
The task that has will a have result set to PFUser if operation succeeds.
+ (void) logInInBackgroundWithPublishPermissions: (nullable NSArray< NSString * > *)  permissions
block: (nullable PFUserResultBlock)  block 

Asynchronously* logs in a user using Facebook with publish permissions.

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.

Parameters
permissionsArray of publish permissions to use.
blockThe block to execute when the log in completes. It should have the following signature: ^(PFUser *user, NSError *error).
+ (BFTask<PFUser *> *) logInInBackgroundWithReadPermissions: (nullable NSArray< NSString * > *)  permissions

Asynchronously* logs in a user using Facebook with read permissions.

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.

Parameters
permissionsArray of read permissions to use.
Returns
The task that has will a have result set to PFUser if operation succeeds.
+ (void) logInInBackgroundWithReadPermissions: (nullable NSArray< NSString * > *)  permissions
block: (nullable PFUserResultBlock)  block 

Asynchronously* logs in a user using Facebook with read permissions.

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.

Parameters
permissionsArray of read permissions to use.
blockThe block to execute when the log in completes. It should have the following signature: ^(PFUser *user, NSError *error).
+ (BFTask<NSNumber *> *) unlinkUserInBackground: (PFUser *)  user

Unlinks the PFUser from a Facebook account asynchronously.

Parameters
userUser to unlink from Facebook.
Returns
The task, that encapsulates the work being done.
+ (void) unlinkUserInBackground: (PFUser *)  user
block: (nullable PFBooleanResultBlock)  block 

Unlinks the PFUser from a Facebook account asynchronously.

Parameters
userUser to unlink from Facebook.
blockThe block to execute. It should have the following argument signature: ^(BOOL succeeded, NSError *error).

The documentation for this class was generated from the following file: