- Uniform facebookID to facebookId naming in all classes
This commit is contained in:
parent
304c38f5e5
commit
f42c646dcb
@ -235,7 +235,7 @@ static bool isFirstAccess = YES;
|
||||
}
|
||||
}
|
||||
else {
|
||||
[[PNObjectConfig sharedInstance] refreshTokenForUserWithFacebookID:[result objectForKey:@"id"] facebookToken:[FBSDKAccessToken currentAccessToken].tokenString withBlockSuccess:^(BOOL refreshSuccess) {
|
||||
[[PNObjectConfig sharedInstance] refreshTokenForUserWithFacebookId:[result objectForKey:@"id"] facebookToken:[FBSDKAccessToken currentAccessToken].tokenString withBlockSuccess:^(BOOL refreshSuccess) {
|
||||
|
||||
PNUser *user = [[self class] new];
|
||||
|
||||
|
||||
@ -52,7 +52,7 @@
|
||||
/**
|
||||
* <#Description#>
|
||||
*
|
||||
* @param mappingSelector <#mappingSelector description#>
|
||||
* @param dictionaryMappingSelector <#mappingSelector description#>
|
||||
*
|
||||
* @return <#return value description#>
|
||||
*/
|
||||
|
||||
@ -123,7 +123,7 @@ typedef NS_ENUM(NSInteger, OAuthMode) {
|
||||
/**
|
||||
* <#Description#>
|
||||
*
|
||||
* @param env <#env description#>
|
||||
* @param environment <#env description#>
|
||||
*/
|
||||
- (void) setEnvironment:(NSString * _Nonnull) environment;
|
||||
|
||||
@ -138,7 +138,6 @@ typedef NS_ENUM(NSInteger, OAuthMode) {
|
||||
/**
|
||||
* <#Description#>
|
||||
*
|
||||
* @param value EnvironmentProduction, EnvironmentStage, EnvironmentDevelopment
|
||||
* @param key <#key description#>
|
||||
*/
|
||||
- (void) removeHTTPHeaderValueForKey:(NSString * _Nonnull) key;
|
||||
@ -225,7 +224,7 @@ typedef NS_ENUM(NSInteger, OAuthMode) {
|
||||
failure:(nullable void (^)(NSError * _Nonnull error))failure;
|
||||
|
||||
|
||||
- (void) refreshTokenForUserWithFacebookID:(NSString * _Nonnull) facebookID
|
||||
- (void) refreshTokenForUserWithFacebookId:(NSString * _Nonnull) facebookId
|
||||
facebookToken:(NSString * _Nonnull) facebookToken
|
||||
withBlockSuccess:(nullable void (^)(BOOL refreshSuccess))success
|
||||
failure:(nullable void (^)(NSError * _Nonnull error))failure;
|
||||
|
||||
@ -431,7 +431,7 @@ static bool isFirstAccess = YES;
|
||||
}
|
||||
}
|
||||
else {
|
||||
[self refreshTokenForUserWithFacebookID:[[SINGLETON_PNObjectConfig.userSubClass currentUser] facebookId] facebookToken:[[FBSDKAccessToken currentAccessToken] tokenString] withBlockSuccess:success failure:failure];
|
||||
[self refreshTokenForUserWithFacebookId:[[SINGLETON_PNObjectConfig.userSubClass currentUser] facebookId] facebookToken:[[FBSDKAccessToken currentAccessToken] tokenString] withBlockSuccess:success failure:failure];
|
||||
}
|
||||
}];
|
||||
}
|
||||
@ -489,11 +489,11 @@ static bool isFirstAccess = YES;
|
||||
}];
|
||||
}
|
||||
|
||||
- (void) refreshTokenForUserWithFacebookID:(NSString * _Nonnull) facebookID
|
||||
- (void) refreshTokenForUserWithFacebookId:(NSString * _Nonnull) facebookId
|
||||
facebookToken:(NSString * _Nonnull) facebookToken
|
||||
withBlockSuccess:(nullable void (^)(BOOL refreshSuccess))success
|
||||
failure:(nullable void (^)(NSError * _Nonnull error))failure {
|
||||
if (!facebookID || [facebookID length] == 0) {
|
||||
if (!facebookId || [facebookId length] == 0) {
|
||||
if (failure) {
|
||||
NSError *error = [NSError errorWithDomain:NSLocalizedString(@"Facebook id is not valid", @"") code:kHTTPStatusCodeBadRequest userInfo:nil];
|
||||
failure(error);
|
||||
@ -508,7 +508,7 @@ static bool isFirstAccess = YES;
|
||||
}
|
||||
}
|
||||
|
||||
[_authManager authenticateUsingFacebookOAuthWithURLString:[_currentEndPointUrl stringByAppendingString:@"oauth-token"] facebookID:facebookID facebookToken:facebookToken scope:nil success:^(AFOAuthCredential * _Nonnull credential) {
|
||||
[_authManager authenticateUsingFacebookOAuthWithURLString:[_currentEndPointUrl stringByAppendingString:@"oauth-token"] facebookId:facebookId facebookToken:facebookToken scope:nil success:^(AFOAuthCredential * _Nonnull credential) {
|
||||
_currentOauthCredential = credential;
|
||||
|
||||
[AFOAuthCredential storeCredential:_currentOauthCredential withIdentifier:PNObjectServiceUserCredentialIdentifier];
|
||||
|
||||
@ -114,14 +114,14 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
Creates and enqueues an `NSURLSessionTask` to authenticate against the server using a specified facebook id and facebook token, with a designated scope.
|
||||
|
||||
@param URLString The URL string used to create the request URL.
|
||||
@param facebookID The facebook id used for authentication
|
||||
@param facebookId The facebook id used for authentication
|
||||
@param facebookToken The facebook token used for authentication
|
||||
@param scope The authorization scope
|
||||
@param success A block object to be executed when the request operation finishes successfully. This block has no return value and takes a single argument: the OAuth credential returned by the server.
|
||||
@param failure A block object to be executed when the request operation finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a single argument: the error returned from the server.
|
||||
*/
|
||||
- (NSURLSessionTask *)authenticateUsingFacebookOAuthWithURLString:(NSString *)URLString
|
||||
facebookID:(NSString *)facebookid
|
||||
facebookId:(NSString *)facebookId
|
||||
facebookToken:(NSString *)facebookToken
|
||||
scope:(nullable NSString *)scope
|
||||
success:(void (^)(AFOAuthCredential * _Nonnull))success
|
||||
|
||||
@ -162,17 +162,17 @@ static NSError * AFErrorFromRFC6749Section5_2Error(id object) {
|
||||
}
|
||||
|
||||
- (NSURLSessionTask *)authenticateUsingFacebookOAuthWithURLString:(NSString *)URLString
|
||||
facebookID:(NSString *)facebookid
|
||||
facebookId:(NSString *)facebookId
|
||||
facebookToken:(NSString *)facebookToken
|
||||
scope:(NSString *)scope
|
||||
success:(void (^)(AFOAuthCredential * _Nonnull))success
|
||||
failure:(void (^)(NSError * _Nonnull))failure {
|
||||
NSParameterAssert(facebookid);
|
||||
NSParameterAssert(facebookId);
|
||||
NSParameterAssert(facebookToken);
|
||||
|
||||
NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
|
||||
[parameters setValue:kAFOAuthFacebookCredentialGrantType forKey:@"grant_type"];
|
||||
[parameters setValue:facebookid forKey:@"username"];
|
||||
[parameters setValue:facebookId forKey:@"username"];
|
||||
[parameters setValue:facebookToken forKey:@"password"];
|
||||
|
||||
if (scope) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user