Skip to content

Commit

Permalink
Rolling up a few pull requests -- thanks!
Browse files Browse the repository at this point in the history
Summary:
This diff rolls-up the following pull request -
  * 449      - SevaUA
  * 446, 445 - adamvduke
  * 435      - deyton

Test Plan: manual, used hackbook to exercise impacted code

Reviewers: yariv, mmarucheck, vijaye, caabernathy

Reviewed By: vijaye

CC: gregschechte, selekman

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

Task ID: 1021338, 981999
  • Loading branch information
onebit committed Apr 12, 2012
1 parent 0fb2954 commit 5077944
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 10 deletions.
7 changes: 6 additions & 1 deletion src/FBDialog.m
Expand Up @@ -500,7 +500,12 @@ - (void)webViewDidFinishLoad:(UIWebView *)webView {

- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error {
// 102 == WebKitErrorFrameLoadInterruptedByPolicyChange
if (!([error.domain isEqualToString:@"WebKitErrorDomain"] && error.code == 102)) {
// -999 == "Operation could not be completed", note -999 occurs when the user clicks away before
// the page has completely loaded, if we find cases where we want this to result in dialog failure
// (usually this just means quick-user), then we should add something more robust here to account
// for differences in application needs
if (!(([error.domain isEqualToString:@"NSURLErrorDomain"] && error.code == -999) ||
([error.domain isEqualToString:@"WebKitErrorDomain"] && error.code == 102))) {
[self dismissWithError:error animated:YES];
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/Facebook.h
Expand Up @@ -16,8 +16,8 @@

#import "FBLoginDialog.h"
#import "FBRequest.h"
#import "FBFrictionlessRequestSettings.h"

@class FBFrictionlessRequestSettings;
@protocol FBSessionDelegate;

/**
Expand All @@ -36,7 +36,7 @@
NSString* _appId;
NSString* _urlSchemeSuffix;
NSArray* _permissions;
BOOL _isExtendingAccessToken;
FBRequest *_requestExtendingAccessToken;
NSDate* _lastAccessTokenUpdate;
FBFrictionlessRequestSettings* _frictionlessRequestSettings;
}
Expand Down
12 changes: 7 additions & 5 deletions src/Facebook.m
Expand Up @@ -15,6 +15,7 @@
*/

#import "Facebook.h"
#import "FBFrictionlessRequestSettings.h"
#import "FBLoginDialog.h"
#import "FBRequest.h"
#import "JSON.h"
Expand Down Expand Up @@ -116,6 +117,8 @@ - (id)initWithAppId:(NSString *)appId
* Override NSObject : free the space
*/
- (void)dealloc {
// this is the one case where the delegate is this object
_requestExtendingAccessToken.delegate = nil;
for (FBRequest* _request in _requests) {
[_request removeObserver:self forKeyPath:requestFinishedKeyPath];
}
Expand Down Expand Up @@ -344,14 +347,13 @@ - (void)authorize:(NSArray *)permissions {
* applicationDidBecomeActive: UIApplicationDelegate method.
*/
- (void)extendAccessToken {
if (_isExtendingAccessToken) {
if (_requestExtendingAccessToken) {
return;
}
_isExtendingAccessToken = YES;
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"auth.extendSSOAccessToken", @"method",
nil];
[self requestWithParams:params andDelegate:self];
_requestExtendingAccessToken = [self requestWithParams:params andDelegate:self];
}

/**
Expand Down Expand Up @@ -803,11 +805,11 @@ - (void)fbDialogNotLogin:(BOOL)cancelled {
// These delegate methods are only called for requests that extendAccessToken initiated

- (void)request:(FBRequest *)request didFailWithError:(NSError *)error {
_isExtendingAccessToken = NO;
_requestExtendingAccessToken = nil;
}

- (void)request:(FBRequest *)request didLoad:(id)result {
_isExtendingAccessToken = NO;
_requestExtendingAccessToken = nil;
NSString* accessToken = [result objectForKey:@"access_token"];
NSString* expTime = [result objectForKey:@"expires_at"];

Expand Down
10 changes: 8 additions & 2 deletions src/facebook-ios-sdk.xcodeproj/project.pbxproj
Expand Up @@ -248,7 +248,10 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
ARCHS = (
"$(ARCHS_STANDARD_32_BIT)",
armv6,
);
COPY_PHASE_STRIP = NO;
DSTROOT = /tmp/facebook_ios_sdk.dst;
GCC_DYNAMIC_NO_PIC = NO;
Expand All @@ -268,7 +271,10 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
ARCHS = (
"$(ARCHS_STANDARD_32_BIT)",
armv6,
);
DSTROOT = /tmp/facebook_ios_sdk.dst;
GCC_MODEL_TUNING = G5;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
Expand Down

0 comments on commit 5077944

Please sign in to comment.