- ADD isFacebookUser
- MOD isFacebookUser Property to facebookUser
This commit is contained in:
1 parent
a62ec71f98
commit
531bd9966a
3 files changed
+25
-5
No files matched your search
@@ -122,6 +122,8 @@
|
||||
|
||||
- (UIImage* _Nonnull) userProfileImage:(BOOL) forceReload;
|
||||
|
||||
- (BOOL) isFacebookUser;
|
||||
|
||||
//- (void) setPassword:(NSString * _Nonnull)password inBackGroundWithBlock:(nullable void (^)(BOOL saveStatus, id responseObject, NSError * error)) responseBlock;
|
||||
|
||||
///--------------------------------------
|
||||
@@ -200,10 +202,8 @@
|
||||
* <#Description#>
|
||||
*/
|
||||
@property (nonatomic, strong, nullable) NSNumber * loginCount;
|
||||
/**
|
||||
* <#Description#>
|
||||
*/
|
||||
@property (nonatomic) BOOL isFacebookUser;
|
||||
|
||||
@property (nonatomic) BOOL facebookUser;
|
||||
/**
|
||||
* <#Description#>
|
||||
*/
|
||||
|
||||
@@ -154,6 +154,7 @@ static bool isFirstAccess = YES;
|
||||
NSLogDebug(@"%@",[responseObject objectForKey:@"user"]);
|
||||
|
||||
[[[self class] currentUser] populateObjectFromJSON:[responseObject objectForKey:@"user"]];
|
||||
[[[self class] currentUser] updateFacebookData];
|
||||
[[[self class] currentUser] saveLocally];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:PNObjectLocalNotificationUserReloadFromServerSuccess object:nil];
|
||||
|
||||
@@ -234,6 +235,7 @@ static bool isFirstAccess = YES;
|
||||
|
||||
[user setFacebookId:[result objectForKey:@"id"]];
|
||||
[user setAuthenticated:YES];
|
||||
[user setFacebookUser:YES];
|
||||
[user saveLocally];
|
||||
[user reloadFormServer];
|
||||
|
||||
@@ -343,6 +345,24 @@ static bool isFirstAccess = YES;
|
||||
return self.authenticated;
|
||||
}
|
||||
|
||||
- (BOOL) isFacebookUser {
|
||||
[self updateFacebookData];
|
||||
|
||||
return self.facebookUser;
|
||||
}
|
||||
|
||||
|
||||
- (void) updateFacebookData {
|
||||
|
||||
if (self.facebookId || self.facebookAccessToken) {
|
||||
self.facebookUser = YES;
|
||||
}
|
||||
else {
|
||||
self.facebookUser = NO;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
- (UIImage* _Nonnull) userProfileImage {
|
||||
return [self userProfileImage:NO];
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user