Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions source/backend/FBConnect.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
*/
@interface FBConnect : NSObject {
NSString* sandbox; // for debugging only
NSString* scheme;

NSString* APIKey;
NSString* appSecret;
Expand All @@ -60,6 +61,7 @@
FBWebViewWindowController* windowController;
}

@property(retain) NSString* scheme;

////////////////////////////////////////////////////////////////////////////////
// Creating an FBConnect instance
Expand Down
24 changes: 14 additions & 10 deletions source/backend/FBConnect.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
#import "NSString+.h"

// end points
#define kRESTServerURL @"http://api.%@facebook.com/restserver.php"
#define kLoginURL @"http://www.%@facebook.com/login.php"
#define kPermissionsURL @"http://www.%@facebook.com/connect/prompt_permissions.php"
#define kLoginFailureURL @"http://www.%@facebook.com/connect/login_failure.html"
#define kLoginSuccessURL @"http://www.%@facebook.com/connect/login_success.html"
#define kRESTServerURL @"%@://api.%@facebook.com/restserver.php"
#define kLoginURL @"%@://www.%@facebook.com/login.php"
#define kPermissionsURL @"%@://www.%@facebook.com/connect/prompt_permissions.php"
#define kLoginFailureURL @"%@://www.%@facebook.com/connect/login_failure.html"
#define kLoginSuccessURL @"%@://www.%@facebook.com/connect/login_success.html"

// session key
#define kSessionKey @"FBUser"
Expand Down Expand Up @@ -90,6 +90,7 @@ - (id)initWithAPIKey:(NSString*)key
delegate = obj;
isLoggedIn = NO;
isConnecting = NO;
scheme = @"https";

requestedPermissions = [[NSMutableSet alloc] init];

Expand All @@ -99,6 +100,7 @@ - (id)initWithAPIKey:(NSString*)key
- (void)dealloc
{
[sandbox release];
[scheme release];

[APIKey release];
[appSecret release];
Expand Down Expand Up @@ -126,24 +128,24 @@ - (void)setSandbox:(NSString*)box {
}

- (NSString*)loginURL {
return [NSString stringWithFormat:kLoginURL, sandbox];
return [NSString stringWithFormat:kLoginURL, scheme, sandbox];
}

- (NSString*)restURL
{
return [NSString stringWithFormat:kRESTServerURL, sandbox];
return [NSString stringWithFormat:kRESTServerURL, scheme, sandbox];
}

- (NSString*)permissionsURL {
return [NSString stringWithFormat:kPermissionsURL, sandbox];
return [NSString stringWithFormat:kPermissionsURL, scheme, sandbox];
}

- (NSString*)loginFailureURL {
return [NSString stringWithFormat:kLoginFailureURL, sandbox];
return [NSString stringWithFormat:kLoginFailureURL, scheme, sandbox];
}

- (NSString*)loginSuccessURL {
return [NSString stringWithFormat:kLoginSuccessURL, sandbox];
return [NSString stringWithFormat:kLoginSuccessURL, scheme, sandbox];
}


Expand All @@ -153,6 +155,8 @@ - (NSString*)loginSuccessURL {
//==============================================================================
//==============================================================================

@synthesize scheme;

- (void)setSecret:(NSString*)secret
{
[secret retain];
Expand Down