LuxChat  2.0
Instant messenger for iOS
Instance Methods | Class Methods | List of all members
FBSDKTestUsersManager Class Reference

#import <FBSDKTestUsersManager.h>

Inheritance diagram for FBSDKTestUsersManager:

Instance Methods

(void) - requestTestAccountTokensWithArraysOfPermissions:createIfNotFound:completionHandler:
 
(void) - addTestAccountWithPermissions:completionHandler:
 
(void) - removeTestAccount:completionHandler:
 
(void) - makeFriendsWithFirst:second:callback:
 

Class Methods

(instancetype) + sharedInstanceForAppID:appSecret:
 

Detailed Description

Provides methods for managing test accounts for testing Facebook integration.

Facebook allows developers to create test accounts for testing their applications' Facebook integration (see https://developers.facebook.com/docs/test_users/). This class simplifies use of these accounts for writing tests. It is not designed for use in production application code.

This class will make Graph API calls on behalf of your app to manage test accounts and requires an app id and app secret. You will typically use this class to write unit or integration tests. Make sure you NEVER include your app secret in your production app.

Method Documentation

- (void) addTestAccountWithPermissions: (NSSet *)  permissions
completionHandler: (FBSDKTestUsersManagerRetrieveTestAccountTokensHandler)  handler 

add a test account with the specified permissions

Parameters
permissionsthe set of permissions, e.g., [NSSet setWithObjects:"email", @"user_friends"]
handlerthe callback handler
- (void) makeFriendsWithFirst: (FBSDKAccessToken *)  first
second: (FBSDKAccessToken *)  second
callback: (void(^)(NSError *))  callback 

Make two test users friends with each other.

Parameters
firstthe token of the first user
secondthe token of the second user
callbackthe callback handler
- (void) removeTestAccount: (NSString *)  userId
completionHandler: (FBSDKTestUsersManagerRemoveTestAccountHandler)  handler 

remove a test account for the given user id

Parameters
userIdthe user id
handlerthe callback handler
- (void) requestTestAccountTokensWithArraysOfPermissions: (NSArray *)  arraysOfPermissions
createIfNotFound: (BOOL)  createIfNotFound
completionHandler: (FBSDKTestUsersManagerRetrieveTestAccountTokensHandler)  handler 

retrieve FBSDKAccessToken instances for test accounts with the specific permissions.

Parameters
arraysOfPermissionsan array of permissions sets, such as @[ [NSSet setWithObject:"email"], [NSSet setWithObject:@"user_birthday"]] if you needed two test accounts with email and birthday permissions, respectively. You can pass in empty nested sets if you need two arbitrary test accounts. For convenience, passing nil is treated as @[ [NSSet set] ] for fetching a single test user.
createIfNotFoundif YES, new test accounts are created if no test accounts existed that fit the permissions requirement
handlerthe callback to invoke which will return an array of FBAccessTokenData instances or an NSError. If param createIfNotFound is NO, the array may contain [NSNull null] instances.

If you are requesting test accounts with differing number of permissions, try to order arrayOfPermissionsArrays so that the most number of permissions come first to minimize creation of new test accounts.

+ (instancetype) sharedInstanceForAppID: (NSString *)  appID
appSecret: (NSString *)  appSecret 

construct or return the shared instance

Parameters
appIDthe Facebook app id
appSecretthe Facebook app secret

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