2
0

Add support for Answers and improved Fabric integration.

This commit is contained in:
Maarten Billemont
2017-04-29 23:03:50 -04:00
parent 07e55140ac
commit 6d9be3fdfe
26 changed files with 237 additions and 129 deletions

View File

@@ -16,6 +16,7 @@
// LICENSE file. Alternatively, see <http://www.gnu.org/licenses/>.
//==============================================================================
#import <Crashlytics/Answers.h>
#import "MPUsersViewController.h"
#import "MPEntities.h"
#import "MPAvatarCell.h"
@@ -224,6 +225,17 @@ typedef NS_ENUM( NSUInteger, MPActiveUserState ) {
user.defaultType = user.algorithm.defaultType;
user.avatar = newUserAvatar;
user.name = newUserName;
if ([[MPConfig get].sendInfo boolValue]) {
#ifdef CRASHLYTICS
[Answers logSignUpWithMethod:@"Manual"
success:@YES
customAttributes:@{
@"algorithm": @(user.algorithm.version),
@"avatar" : @(user.avatar),
}];
#endif
}
}
BOOL signedIn = [[MPiOSAppDelegate get] signInAsUser:user saveInContext:context
@@ -719,7 +731,7 @@ referenceSizeForFooterInSection:(NSInteger)section {
];
NSArray *users = [mainContext executeFetchRequest:fetchRequest error:&error];
if (!users) {
err( @"Failed to load users: %@", [error fullDescription] );
MPError( error, @"Failed to load users." );
self.userIDs = nil;
}