no message

This commit is contained in:
giuseppenuc committed 2016-02-15 16:51:22 +01:00
1 parent bef8607419
commit d59d446285
3 files changed
+15 -13

No files matched your search

+6 -6
View File
@@ -118,11 +118,11 @@
NSLog(@"%@",[user JSONFormObject]);
//NSLog(@"%@",[user JSONObjectMap]);
[user registerWithBlockSuccess:^(PNUser * _Nullable responseObject) {
/*[user registerWithBlockSuccess:^(PNUser * _Nullable responseObject) {
} failure:^(NSError * _Nonnull error) {
}];
}];*/
/*[[User currentUser] socialLoginWithBlockSuccessFromViewController:self
blockSuccess:^(PNUser * _Nullable responseObject) {
@@ -131,17 +131,17 @@
}];*/
/*User * user = [User currentUser];
//User * user = [User currentUser];
if ([user isAuthenticated]) {
//if ([user isAuthenticated]) {
[user loginCurrentUserWithEmail:@"packman@giuseppenucifora.com" password:@"asdasdasd" withBlockSuccess:^(PNUser * _Nullable responseObject) {
[User loginCurrentUserWithEmail:@"packman@giuseppenucifora.com" password:@"asdasdasd" withBlockSuccess:^(PNUser * _Nullable responseObject) {
NSLog(@"response : %@",responseObject);
} failure:^(NSError * _Nonnull error) {
NSLog(@"response : %@",error);
}];
}*/
}
- (void)didReceiveMemoryWarning
+1 -1
View File
@@ -54,7 +54,7 @@
* @param success <#success description#>
* @param failure <#failure description#>
*/
- (void) loginCurrentUserWithEmail:(NSString * _Nonnull) email
+ (void) loginCurrentUserWithEmail:(NSString * _Nonnull) email
password:(NSString * _Nonnull) password
withBlockSuccess:(nullable void (^)(PNUser * _Nullable responseObject))success
failure:(nullable void (^)(NSError * _Nonnull error))failure;
+8 -6
View File
@@ -259,24 +259,26 @@ static bool isFirstAccess = YES;
}];*/
}
- (void) loginCurrentUserWithEmail:(NSString * _Nonnull) email
+ (void) loginCurrentUserWithEmail:(NSString * _Nonnull) email
password:(NSString * _Nonnull) password
withBlockSuccess:(nullable void (^)(PNUser * _Nullable responseObject))success
failure:(nullable void (^)(NSError * _Nonnull error))failure {
[[PNObjectConfig sharedInstance] refreshTokenForUserWithEmail:email password:password withBlockSuccess:^(BOOL refreshSuccess) {
if (refreshSuccess) {
PNUser *user = [[self class] new];
PNObjcPassword *objectPassword = [PNObjcPassword new];
[objectPassword setPassword:password];
[objectPassword setConfirmPassword:password];
[self setAuthenticated:YES];
[self setEmail:email];
[self setPassword:objectPassword];
[self saveLocally];
[user setAuthenticated:YES];
[user setEmail:email];
[user setPassword:objectPassword];
[user saveLocally];
if (success) {
success(self);
success(user);
}
}
} failure:failure];