Skip to content
This repository was archived by the owner on Jan 16, 2021. It is now read-only.

Commit 9a06491

Browse files
committed
Fix usage of deprecated Bolts APIs.
1 parent bc6e1c0 commit 9a06491

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

ParseFacebookUtils/Internal/AuthenticationProvider/iOS/PFFacebookMobileAuthenticationProvider.m

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,11 @@ - (instancetype)initWithApplication:(UIApplication *)application
4646
publishPermissions:(nullable NSArray<NSString *> *)publishPermissions
4747
fromViewComtroller:(UIViewController *)viewController {
4848
if (readPermissions && publishPermissions) {
49-
NSException *exception = [NSException exceptionWithName:NSInvalidArgumentException
50-
reason:@"Read permissions are not permitted to be requested with publish permissions."
51-
userInfo:nil];
52-
return [BFTask taskWithException:exception];
49+
NSString *description = @"Read permissions are not permitted to be requested with publish permissions.";
50+
NSError *error = [NSError errorWithDomain:PFParseErrorDomain
51+
code:kPFErrorFacebookInvalidSession
52+
userInfo:@{ NSLocalizedDescriptionKey: description }];
53+
return [BFTask taskWithError:error];
5354
}
5455

5556
BFTaskCompletionSource *taskCompletionSource = [BFTaskCompletionSource taskCompletionSource];

ParseFacebookUtils/Internal/PFFacebookPrivateUtilities.m

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,7 @@ - (instancetype)pffb_continueWithMainThreadBooleanBlock:(PFBooleanResultBlock)bl
8484
}
8585

8686
- (instancetype)pffb_continueWithMainThreadBlock:(BFContinuationBlock)block {
87-
return [self continueWithExecutor:[BFExecutor mainThreadExecutor] withBlock:^id(BFTask *task) {
88-
if (task.exception) {
89-
@throw task.exception;
90-
}
91-
return block(task);
92-
}];
87+
return [self continueWithExecutor:[BFExecutor mainThreadExecutor] withBlock:block];
9388
}
9489

9590
@end

Tests/Unit/FacebookAuthenticationProviderTests.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ - (void)testAuthenticateBoth {
115115

116116
XCTestExpectation *expectation = [self currentSelectorTestExpectation];
117117
[[provider authenticateAsyncWithReadPermissions:@[ @"read" ] publishPermissions:@[ @"publish" ]] continueWithBlock:^id(BFTask *task) {
118-
XCTAssertEqualObjects(task.exception.name, NSInvalidArgumentException);
118+
XCTAssertNotNil(task.error);
119119
[expectation fulfill];
120120
return nil;
121121
}];

0 commit comments

Comments
 (0)