no message
This commit is contained in:
parent
2085bea970
commit
ff25846a8f
@ -403,7 +403,7 @@ static bool isFirstAccess = YES;
|
|||||||
@"lastName":@"lastName",
|
@"lastName":@"lastName",
|
||||||
@"profileImageUrl":@"profileImage",
|
@"profileImageUrl":@"profileImage",
|
||||||
@"sex":@"sex",
|
@"sex":@"sex",
|
||||||
@"birthDate":@"birthYear",
|
@"birthDate":@"birthDate",
|
||||||
@"phone":@"phone",
|
@"phone":@"phone",
|
||||||
@"password":@{@"key":@"password",@"type":@"PNObjcPassword"},
|
@"password":@{@"key":@"password",@"type":@"PNObjcPassword"},
|
||||||
@"hasAcceptedPrivacy":@"hasAcceptedPrivacy",
|
@"hasAcceptedPrivacy":@"hasAcceptedPrivacy",
|
||||||
|
|||||||
@ -117,7 +117,7 @@ static bool isFirstAccess = YES;
|
|||||||
|
|
||||||
}
|
}
|
||||||
NSAssert([SINGLETON_PNObjectConfig.configuration objectForKey:EnvironmentProduction], @"EnvironmentProduction must be valid endpoint url");
|
NSAssert([SINGLETON_PNObjectConfig.configuration objectForKey:EnvironmentProduction], @"EnvironmentProduction must be valid endpoint url");
|
||||||
[SINGLETON_PNObjectConfig setEnvironment:EnvironmentProduction];
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -164,7 +164,7 @@ static bool isFirstAccess = YES;
|
|||||||
_userSubClass = userSubClass;
|
_userSubClass = userSubClass;
|
||||||
_configuration = [[NSMutableDictionary alloc] init];
|
_configuration = [[NSMutableDictionary alloc] init];
|
||||||
_minPasswordLenght = minPassLenght;
|
_minPasswordLenght = minPassLenght;
|
||||||
|
_currentEnv = EnvironmentProduction;
|
||||||
_jsonSerializer = [AFJSONRequestSerializer serializer];
|
_jsonSerializer = [AFJSONRequestSerializer serializer];
|
||||||
_httpSerializer = [AFHTTPRequestSerializer serializer];
|
_httpSerializer = [AFHTTPRequestSerializer serializer];
|
||||||
|
|
||||||
@ -218,10 +218,11 @@ static bool isFirstAccess = YES;
|
|||||||
|
|
||||||
NSAssert(_currentEndPointBaseUrl,@"Selected environment generate error. Please check configuration");
|
NSAssert(_currentEndPointBaseUrl,@"Selected environment generate error. Please check configuration");
|
||||||
|
|
||||||
[self manager];
|
if (_currentOAuthClientID && _currentOAuthClientSecret) {
|
||||||
|
|
||||||
[self authManager];
|
[self authManager];
|
||||||
|
|
||||||
|
[self manager];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *) baseUrl {
|
- (NSString *) baseUrl {
|
||||||
@ -232,10 +233,6 @@ static bool isFirstAccess = YES;
|
|||||||
|
|
||||||
if (!_manager) {
|
if (!_manager) {
|
||||||
_manager = [AFHTTPSessionManager manager];
|
_manager = [AFHTTPSessionManager manager];
|
||||||
}
|
|
||||||
|
|
||||||
//_currentOauthCredential = [AFOAuthCredential retrieveCredentialWithIdentifier:PNObjectServiceCredentialIdentifier];
|
|
||||||
|
|
||||||
|
|
||||||
for (NSString *key in [_headerFields allKeys]) {
|
for (NSString *key in [_headerFields allKeys]) {
|
||||||
|
|
||||||
@ -255,6 +252,7 @@ static bool isFirstAccess = YES;
|
|||||||
|
|
||||||
_manager.responseSerializer = [AFJSONResponseSerializerWithData serializer];
|
_manager.responseSerializer = [AFJSONResponseSerializerWithData serializer];
|
||||||
_manager.requestSerializer = _jsonSerializer;
|
_manager.requestSerializer = _jsonSerializer;
|
||||||
|
}
|
||||||
|
|
||||||
return _manager;
|
return _manager;
|
||||||
}
|
}
|
||||||
@ -265,9 +263,6 @@ static bool isFirstAccess = YES;
|
|||||||
|
|
||||||
if (!_authManager) {
|
if (!_authManager) {
|
||||||
_authManager = [AFOAuth2Manager manager];
|
_authManager = [AFOAuth2Manager manager];
|
||||||
}
|
|
||||||
|
|
||||||
//_currentOauthCredential = [AFOAuthCredential retrieveCredentialWithIdentifier:PNObjectServiceCredentialIdentifier];
|
|
||||||
|
|
||||||
if (_oauthEnabled && _currentOAuthClientID && _currentOAuthClientSecret) {
|
if (_oauthEnabled && _currentOAuthClientID && _currentOAuthClientSecret) {
|
||||||
|
|
||||||
@ -300,6 +295,7 @@ static bool isFirstAccess = YES;
|
|||||||
}
|
}
|
||||||
|
|
||||||
_authManager.responseSerializer = [AFJSONResponseSerializerWithData serializer];
|
_authManager.responseSerializer = [AFJSONResponseSerializerWithData serializer];
|
||||||
|
}
|
||||||
|
|
||||||
return _authManager;
|
return _authManager;
|
||||||
}
|
}
|
||||||
@ -370,8 +366,17 @@ static bool isFirstAccess = YES;
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if ([SINGLETON_PNObjectConfig.userSubClass currentUser] && [[SINGLETON_PNObjectConfig.userSubClass currentUser] facebookId]){
|
else if ([SINGLETON_PNObjectConfig.userSubClass currentUser] && [[SINGLETON_PNObjectConfig.userSubClass currentUser] facebookId]){
|
||||||
|
[FBSDKAccessToken refreshCurrentAccessToken:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
|
||||||
|
if (error) {
|
||||||
|
if (failure) {
|
||||||
|
failure(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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];
|
||||||
}
|
}
|
||||||
|
}];
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
if (failure) {
|
if (failure) {
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user