Permalink
Browse files

Facebook iOS SDK 3.11.1

Summary:
    see https://developers.facebook.com/ios/change-log-3.x/

Upgrading:
    https://developers.facebook.com/docs/ios/upgrading/

Reviewed By: jacl

Test Plan: Release Testing.
  • Loading branch information...
1 parent 3c38d5d commit 283b0d0dd5cde6fd6abef87c028df93bc11fe5df @toddkrabach toddkrabach committed Jan 17, 2014
@@ -45,7 +45,7 @@ rm -rf $DOCSET
hash $APPLEDOC &>/dev/null
if [ "$?" -eq "0" ]; then
- APPLEDOC_DOCSET_NAME="Facebook SDK 3.11 for iOS"
+ APPLEDOC_DOCSET_NAME="Facebook SDK 3.11.1 for iOS"
$APPLEDOC --project-name "$APPLEDOC_DOCSET_NAME" \
--project-company "Facebook" \
--company-id "com.facebook" \
@@ -12,7 +12,7 @@
<pkg-ref id="com.facebook.sdk.pkg"/>
</choice>
- <title>Facebook SDK 3.11 for iOS</title>
+ <title>Facebook SDK 3.11.1 for iOS</title>
<conclusion file="README.txt" mime-type="text/plain" />
<readme file="README.txt" mime-type="text/plain" />
<domains enable_currentUserHome="true" />
@@ -1234,11 +1234,11 @@ - (void)completeWithResults:(NSArray *)results
} queue:dispatch_get_main_queue()];
taskWork = [taskWork completionTaskWithQueue:dispatch_get_main_queue() block:^id(FBTask *task) {
- if (task.result == ACAccountCredentialRenewResultRenewed) {
+ if ([@(ACAccountCredentialRenewResultRenewed) isEqual:task.result]) {
FBTask *requestAccessTask = [systemAccountStoreAdapter requestAccessToFacebookAccountStoreAsTask:metadata.request.session];
return [requestAccessTask completionTaskWithQueue:dispatch_get_main_queue() block:^id(FBTask *task) {
- if (task.result) { // aka success means task.result == (oauthToken)
- [metadata.request.session refreshAccessToken:task.result expirationDate:[NSDate distantFuture]];
+ if (task.result && [task.result isKindOfClass:[NSString class]]) { // aka success means task.result == (oauthToken)
+ [metadata.request.session refreshAccessToken:(NSString *)task.result expirationDate:[NSDate distantFuture]];
[metadata invokeCompletionHandlerForConnection:self
withResults:body
error:[FBErrorUtility fberrorForRetry:unpackedError]];
@@ -32,13 +32,6 @@ typedef void (^FBRequestAccessToAccountsHandler)(NSString* oauthToken, NSError *
@interface FBSystemAccountStoreAdapter : NSObject
/*
- @abstract A convenience overload to default various parameters based on the provided session,
- typically only for requesting a new token for the provided session.
-*/
-- (void)requestAccessToFacebookAccountStore:(FBSession *)session
- handler:(FBRequestAccessToAccountsHandler)handler;
-
-/*
@abstract
Requests access to the device's Facebook account for the given parameters.
@param permissions the permissions
@@ -106,8 +106,13 @@ - (BOOL) canRequestAccessWithoutUI {
#pragma mark - Public properties and methods
- (FBTask *)requestAccessToFacebookAccountStoreAsTask:(FBSession *)session {
- FBTaskCompletionSource* tcs = [FBTaskCompletionSource taskCompletionSource];
- [self requestAccessToFacebookAccountStore:session handler:^(NSString *oauthToken, NSError *accountStoreError) {
+ FBTaskCompletionSource *tcs = [FBTaskCompletionSource taskCompletionSource];
+ [self requestAccessToFacebookAccountStore:nil
+ defaultAudience:session.lastRequestedSystemAudience
+ isReauthorize:NO
+ appID:session.appID
+ session:session
+ handler:^(NSString *oauthToken, NSError *accountStoreError) {
if (accountStoreError) {
[tcs setError:accountStoreError];
} else {
@@ -117,17 +122,6 @@ - (FBTask *)requestAccessToFacebookAccountStoreAsTask:(FBSession *)session {
return tcs.task;
}
-
-- (void)requestAccessToFacebookAccountStore:(FBSession *)session
- handler:(FBRequestAccessToAccountsHandler)handler {
- return [self requestAccessToFacebookAccountStore:session.accessTokenData.permissions
- defaultAudience:session.lastRequestedSystemAudience
- isReauthorize:NO
- appID:session.appID
- session:session
- handler:handler];
-}
-
- (void)requestAccessToFacebookAccountStore:(NSArray *)permissions
defaultAudience:(FBSessionDefaultAudience)defaultAudience
isReauthorize:(BOOL)isReauthorize
@@ -312,7 +306,7 @@ - (FBTask *)renewSystemAuthorizationAsTask {
if (error) {
[tcs setError:error];
} else {
- [tcs setResult:result];
+ [tcs setResult:@(result)];
}
}];
return tcs.task;
View
@@ -26,7 +26,7 @@
/*!
Creates a task that is already completed with the given result.
*/
-+ (FBTask *)taskWithResult:(id)result;
++ (FBTask *)taskWithResult:(id<NSObject>)result;
/*!
Creates a task that is already completed with the given error.
@@ -61,7 +61,7 @@
/*!
The result of a successful task.
*/
-- (id)result;
+- (id<NSObject>)result;
/*!
The error of a failed task.
View
@@ -26,7 +26,7 @@
}
@interface FBTask () {
- id _result;
+ id<NSObject> _result;
NSError *_error;
NSException *_exception;
BOOL _cancelled;
@@ -53,11 +53,14 @@ - (void)dealloc {
[_lock release];
[_condition release];
[_callbacks release];
+ [_result release];
+ [_error release];
+ [_exception release];
[super dealloc];
}
-+ (FBTask *)taskWithResult:(id)result {
++ (FBTask *)taskWithResult:(id<NSObject>)result {
FBTaskCompletionSource *tcs = [FBTaskCompletionSource taskCompletionSource];
tcs.result = result;
return tcs.task;
@@ -107,26 +110,26 @@ + (FBTask *)taskWithDelay:(dispatch_time_t)delay {
return tcs.task;
}
-- (id)result {
+- (id<NSObject>)result {
@synchronized (self.lock) {
return _result;
}
}
-- (void)setResult:(id)result {
+- (void)setResult:(id<NSObject>)result {
if (![self trySetResult:result]) {
[NSException raise:NSInternalInconsistencyException
format:@"Cannot set the result on a completed task."];
}
}
-- (BOOL)trySetResult:(id)result {
+- (BOOL)trySetResult:(id<NSObject>)result {
@synchronized (self.lock) {
if (self.completed) {
return NO;
}
self.completed = YES;
- _result = result;
+ _result = [result retain];
[self runContinuations];
return YES;
}
@@ -151,7 +154,7 @@ - (BOOL)trySetError:(NSError *)error {
return NO;
}
self.completed = YES;
- _error = error;
+ _error = [error retain];
[self runContinuations];
return YES;
}
@@ -176,7 +179,7 @@ - (BOOL)trySetException:(NSException *)exception {
return NO;
}
self.completed = YES;
- _exception = exception;
+ _exception = [exception retain];
[self runContinuations];
return YES;
}
@@ -38,7 +38,7 @@
Completes the task by setting the result.
Attempting to set this for a completed task will raise an exception.
*/
-- (void)setResult:(id)result;
+- (void)setResult:(id<NSObject>)result;
/*!
Completes the task by setting the error.
@@ -62,7 +62,7 @@
Sets the result of the task if it wasn't already completed.
@returns whether the new value was set.
*/
-- (BOOL)trySetResult:(id)result;
+- (BOOL)trySetResult:(id<NSObject>)result;
/*!
Sets the error of the task if it wasn't already completed.
@@ -23,11 +23,11 @@ @interface FBTaskCompletionSource ()
@end
@interface FBTask (FBTaskCompletionSource)
-- (void)setResult:(id)result;
+- (void)setResult:(id<NSObject>)result;
- (void)setError:(NSError *)error;
- (void)setException:(NSException *)exception;
- (void)cancel;
-- (BOOL)trySetResult:(id)result;
+- (BOOL)trySetResult:(id<NSObject>)result;
- (BOOL)trySetError:(NSError *)error;
- (BOOL)trySetException:(NSException *)exception;
- (BOOL)trySetCancelled;
@@ -52,7 +52,7 @@ - (void)dealloc {
[super dealloc];
}
-- (void)setResult:(id)result {
+- (void)setResult:(id<NSObject>)result {
[self.task setResult:result];
}
@@ -68,7 +68,7 @@ - (void)cancel {
[self.task cancel];
}
-- (BOOL)trySetResult:(id)result {
+- (BOOL)trySetResult:(id<NSObject>)result {
return [self.task trySetResult:result];
}
View
@@ -135,5 +135,5 @@
*/
-#define FB_IOS_SDK_VERSION_STRING @"3.11.0"
+#define FB_IOS_SDK_VERSION_STRING @"3.11.1"
Oops, something went wrong.

0 comments on commit 283b0d0

Please sign in to comment.