Skip to content

Commit 441f7fc

Browse files
joesusfacebook-github-bot
authored andcommitted
Deprecate TestUsersManager
Summary: This type exists to make it easier to work with the Graph API to provide test user accounts. A few reasons to get rid of this: 1. It's shipped as production code but really just exists for setting up integration tests. This is clearly wrong. 2. It's generally not the SDKs job to maintain specific calls to endpoints (outside of a few specific use cases such as login and app events). CoreKit should only implement the specific graph requests that are required to enable a user to form their own graph requests. 3. This is easily implemented by anyone who is currently using it. The internal CoreKit import can be replaced by ``` #import "FBSDKCoreKit_Basics.h" #import "FBSDKCoreKit.h" ``` 4. Graph API usage suggests that barely anyone is using this type. Effectively 0% usage. Reviewed By: KylinChang Differential Revision: D26915949 fbshipit-source-id: 9218d23f04c6008d151a142887fbcf1d0ce48ce5
1 parent 83c8dfe commit 441f7fc

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

FBSDKCoreKit/FBSDKCoreKit/FBSDKTestUsersManager.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ NS_ASSUME_NONNULL_BEGIN
2828
Callback block for returning an array of FBSDKAccessToken instances (and possibly `NSNull` instances); or an error.
2929
*/
3030
typedef void (^FBSDKAccessTokensBlock)(NSArray<FBSDKAccessToken *> *tokens, NSError *_Nullable error)
31-
NS_SWIFT_NAME(AccessTokensBlock);
31+
NS_SWIFT_NAME(AccessTokensBlock)
32+
DEPRECATED_MSG_ATTRIBUTE("AccessTokensBlock is deprecated and will be removed in the next major release");
3233

3334

3435
/**
@@ -44,6 +45,7 @@ NS_SWIFT_NAME(AccessTokensBlock);
4445
an app id and app secret. You will typically use this class to write unit or integration tests.
4546
Make sure you NEVER include your app secret in your production app.
4647
*/
48+
DEPRECATED_MSG_ATTRIBUTE("FBSDKTestUsersManager is deprecated and will be removed in the next major release")
4749
NS_SWIFT_NAME(TestUsersManager)
4850
@interface FBSDKTestUsersManager : NSObject
4951

FBSDKCoreKit/FBSDKCoreKit/FBSDKTestUsersManager.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020

2121
#import "FBSDKCoreKit+Internal.h"
2222

23+
#pragma clang diagnostic push
24+
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
25+
#pragma clang diagnostic ignored "-Wdeprecated-implementations"
26+
2327
static NSString *const kFBGraphAPITestUsersPathFormat = @"%@/accounts/test-users";
2428
static NSString *const kAccountsDictionaryTokenKey = @"access_token";
2529
static NSString *const kAccountsDictionaryPermissionsKey = @"permissions";
@@ -336,3 +340,5 @@ - (void)fetchExistingTestAccountsWithAfterCursor:(NSString *)after handler:(FBSD
336340
}
337341

338342
@end
343+
344+
#pragma clang diagnostic pop

0 commit comments

Comments
 (0)