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

Commit 55a0661

Browse files
committed
Fix warnings when using deprecated FBSDK API.
1 parent cb282c9 commit 55a0661

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

ParseFacebookUtils/Internal/PFFacebookAuthenticationProvider.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ - (BFTask *)authenticateAsync {
114114
}
115115
}
116116
[self.session openWithBehavior:behavior
117+
fromViewController:nil
117118
completionHandler:^(FBSession *callingSession, FBSessionState status, NSError *openError) {
118119
if (called) {
119120
if ((status & FBSessionStateOpenTokenExtended) == FBSessionStateOpenTokenExtended &&
@@ -235,6 +236,7 @@ - (BOOL)restoreAuthenticationWithAuthData:(nullable NSDictionary<NSString *, NSS
235236

236237
if (rawSession.state == FBSessionStateCreatedTokenLoaded) {
237238
[rawSession openWithBehavior:FBSessionLoginBehaviorWithNoFallbackToWebView
239+
fromViewController:nil
238240
completionHandler:^(FBSession *callingSession, FBSessionState status, NSError *error) {
239241
if (!called) {
240242
if (callingSession.isOpen && self.currentOperationId == scopedOperationId) {

Tests/Unit/FacebookAuthenticationProviderTests.m

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,13 @@ - (void)testAuthenticateSuccess {
9393

9494
OCMStub([mockedSession valueForKey:@"self"]).andReturnWeak(mockedSession);
9595
OCMStub([[mockedSession ignoringNonObjectArgs] openWithBehavior:0
96+
fromViewController:nil
9697
completionHandler:OCMOCK_ANY]).andDo(^(NSInvocation *invocation) {
9798
__unsafe_unretained FBSession *theSession = nil;
9899
__unsafe_unretained FBSessionStateHandler handler = nil;
99100

100101
[invocation getArgument:&theSession atIndex:0];
101-
[invocation getArgument:&handler atIndex:3];
102+
[invocation getArgument:&handler atIndex:4];
102103

103104
[provider.tokenCache setAccessToken:@"token"];
104105
[provider.tokenCache setExpirationDate:[NSDate dateWithTimeIntervalSince1970:1337]];
@@ -162,12 +163,13 @@ - (void)testAuthenticateIncompleteCachedSession {
162163

163164
OCMStub([mockedSession valueForKey:@"self"]).andReturnWeak(mockedSession);
164165
OCMStub([[mockedSession ignoringNonObjectArgs] openWithBehavior:0
166+
fromViewController:nil
165167
completionHandler:OCMOCK_ANY]).andDo(^(NSInvocation *invocation) {
166168
__unsafe_unretained FBSession *theSession = nil;
167169
__unsafe_unretained FBSessionStateHandler handler = nil;
168170

169171
[invocation getArgument:&theSession atIndex:0];
170-
[invocation getArgument:&handler atIndex:3];
172+
[invocation getArgument:&handler atIndex:4];
171173

172174
[provider.tokenCache setAccessToken:@"token"];
173175
[provider.tokenCache setExpirationDate:[NSDate dateWithTimeIntervalSince1970:1337]];
@@ -238,12 +240,13 @@ - (void)testTokenExtension {
238240

239241
OCMStub([mockedSession valueForKey:@"self"]).andReturnWeak(mockedSession);
240242
OCMStub([[mockedSession ignoringNonObjectArgs] openWithBehavior:0
243+
fromViewController:nil
241244
completionHandler:OCMOCK_ANY]).andDo(^(NSInvocation *invocation) {
242245
__unsafe_unretained FBSession *theSession = nil;
243246
__unsafe_unretained FBSessionStateHandler handler = nil;
244247

245248
[invocation getArgument:&theSession atIndex:0];
246-
[invocation getArgument:&handler atIndex:3];
249+
[invocation getArgument:&handler atIndex:4];
247250

248251
[provider.tokenCache setAccessToken:@"token"];
249252
[provider.tokenCache setExpirationDate:[NSDate dateWithTimeIntervalSince1970:1337]];

0 commit comments

Comments
 (0)