Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

rename localAppId to urlSchemeSuffix

Summary: urlSchemeSuffix is more descriptive and easier to grok than
localAppId.

Warning: This changes breaks compatibility with the previous version of the SDK. Please update your code to use the latest method signature.

Test Plan: compiled and ran the demo app with a urlSchemeSuffix configured

Reviewers: brent, lshepard, teck

Reviewed By: lshepard

CC: brent, lshepard

Differential Revision: 334704

Task ID: 737701
  • Loading branch information...
commit 22f88dc6acf1aa935a602f62d00226058b648fcd 1 parent f6755fe
@yariv yariv authored
Showing with 19 additions and 19 deletions.
  1. +3 −3 src/Facebook.h
  2. +16 −16 src/Facebook.m
View
6 src/Facebook.h
@@ -33,14 +33,14 @@
FBDialog* _loginDialog;
FBDialog* _fbDialog;
NSString* _appId;
- NSString* _localAppId;
+ NSString* _urlSchemeSuffix;
NSArray* _permissions;
}
@property(nonatomic, copy) NSString* accessToken;
@property(nonatomic, copy) NSDate* expirationDate;
@property(nonatomic, assign) id<FBSessionDelegate> sessionDelegate;
-@property(nonatomic, copy) NSString* localAppId;
+@property(nonatomic, copy) NSString* urlSchemeSuffix;
- (id)initWithAppId:(NSString *)appId
andDelegate:(id<FBSessionDelegate>)delegate;
@@ -48,7 +48,7 @@
- (void)authorize:(NSArray *)permissions;
- (void)authorize:(NSArray *)permissions
- localAppId:(NSString *)localAppId;
+ urlSchemeSuffix:(NSString *)urlSchemeSuffix;
- (BOOL)handleOpenURL:(NSURL *)url;
View
32 src/Facebook.m
@@ -47,7 +47,7 @@ @implementation Facebook
expirationDate = _expirationDate,
sessionDelegate = _sessionDelegate,
permissions = _permissions,
- localAppId = _localAppId;
+ urlSchemeSuffix = _urlSchemeSuffix;
///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -79,7 +79,7 @@ - (void)dealloc {
[_fbDialog release];
[_appId release];
[_permissions release];
- [_localAppId release];
+ [_urlSchemeSuffix release];
[super dealloc];
}
@@ -123,7 +123,7 @@ - (FBRequest*)openUrl:(NSString *)url
- (NSString *)getOwnBaseUrl {
return [NSString stringWithFormat:@"fb%@%@://authorize",
_appId,
- _localAppId ? _localAppId : @""];
+ _urlSchemeSuffix ? _urlSchemeSuffix : @""];
}
/**
@@ -136,7 +136,7 @@ - (void)authorizeWithFBAppAuth:(BOOL)tryFBAppAuth
@"user_agent", @"type",
kRedirectURL, @"redirect_uri",
@"touch", @"display",
- kSDKVersion, @"sdk",
+ kSDK, @"sdk",
nil];
NSString *loginDialogURL = [kDialogBaseURL stringByAppendingString:kLogin];
@@ -146,8 +146,8 @@ - (void)authorizeWithFBAppAuth:(BOOL)tryFBAppAuth
[params setValue:scope forKey:@"scope"];
}
- if (_localAppId) {
- [params setValue:_localAppId forKey:@"local_client_id"];
+ if (_urlSchemeSuffix) {
+ [params setValue:_urlSchemeSuffix forKey:@"local_client_id"];
}
// If the device is running a version of iOS that supports multitasking,
@@ -162,7 +162,7 @@ - (void)authorizeWithFBAppAuth:(BOOL)tryFBAppAuth
if ([device respondsToSelector:@selector(isMultitaskingSupported)] && [device isMultitaskingSupported]) {
if (tryFBAppAuth) {
NSString *scheme = kFBAppAuthURLScheme;
- if (_localAppId) {
+ if (_urlSchemeSuffix) {
scheme = [scheme stringByAppendingString:@"2"];
}
NSString *urlPrefix = [NSString stringWithFormat:@"%@://%@", scheme, kFBAppAuthURLPath];
@@ -213,7 +213,7 @@ - (NSDictionary*)parseURLParams:(NSString *)query {
- (void)authorize:(NSArray *)permissions {
[self authorize:permissions
- localAppId:nil];
+ urlSchemeSuffix:nil];
}
/**
@@ -244,29 +244,29 @@ - (void)authorize:(NSArray *)permissions {
* @param delegate
* Callback interface for notifying the calling application when
* the user has logged in.
- * @param localAppId
- * localAppId is a string of lowercase letters that is
+ * @param urlSchemeSuffix
+ * urlSchemeSuffix is a string of lowercase letters that is
* appended to the base URL scheme used for SSO. For example,
- * if your facebook ID is "350685531728" and you set localAppId to
+ * if your facebook ID is "350685531728" and you set urlSchemeSuffix to
* "abcd", the Facebook app will expect your application to bind to
* the following URL scheme: "fb350685531728abcd".
* This is useful if your have multiple iOS applications that
* share a single Facebook application id (for example, if you
* have a free and a paid version on the same app) and you want
* to use SSO with both apps. Giving both apps different
- * localAppId values will allow the Facebook app to disambiguate
+ * urlSchemeSuffix values will allow the Facebook app to disambiguate
* their URL schemes and always redirect the user back to the
* correct app, even if both the free and the app is installed
* on the device.
- * localAppId is supported on version 3.4.1 and above of the Facebook
+ * urlSchemeSuffix is supported on version 3.4.1 and above of the Facebook
* app. If the user has an older version of the Facebook app
- * installed and your app uses localAppId parameter, the SDK will
+ * installed and your app uses urlSchemeSuffix parameter, the SDK will
* proceed as if the Facebook app isn't installed on the device
* and redirect the user to Safari.
*/
- (void)authorize:(NSArray *)permissions
- localAppId:(NSString *)localAppId {
- self.localAppId = localAppId;
+ urlSchemeSuffix:(NSString *)urlSchemeSuffix {
+ self.urlSchemeSuffix = urlSchemeSuffix;
self.permissions = permissions;
[self authorizeWithFBAppAuth:YES safariAuth:YES];
Please sign in to comment.
Something went wrong with that request. Please try again.