FBTestUsersManager
คลาสนี้ไม่มีให้ใช้งานใน SDK เวอร์ชั่นล่าสุดอีกต่อไป
เวอร์ชั่นที่ใหม่กว่าของคลาสนี้พร้อมแล้ว ตรวจสอบได้ เวอร์ชั่นล่าสุด

Provides methods for managing test accounts for testing Facebook integration.

Discussion:

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.

Inherits from:NSObject
Declared in:FBTestUsersManager.h
วิธีการคลาส
sharedInstanceForAppId:appSecret:

Construct or return the shared instance

พารามิเตอร์คำอธิบาย
appId

The Facebook app id

appSecret

The Facebook app secret

+ (instancetype)
sharedInstanceForAppId: (NSString *)appId
appSecret: (NSString *)appSecret;
ให้คำรับรองไว้ใน: FBTestUsersManager.h
วิธีการทันใจ
addTestAccountWithPermissions:completionHandler:

Add a test account with the specified permissions

- (void)
addTestAccountWithPermissions: (NSArray *)permissions
completionHandler: (FBTestUsersManagerRetrieveTestAccountTokensHandler)handler;
ให้คำรับรองไว้ใน: FBTestUsersManager.h
removeTestAccount:completionHandler:

Remove a test account for the given user id

- (void)
removeTestAccount: (NSString *)userId
completionHandler: (FBTestUsersManagerRemoveTestAccountHandler)handler;
ให้คำรับรองไว้ใน: FBTestUsersManager.h
requestTestAccountTokensWithArraysOfPermissions:createIfNotFound:completionHandler:

Retrieve FBAccessTokenData instances for test accounts with the specific permissions.

พารามิเตอร์คำอธิบาย
arraysOfPermissions

An array of permissions arrays, such as @[ @[@"email"], @[@"user_birthday"]] if you needed two test accounts with email and birthday permissions, respectively. You can pass in empty nested arrays such as @[ @[], @[] ] if you need two arbitrary test accounts. For convenience, passing nil is treated as @[ @[] ] for fetching a single test user.

createIfNotFound

If YES, new test accounts are created if no test accounts existed that fit the permissions requirement

handler

The 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.

- (void)
requestTestAccountTokensWithArraysOfPermissions: (NSArray *)arraysOfPermissions
createIfNotFound: (BOOL)createIfNotFound
completionHandler: (FBTestUsersManagerRetrieveTestAccountTokensHandler)handler;
Discussion:

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.

ให้คำรับรองไว้ใน: FBTestUsersManager.h
Typedefs
FBTestUsersManagerRemoveTestAccountHandler

Callback block for removing a test user.

typedef void (^FBTestUsersManagerRemoveTestAccountHandler)(
NSError *error);
ให้คำรับรองไว้ใน: FBTestUsersManager.h
FBTestUsersManagerRetrieveTestAccountTokensHandler

Callback block for returning an array of FBAccessTokenData (and possibly NSNull instances); or an error.

typedef void (^FBTestUsersManagerRetrieveTestAccountTokensHandler)(
NSArray *tokens,
NSError *error);
ให้คำรับรองไว้ใน: FBTestUsersManager.h