no message

This commit is contained in:
Giuseppe Nucifora 2016-04-28 11:56:30 +02:00
parent 2085bea970
commit ff25846a8f
2 changed files with 63 additions and 58 deletions

View File

@ -403,7 +403,7 @@ static bool isFirstAccess = YES;
@"lastName":@"lastName",
@"profileImageUrl":@"profileImage",
@"sex":@"sex",
@"birthDate":@"birthYear",
@"birthDate":@"birthDate",
@"phone":@"phone",
@"password":@{@"key":@"password",@"type":@"PNObjcPassword"},
@"hasAcceptedPrivacy":@"hasAcceptedPrivacy",

View File

@ -117,7 +117,7 @@ static bool isFirstAccess = YES;
}
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;
_configuration = [[NSMutableDictionary alloc] init];
_minPasswordLenght = minPassLenght;
_currentEnv = EnvironmentProduction;
_jsonSerializer = [AFJSONRequestSerializer serializer];
_httpSerializer = [AFHTTPRequestSerializer serializer];
@ -218,10 +218,11 @@ static bool isFirstAccess = YES;
NSAssert(_currentEndPointBaseUrl,@"Selected environment generate error. Please check configuration");
[self manager];
if (_currentOAuthClientID && _currentOAuthClientSecret) {
[self authManager];
[self manager];
}
}
- (NSString *) baseUrl {
@ -232,10 +233,6 @@ static bool isFirstAccess = YES;
if (!_manager) {
_manager = [AFHTTPSessionManager manager];
}
//_currentOauthCredential = [AFOAuthCredential retrieveCredentialWithIdentifier:PNObjectServiceCredentialIdentifier];
for (NSString *key in [_headerFields allKeys]) {
@ -255,6 +252,7 @@ static bool isFirstAccess = YES;
_manager.responseSerializer = [AFJSONResponseSerializerWithData serializer];
_manager.requestSerializer = _jsonSerializer;
}
return _manager;
}
@ -265,9 +263,6 @@ static bool isFirstAccess = YES;
if (!_authManager) {
_authManager = [AFOAuth2Manager manager];
}
//_currentOauthCredential = [AFOAuthCredential retrieveCredentialWithIdentifier:PNObjectServiceCredentialIdentifier];
if (_oauthEnabled && _currentOAuthClientID && _currentOAuthClientSecret) {
@ -300,6 +295,7 @@ static bool isFirstAccess = YES;
}
_authManager.responseSerializer = [AFJSONResponseSerializerWithData serializer];
}
return _authManager;
}
@ -370,8 +366,17 @@ static bool isFirstAccess = YES;
return;
}
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];
}
}];
}
else {
if (failure) {