2014-10-29 21:58:58 +01:00
|
|
|
//
|
2017-02-17 23:30:49 +01:00
|
|
|
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
|
2014-10-29 21:58:58 +01:00
|
|
|
//
|
|
|
|
|
|
|
|
#import "FingerprintViewController.h"
|
2016-11-01 20:02:15 +01:00
|
|
|
#import "Environment.h"
|
2017-06-09 00:10:02 +02:00
|
|
|
#import "FingerprintViewScanController.h"
|
2017-06-08 20:55:26 +02:00
|
|
|
#import "OWSBezierPathView.h"
|
2017-06-09 00:10:02 +02:00
|
|
|
#import "OWSContactsManager.h"
|
2016-10-12 23:38:24 +02:00
|
|
|
#import "Signal-Swift.h"
|
2017-06-09 00:10:02 +02:00
|
|
|
#import "UIColor+OWS.h"
|
|
|
|
#import "UIFont+OWS.h"
|
2016-11-15 18:51:55 +01:00
|
|
|
#import "UIUtil.h"
|
2017-06-09 00:10:02 +02:00
|
|
|
#import "UIView+OWS.h"
|
2016-09-21 19:59:45 +02:00
|
|
|
#import <SignalServiceKit/NSDate+millisecondTimeStamp.h>
|
2016-11-21 17:06:37 +01:00
|
|
|
#import <SignalServiceKit/OWSError.h>
|
2016-09-11 22:53:12 +02:00
|
|
|
#import <SignalServiceKit/OWSFingerprint.h>
|
2017-06-07 22:51:22 +02:00
|
|
|
#import <SignalServiceKit/OWSFingerprintBuilder.h>
|
2017-06-06 20:12:47 +02:00
|
|
|
#import <SignalServiceKit/OWSIdentityManager.h>
|
2016-09-21 19:59:45 +02:00
|
|
|
#import <SignalServiceKit/TSInfoMessage.h>
|
2016-09-11 22:53:12 +02:00
|
|
|
#import <SignalServiceKit/TSStorageManager+SessionStore.h>
|
|
|
|
#import <SignalServiceKit/TSStorageManager+keyingMaterial.h>
|
2014-10-29 21:58:58 +01:00
|
|
|
|
2016-09-11 22:53:12 +02:00
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
2014-12-11 00:05:41 +01:00
|
|
|
|
2017-06-08 20:55:26 +02:00
|
|
|
typedef void (^CustomLayoutBlock)();
|
|
|
|
|
|
|
|
@interface CustomLayoutView : UIView
|
|
|
|
|
|
|
|
@property (nonatomic) CustomLayoutBlock layoutBlock;
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
#pragma mark -
|
|
|
|
|
|
|
|
@implementation CustomLayoutView
|
|
|
|
|
2017-06-09 13:27:36 +02:00
|
|
|
- (instancetype)init
|
|
|
|
{
|
|
|
|
if (self = [super init]) {
|
|
|
|
self.translatesAutoresizingMaskIntoConstraints = NO;
|
|
|
|
}
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (instancetype)initWithFrame:(CGRect)frame
|
|
|
|
{
|
|
|
|
if (self = [super initWithFrame:frame]) {
|
|
|
|
self.translatesAutoresizingMaskIntoConstraints = NO;
|
|
|
|
}
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (nullable instancetype)initWithCoder:(NSCoder *)aDecoder
|
|
|
|
{
|
|
|
|
if (self = [super initWithCoder:aDecoder]) {
|
|
|
|
self.translatesAutoresizingMaskIntoConstraints = NO;
|
|
|
|
}
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
2017-06-08 20:55:26 +02:00
|
|
|
- (void)layoutSubviews
|
|
|
|
{
|
2017-06-09 13:27:36 +02:00
|
|
|
[super layoutSubviews];
|
|
|
|
|
2017-06-08 20:55:26 +02:00
|
|
|
self.layoutBlock();
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
#pragma mark -
|
|
|
|
|
|
|
|
@interface FingerprintViewController () <OWSCompareSafetyNumbersActivityDelegate>
|
2016-09-11 22:53:12 +02:00
|
|
|
|
2017-06-09 00:10:02 +02:00
|
|
|
@property (nonatomic) NSString *recipientId;
|
2017-06-09 15:33:38 +02:00
|
|
|
@property (nonatomic) NSData *identityKey;
|
2017-06-07 22:51:22 +02:00
|
|
|
@property (nonatomic) TSStorageManager *storageManager;
|
|
|
|
@property (nonatomic) OWSFingerprint *fingerprint;
|
|
|
|
@property (nonatomic) NSString *contactName;
|
|
|
|
|
2017-06-08 20:55:26 +02:00
|
|
|
@property (nonatomic) UIBarButtonItem *shareButton;
|
2014-10-29 21:58:58 +01:00
|
|
|
|
2016-09-11 22:53:12 +02:00
|
|
|
@end
|
2015-01-27 21:17:49 +01:00
|
|
|
|
2014-10-29 21:58:58 +01:00
|
|
|
@implementation FingerprintViewController
|
|
|
|
|
2017-06-07 22:51:22 +02:00
|
|
|
- (void)configureWithRecipientId:(NSString *)recipientId
|
2016-09-11 22:53:12 +02:00
|
|
|
{
|
2017-06-07 22:51:22 +02:00
|
|
|
OWSAssert(recipientId.length > 0);
|
|
|
|
|
2017-06-09 00:10:02 +02:00
|
|
|
self.recipientId = recipientId;
|
|
|
|
|
2017-06-07 22:51:22 +02:00
|
|
|
self.storageManager = [TSStorageManager sharedManager];
|
|
|
|
|
|
|
|
OWSContactsManager *contactsManager = [Environment getCurrent].contactsManager;
|
|
|
|
self.contactName = [contactsManager displayNameForPhoneIdentifier:recipientId];
|
|
|
|
|
|
|
|
OWSRecipientIdentity *_Nullable recipientIdentity =
|
|
|
|
[[OWSIdentityManager sharedManager] recipientIdentityForRecipientId:recipientId];
|
|
|
|
OWSAssert(recipientIdentity);
|
2017-06-09 15:33:38 +02:00
|
|
|
self.identityKey = recipientIdentity.identityKey;
|
2017-06-07 22:51:22 +02:00
|
|
|
|
|
|
|
OWSFingerprintBuilder *builder =
|
|
|
|
[[OWSFingerprintBuilder alloc] initWithStorageManager:self.storageManager contactsManager:contactsManager];
|
|
|
|
self.fingerprint =
|
|
|
|
[builder fingerprintWithTheirSignalId:recipientId theirIdentityKey:recipientIdentity.identityKey];
|
2014-12-04 00:23:36 +01:00
|
|
|
}
|
|
|
|
|
2017-06-08 20:55:26 +02:00
|
|
|
- (void)loadView
|
2016-09-11 22:53:12 +02:00
|
|
|
{
|
2017-06-08 20:55:26 +02:00
|
|
|
[super loadView];
|
|
|
|
|
|
|
|
self.title = NSLocalizedString(@"PRIVACY_VERIFICATION_TITLE", @"Navbar title");
|
2016-09-21 14:37:51 +02:00
|
|
|
|
2017-06-08 20:55:26 +02:00
|
|
|
self.navigationItem.leftBarButtonItem =
|
|
|
|
[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemStop
|
|
|
|
target:self
|
|
|
|
action:@selector(closeButton)];
|
|
|
|
self.shareButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction
|
|
|
|
target:self
|
|
|
|
action:@selector(didTapShareButton)];
|
2016-11-15 18:51:55 +01:00
|
|
|
self.navigationItem.rightBarButtonItem = self.shareButton;
|
2016-09-11 22:53:12 +02:00
|
|
|
|
2017-06-08 20:55:26 +02:00
|
|
|
[self createViews];
|
|
|
|
}
|
2016-09-11 22:53:12 +02:00
|
|
|
|
2017-06-08 20:55:26 +02:00
|
|
|
- (void)createViews
|
|
|
|
{
|
|
|
|
UIColor *darkGrey = [UIColor colorWithRGBHex:0x404040];
|
|
|
|
|
|
|
|
self.view.backgroundColor = [UIColor whiteColor];
|
|
|
|
|
|
|
|
UIView *mainView = [UIView new];
|
|
|
|
mainView.backgroundColor = [UIColor whiteColor];
|
|
|
|
[self.view addSubview:mainView];
|
|
|
|
[mainView autoPinWidthToSuperview];
|
2017-06-09 00:10:02 +02:00
|
|
|
[mainView autoPinToTopLayoutGuideOfViewController:self withInset:0];
|
|
|
|
[mainView autoPinToBottomLayoutGuideOfViewController:self withInset:0];
|
2017-06-08 20:55:26 +02:00
|
|
|
|
2017-06-09 16:11:15 +02:00
|
|
|
// Learn More
|
|
|
|
UIView *learnMoreButton = [UIView new];
|
|
|
|
[learnMoreButton
|
|
|
|
addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self
|
|
|
|
action:@selector(learnMoreButtonTapped:)]];
|
|
|
|
[mainView addSubview:learnMoreButton];
|
|
|
|
[learnMoreButton autoPinWidthToSuperview];
|
|
|
|
[learnMoreButton autoPinEdgeToSuperviewEdge:ALEdgeBottom withInset:0];
|
|
|
|
|
|
|
|
UILabel *learnMoreLabel = [UILabel new];
|
|
|
|
learnMoreLabel.attributedText = [[NSAttributedString alloc]
|
|
|
|
initWithString:NSLocalizedString(@"PRIVACY_SAFETY_NUMBERS_LEARN_MORE",
|
|
|
|
@"Label for a link to more information about safety numbers and verification.")
|
|
|
|
attributes:@{
|
|
|
|
NSUnderlineStyleAttributeName : @(NSUnderlineStyleSingle | NSUnderlinePatternSolid),
|
|
|
|
}];
|
|
|
|
learnMoreLabel.font = [UIFont ows_regularFontWithSize:ScaleFromIPhone5To7Plus(14.f, 16.f)];
|
|
|
|
learnMoreLabel.textColor = [UIColor ows_materialBlueColor];
|
|
|
|
learnMoreLabel.textAlignment = NSTextAlignmentCenter;
|
|
|
|
[learnMoreButton addSubview:learnMoreLabel];
|
|
|
|
[learnMoreLabel autoPinWidthToSuperviewWithMargin:16.f];
|
|
|
|
[learnMoreLabel autoPinEdgeToSuperviewEdge:ALEdgeTop withInset:ScaleFromIPhone5To7Plus(15.f, 20.f)];
|
|
|
|
[learnMoreLabel autoPinEdgeToSuperviewEdge:ALEdgeBottom withInset:ScaleFromIPhone5To7Plus(20.f, 25.f)];
|
2017-06-08 20:55:26 +02:00
|
|
|
|
|
|
|
// Instructions
|
|
|
|
NSString *instructionsFormat = NSLocalizedString(@"PRIVACY_VERIFICATION_INSTRUCTIONS",
|
|
|
|
@"Paragraph(s) shown alongside the safety number when verifying privacy with {{contact name}}");
|
|
|
|
UILabel *instructionsLabel = [UILabel new];
|
|
|
|
instructionsLabel.text = [NSString stringWithFormat:instructionsFormat, self.contactName];
|
2017-06-08 21:12:03 +02:00
|
|
|
instructionsLabel.font = [UIFont ows_regularFontWithSize:ScaleFromIPhone5To7Plus(11.f, 16.f)];
|
2017-06-08 20:55:26 +02:00
|
|
|
instructionsLabel.textColor = darkGrey;
|
|
|
|
instructionsLabel.textAlignment = NSTextAlignmentCenter;
|
|
|
|
instructionsLabel.numberOfLines = 0;
|
|
|
|
instructionsLabel.lineBreakMode = NSLineBreakByWordWrapping;
|
|
|
|
[mainView addSubview:instructionsLabel];
|
|
|
|
[instructionsLabel autoPinWidthToSuperviewWithMargin:16.f];
|
2017-06-09 16:11:15 +02:00
|
|
|
[instructionsLabel autoPinEdge:ALEdgeBottom toEdge:ALEdgeTop ofView:learnMoreButton withOffset:0];
|
2017-06-08 20:55:26 +02:00
|
|
|
|
|
|
|
// Fingerprint Label
|
|
|
|
UILabel *fingerprintLabel = [UILabel new];
|
|
|
|
fingerprintLabel.text = self.fingerprint.displayableText;
|
|
|
|
fingerprintLabel.font = [UIFont fontWithName:@"Menlo-Regular" size:23.f];
|
|
|
|
fingerprintLabel.textColor = darkGrey;
|
|
|
|
fingerprintLabel.numberOfLines = 3;
|
|
|
|
fingerprintLabel.lineBreakMode = NSLineBreakByTruncatingTail;
|
|
|
|
fingerprintLabel.adjustsFontSizeToFitWidth = YES;
|
|
|
|
[fingerprintLabel
|
|
|
|
addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self
|
|
|
|
action:@selector(fingerprintLabelTapped:)]];
|
|
|
|
fingerprintLabel.userInteractionEnabled = YES;
|
|
|
|
[mainView addSubview:fingerprintLabel];
|
|
|
|
[fingerprintLabel autoPinWidthToSuperviewWithMargin:36.f];
|
2017-06-08 21:12:03 +02:00
|
|
|
[fingerprintLabel autoPinEdge:ALEdgeBottom toEdge:ALEdgeTop ofView:instructionsLabel withOffset:-ScaleFromIPhone5To7Plus(8.f, 15.f)];
|
2017-06-08 20:55:26 +02:00
|
|
|
|
|
|
|
// Fingerprint Image
|
|
|
|
CustomLayoutView *fingerprintView = [CustomLayoutView new];
|
|
|
|
[mainView addSubview:fingerprintView];
|
|
|
|
[fingerprintView autoPinWidthToSuperview];
|
2017-06-08 21:12:03 +02:00
|
|
|
[fingerprintView autoPinEdgeToSuperviewEdge:ALEdgeTop withInset:ScaleFromIPhone5To7Plus(10.f, 25.f)];
|
|
|
|
[fingerprintView autoPinEdge:ALEdgeBottom toEdge:ALEdgeTop ofView:fingerprintLabel withOffset:-ScaleFromIPhone5To7Plus(10.f, 15.f)];
|
2017-06-08 20:55:26 +02:00
|
|
|
[fingerprintView
|
|
|
|
addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self
|
|
|
|
action:@selector(fingerprintViewTapped:)]];
|
|
|
|
fingerprintView.userInteractionEnabled = YES;
|
|
|
|
|
|
|
|
OWSBezierPathView *fingerprintCircle = [OWSBezierPathView new];
|
|
|
|
[fingerprintCircle setConfigureShapeLayerBlock:^(CAShapeLayer *layer, CGRect bounds) {
|
|
|
|
layer.fillColor = darkGrey.CGColor;
|
|
|
|
CGFloat size = MIN(bounds.size.width, bounds.size.height);
|
|
|
|
CGRect circle = CGRectMake((bounds.size.width - size) * 0.5f, (bounds.size.height - size) * 0.5f, size, size);
|
|
|
|
layer.path = [UIBezierPath bezierPathWithOvalInRect:circle].CGPath;
|
|
|
|
}];
|
|
|
|
[fingerprintView addSubview:fingerprintCircle];
|
|
|
|
[fingerprintCircle autoPinWidthToSuperview];
|
|
|
|
[fingerprintCircle autoPinHeightToSuperview];
|
|
|
|
|
|
|
|
UIImageView *fingerprintImageView = [UIImageView new];
|
|
|
|
fingerprintImageView.image = self.fingerprint.image;
|
2017-06-09 13:27:36 +02:00
|
|
|
// Don't antialias QR Codes.
|
2017-06-08 20:55:26 +02:00
|
|
|
fingerprintImageView.layer.magnificationFilter = kCAFilterNearest;
|
|
|
|
fingerprintImageView.layer.minificationFilter = kCAFilterNearest;
|
|
|
|
[fingerprintView addSubview:fingerprintImageView];
|
|
|
|
|
2017-06-09 16:11:15 +02:00
|
|
|
UILabel *scanLabel = [UILabel new];
|
|
|
|
scanLabel.text = NSLocalizedString(@"PRIVACY_TAP_TO_SCAN", @"Button that shows the 'scan with camera' view.");
|
|
|
|
scanLabel.font = [UIFont ows_regularFontWithSize:16.f];
|
|
|
|
scanLabel.textColor = [UIColor whiteColor];
|
|
|
|
[scanLabel sizeToFit];
|
|
|
|
[fingerprintView addSubview:scanLabel];
|
|
|
|
|
2017-06-08 20:55:26 +02:00
|
|
|
fingerprintView.layoutBlock = ^{
|
|
|
|
CGFloat size = round(MIN(fingerprintView.width, fingerprintView.height) * 0.65f);
|
|
|
|
fingerprintImageView.frame = CGRectMake(
|
|
|
|
round((fingerprintView.width - size) * 0.5f), round((fingerprintView.height - size) * 0.5f), size, size);
|
2017-06-09 16:11:15 +02:00
|
|
|
CGFloat scanY = round(fingerprintImageView.bottom
|
|
|
|
+ ((fingerprintView.height - fingerprintImageView.bottom) - scanLabel.height) * 0.33f);
|
|
|
|
scanLabel.frame = CGRectMake(
|
|
|
|
round((fingerprintView.width - scanLabel.width) * 0.5f), scanY, scanLabel.width, scanLabel.height);
|
2017-06-08 20:55:26 +02:00
|
|
|
};
|
2014-11-21 14:38:37 +01:00
|
|
|
}
|
|
|
|
|
2016-11-15 18:51:55 +01:00
|
|
|
- (void)viewWillAppear:(BOOL)animated
|
|
|
|
{
|
|
|
|
// In case we're returning from activity view that needed default system styles.
|
|
|
|
[UIUtil applySignalAppearence];
|
|
|
|
}
|
|
|
|
|
2017-06-09 00:10:02 +02:00
|
|
|
#pragma mark -
|
2016-11-15 18:51:55 +01:00
|
|
|
|
|
|
|
- (void)showSharingActivityWithCompletion:(nullable void (^)(void))completionHandler
|
|
|
|
{
|
|
|
|
DDLogDebug(@"%@ Sharing safety numbers", self.tag);
|
|
|
|
|
2016-11-21 17:06:37 +01:00
|
|
|
OWSCompareSafetyNumbersActivity *compareActivity = [[OWSCompareSafetyNumbersActivity alloc] initWithDelegate:self];
|
|
|
|
|
2016-11-29 23:49:18 +01:00
|
|
|
NSString *shareFormat = NSLocalizedString(@"SAFETY_NUMBER_SHARE_FORMAT", @"Snippet to share {{safety number}} with a friend. sent e.g. via SMS");
|
2016-11-15 18:51:55 +01:00
|
|
|
NSString *shareString = [NSString stringWithFormat:shareFormat, self.fingerprint.displayableText];
|
|
|
|
|
2016-11-21 17:06:37 +01:00
|
|
|
UIActivityViewController *activityController =
|
|
|
|
[[UIActivityViewController alloc] initWithActivityItems:@[ shareString ]
|
|
|
|
applicationActivities:@[ compareActivity ]];
|
2016-11-15 18:51:55 +01:00
|
|
|
|
2016-11-21 17:06:37 +01:00
|
|
|
activityController.completionWithItemsHandler = ^void(UIActivityType __nullable activityType, BOOL completed, NSArray * __nullable returnedItems, NSError * __nullable activityError){
|
2016-11-15 18:51:55 +01:00
|
|
|
if (completionHandler) {
|
|
|
|
completionHandler();
|
|
|
|
}
|
|
|
|
[UIUtil applySignalAppearence];
|
|
|
|
};
|
|
|
|
|
2016-11-21 17:06:37 +01:00
|
|
|
// This value was extracted by inspecting `activityType` in the activityController.completionHandler
|
|
|
|
NSString *const iCloudActivityType = @"com.apple.CloudDocsUI.AddToiCloudDrive";
|
2016-11-15 18:51:55 +01:00
|
|
|
activityController.excludedActivityTypes = @[
|
|
|
|
UIActivityTypePostToFacebook,
|
|
|
|
UIActivityTypePostToWeibo,
|
|
|
|
UIActivityTypeAirDrop,
|
2016-11-21 17:06:37 +01:00
|
|
|
UIActivityTypePostToTwitter,
|
|
|
|
iCloudActivityType // This isn't being excluded. RADAR https://openradar.appspot.com/27493621
|
2016-11-15 18:51:55 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
[UIUtil applyDefaultSystemAppearence];
|
|
|
|
[self presentViewController:activityController animated:YES completion:nil];
|
|
|
|
}
|
|
|
|
|
2016-11-21 17:06:37 +01:00
|
|
|
#pragma mark - OWSCompareSafetyNumbersActivityDelegate
|
|
|
|
|
|
|
|
- (void)compareSafetyNumbersActivitySucceededWithActivity:(OWSCompareSafetyNumbersActivity *)activity
|
|
|
|
{
|
|
|
|
[self showVerificationSucceeded];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)compareSafetyNumbersActivity:(OWSCompareSafetyNumbersActivity *)activity failedWithError:(NSError *)error
|
|
|
|
{
|
|
|
|
[self showVerificationFailedWithError:error];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)showVerificationSucceeded
|
2016-09-11 22:53:12 +02:00
|
|
|
{
|
2017-06-09 15:33:38 +02:00
|
|
|
[FingerprintViewScanController showVerificationSucceeded:self
|
|
|
|
identityKey:self.identityKey
|
|
|
|
recipientId:self.recipientId
|
|
|
|
contactName:self.contactName
|
|
|
|
tag:self.tag];
|
2016-11-21 17:06:37 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)showVerificationFailedWithError:(NSError *)error
|
|
|
|
{
|
2016-09-11 22:53:12 +02:00
|
|
|
|
2017-06-09 15:33:38 +02:00
|
|
|
[FingerprintViewScanController showVerificationFailedWithError:error
|
|
|
|
viewController:self
|
|
|
|
retryBlock:nil
|
|
|
|
cancelBlock:^{
|
|
|
|
// Do nothing.
|
|
|
|
}
|
|
|
|
tag:self.tag];
|
2016-09-11 22:53:12 +02:00
|
|
|
}
|
2014-10-29 21:58:58 +01:00
|
|
|
|
2017-06-09 00:10:02 +02:00
|
|
|
#pragma mark - Action
|
|
|
|
|
|
|
|
- (void)closeButton
|
|
|
|
{
|
|
|
|
[self dismissViewControllerAnimated:YES completion:nil];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)didTapShareButton
|
2016-09-11 22:53:12 +02:00
|
|
|
{
|
2017-06-09 00:10:02 +02:00
|
|
|
[self showSharingActivityWithCompletion:nil];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)showScanner
|
|
|
|
{
|
|
|
|
FingerprintViewScanController *scanView = [FingerprintViewScanController new];
|
|
|
|
[scanView configureWithRecipientId:self.recipientId];
|
|
|
|
[self.navigationController pushViewController:scanView animated:YES];
|
2014-12-27 01:08:05 +01:00
|
|
|
}
|
|
|
|
|
2017-06-09 16:11:15 +02:00
|
|
|
- (void)learnMoreButtonTapped:(UIGestureRecognizer *)gestureRecognizer
|
2017-06-08 20:55:26 +02:00
|
|
|
{
|
|
|
|
if (gestureRecognizer.state == UIGestureRecognizerStateRecognized) {
|
2017-06-09 16:11:15 +02:00
|
|
|
NSString *learnMoreURL = @"https://support.whispersystems.org/hc/en-us/articles/"
|
|
|
|
@"213134107-How-do-I-verify-the-person-I-m-sending-messages-to-is-who-they-say-they-"
|
|
|
|
@"are-";
|
|
|
|
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:learnMoreURL]];
|
2017-06-08 20:55:26 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)fingerprintLabelTapped:(UIGestureRecognizer *)gestureRecognizer
|
|
|
|
{
|
|
|
|
if (gestureRecognizer.state == UIGestureRecognizerStateRecognized) {
|
|
|
|
[self showSharingActivityWithCompletion:nil];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)fingerprintViewTapped:(UIGestureRecognizer *)gestureRecognizer
|
|
|
|
{
|
|
|
|
if (gestureRecognizer.state == UIGestureRecognizerStateRecognized) {
|
2017-06-09 16:11:15 +02:00
|
|
|
[self showScanner];
|
2017-06-08 20:55:26 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-09-21 14:37:51 +02:00
|
|
|
#pragma mark - Logging
|
|
|
|
|
2016-09-11 22:53:12 +02:00
|
|
|
+ (NSString *)tag
|
|
|
|
{
|
|
|
|
return [NSString stringWithFormat:@"[%@]", self.class];
|
|
|
|
}
|
2015-01-22 10:49:19 +01:00
|
|
|
|
2016-09-11 22:53:12 +02:00
|
|
|
- (NSString *)tag
|
|
|
|
{
|
|
|
|
return self.class.tag;
|
2014-10-29 21:58:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@end
|
2016-09-11 22:53:12 +02:00
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_END
|