Skip to content
This repository
Browse code

Fixes breaking change introduced by (e79d072)

Summary:
The problem is that e79d072 fixes odd behavior in Hackbook,
which had support in the SDK code’s logout function. Prior to e79d072
Hackbook was more convoluted, and the logout behavior broke
encapsulation. The solution is to put back a deprecated logout method that
matches the original signature, and keeps most of the original behavior
(though it does not break encapsulation, which was badness.)

Test Plan:
Manually modify Hackbook, and whitebox test each of the following
permutations:
* login with no delegate (call the cached delegate)
* login with a delegate matching the cached delegate (call the cached delegate)
* login with a delegate different from the cached delegate (call both)

Reviewers: yariv, caabernathy, mmarucheck, vijaye

Reviewed By: yariv

Differential Revision: https://phabricator.fb.com/D405235

Task ID: 905137
  • Loading branch information...
commit 8ed244aaf689d3f4fe843e3129b26e2a87895278 1 parent daed6b2
Jason Clark authored February 08, 2012
3  .gitignore
@@ -20,3 +20,6 @@ test/UnitTest/build/
20 20
 *~
21 21
 *#
22 22
 .arcconfig
  23
+.DS_Store
  24
+project.xcworkspace
  25
+xcuserdata
2  src/Facebook.h
@@ -63,6 +63,8 @@
63 63
 
64 64
 - (void)logout;
65 65
 
  66
+- (void)logout:(id<FBSessionDelegate>)delegate;
  67
+
66 68
 - (FBRequest*)requestWithParams:(NSMutableDictionary *)params
67 69
                     andDelegate:(id <FBRequestDelegate>)delegate;
68 70
 
16  src/Facebook.m
@@ -473,6 +473,22 @@ - (void)logout {
473 473
 }
474 474
 
475 475
 /**
  476
+ * Invalidate the current user session by removing the access token in
  477
+ * memory and clearing the browser cookie.
  478
+ *
  479
+ * @deprecated Use of a single session delegate, set at app init, is preferred
  480
+ */
  481
+- (void)logout:(id<FBSessionDelegate>)delegate {
  482
+  [self logout];
  483
+  // preserve deprecated callback behavior, but leave cached delegate intact
  484
+  // avoid calling twice if the passed and cached delegates are the same
  485
+  if (delegate != self.sessionDelegate &&
  486
+    [delegate respondsToSelector:@selector(fbDidLogout)]) {
  487
+    [delegate fbDidLogout];
  488
+  }
  489
+}
  490
+
  491
+/**
476 492
  * Make a request to Facebook's REST API with the given
477 493
  * parameters. One of the parameter keys must be "method" and its value
478 494
  * should be a valid REST server API method.

1 note on commit 8ed244a

marv1n

Hey guys, I have a problem with the actuallty Sample Project:

I can't post any photos or videos to my Facebook Page! Add a News Feed to my wall is working great.

What's wrong ?

Thanks and best regards!

Please sign in to comment.
Something went wrong with that request. Please try again.