Signup flow: request call.
• enables the "Send Again button" • enables the display of the number the user entered in the Registration View in this subsequent scene (so they can see whether they should go back or not) • enables the "call me instead button" Reviewed-by: @FredericJacobs
This commit is contained in:
parent
83cc102f98
commit
5b0914c038
|
@ -1,41 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
|
||||
<false/>
|
||||
<key>IDESourceControlProjectIdentifier</key>
|
||||
<string>DA00CCAC-808E-4CDA-A72F-CB8431C155C0</string>
|
||||
<key>IDESourceControlProjectName</key>
|
||||
<string>Signal</string>
|
||||
<key>IDESourceControlProjectOriginsDictionary</key>
|
||||
<dict>
|
||||
<key>5D79A077E31B3FE97A3C6613CBFFDD71C314D14C</key>
|
||||
<string>https://github.com/WhisperSystems/Signal-iOS</string>
|
||||
</dict>
|
||||
<key>IDESourceControlProjectPath</key>
|
||||
<string>Signal.xcworkspace</string>
|
||||
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
|
||||
<dict>
|
||||
<key>5D79A077E31B3FE97A3C6613CBFFDD71C314D14C</key>
|
||||
<string>..</string>
|
||||
</dict>
|
||||
<key>IDESourceControlProjectURL</key>
|
||||
<string>https://github.com/WhisperSystems/Signal-iOS</string>
|
||||
<key>IDESourceControlProjectVersion</key>
|
||||
<integer>111</integer>
|
||||
<key>IDESourceControlProjectWCCIdentifier</key>
|
||||
<string>5D79A077E31B3FE97A3C6613CBFFDD71C314D14C</string>
|
||||
<key>IDESourceControlProjectWCConfigurations</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
|
||||
<string>public.vcs.git</string>
|
||||
<key>IDESourceControlWCCIdentifierKey</key>
|
||||
<string>5D79A077E31B3FE97A3C6613CBFFDD71C314D14C</string>
|
||||
<key>IDESourceControlWCCName</key>
|
||||
<string>Signal-iOS</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
|
@ -35,6 +35,9 @@
|
|||
</tableViewCell>
|
||||
</prototypes>
|
||||
<sections/>
|
||||
<variation key="heightClass=regular-widthClass=compact" misplaced="YES">
|
||||
<rect key="frame" x="0.0" y="-44" width="410" height="844"/>
|
||||
</variation>
|
||||
<connections>
|
||||
<outlet property="dataSource" destination="MY2-bB-USa" id="kop-Y6-6DR"/>
|
||||
<outlet property="delegate" destination="MY2-bB-USa" id="vmj-PA-2Od"/>
|
||||
|
@ -1184,6 +1187,10 @@ Lorem ipsum : Quick explanation of Fingerprints</string>
|
|||
<view key="view" contentMode="scaleToFill" id="Zgb-Uj-73M">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<userGuides>
|
||||
<userLayoutGuide location="199" affinity="minX"/>
|
||||
<userLayoutGuide location="199" affinity="minX"/>
|
||||
</userGuides>
|
||||
<subviews>
|
||||
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Code" textAlignment="center" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="yK6-ad-ihc">
|
||||
<rect key="frame" x="0.0" y="-30" width="97" height="30"/>
|
||||
|
@ -1316,11 +1323,47 @@ Lorem ipsum : Quick explanation of Fingerprints</string>
|
|||
<include reference="EoB-jn-bwV"/>
|
||||
</mask>
|
||||
</variation>
|
||||
<connections>
|
||||
<action selector="sendCodeSMSAction:" destination="3Uo-Ow-qOD" eventType="touchUpInside" id="jWS-dh-jsO"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="2I5-tm-rMi">
|
||||
<rect key="frame" x="-23" y="-15" width="46" height="30"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="200" id="UiP-hG-L0t"/>
|
||||
<constraint firstAttribute="height" constant="30" id="UzF-a6-vRO"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" name="HelveticaNeue-Thin" family="Helvetica Neue" pointSize="19"/>
|
||||
<state key="normal" title="Call me instead">
|
||||
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<variation key="default">
|
||||
<mask key="constraints">
|
||||
<exclude reference="UiP-hG-L0t"/>
|
||||
<exclude reference="UzF-a6-vRO"/>
|
||||
</mask>
|
||||
</variation>
|
||||
<variation key="heightClass=regular-widthClass=compact">
|
||||
<mask key="constraints">
|
||||
<include reference="UiP-hG-L0t"/>
|
||||
<include reference="UzF-a6-vRO"/>
|
||||
</mask>
|
||||
</variation>
|
||||
<connections>
|
||||
<action selector="sendCodeVoiceAction:" destination="3Uo-Ow-qOD" eventType="touchUpInside" id="YWt-aa-RUW"/>
|
||||
</connections>
|
||||
</button>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" enabled="NO" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="80G-wF-Ki5">
|
||||
<rect key="frame" x="0.0" y="-21" width="42" height="21"/>
|
||||
<fontDescription key="fontDescription" name="HelveticaNeue-Thin" family="Helvetica Neue" pointSize="16"/>
|
||||
<color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="centerX" secondItem="49d-7m-0k6" secondAttribute="centerX" id="601-ZF-xlq"/>
|
||||
<constraint firstAttribute="centerX" secondItem="80G-wF-Ki5" secondAttribute="centerX" id="9Ob-8g-gcU"/>
|
||||
<constraint firstAttribute="centerX" secondItem="PHu-da-Fan" secondAttribute="centerX" id="9hL-iF-RZL"/>
|
||||
<constraint firstAttribute="centerX" secondItem="yK6-ad-ihc" secondAttribute="centerX" id="AIw-5F-Lfj"/>
|
||||
<constraint firstItem="HYX-Cr-u0w" firstAttribute="top" secondItem="49d-7m-0k6" secondAttribute="bottom" constant="8" id="J0Z-pe-1GZ"/>
|
||||
|
@ -1329,9 +1372,12 @@ Lorem ipsum : Quick explanation of Fingerprints</string>
|
|||
<constraint firstItem="PHu-da-Fan" firstAttribute="top" secondItem="yK6-ad-ihc" secondAttribute="bottom" constant="67" id="M8V-ht-k2s"/>
|
||||
<constraint firstAttribute="centerX" secondItem="260-Dq-fnd" secondAttribute="centerX" id="Mb0-Wd-GVx"/>
|
||||
<constraint firstItem="MHI-1c-yZH" firstAttribute="top" secondItem="IVn-LE-fmp" secondAttribute="bottom" constant="8" id="StQ-SP-FMd"/>
|
||||
<constraint firstAttribute="centerX" secondItem="2I5-tm-rMi" secondAttribute="centerX" id="Wkv-S5-yMl"/>
|
||||
<constraint firstItem="yK6-ad-ihc" firstAttribute="leading" secondItem="Zgb-Uj-73M" secondAttribute="leadingMargin" constant="84" id="c47-uE-awH"/>
|
||||
<constraint firstAttribute="bottom" secondItem="2I5-tm-rMi" secondAttribute="bottom" constant="75" id="cJz-3Q-q4i"/>
|
||||
<constraint firstItem="49d-7m-0k6" firstAttribute="top" secondItem="OuY-yn-ZQb" secondAttribute="bottom" constant="36" id="dP3-9o-eNP"/>
|
||||
<constraint firstItem="260-Dq-fnd" firstAttribute="leading" secondItem="Zgb-Uj-73M" secondAttribute="leadingMargin" constant="84" id="dvC-Xu-1F4"/>
|
||||
<constraint firstAttribute="bottom" secondItem="80G-wF-Ki5" secondAttribute="bottom" constant="46" id="eco-TD-FoN"/>
|
||||
<constraint firstAttribute="trailingMargin" secondItem="260-Dq-fnd" secondAttribute="trailing" constant="84" id="mNE-hX-tgd"/>
|
||||
<constraint firstAttribute="centerX" secondItem="HYX-Cr-u0w" secondAttribute="centerX" id="oPh-8d-yYT"/>
|
||||
<constraint firstItem="49d-7m-0k6" firstAttribute="leading" secondItem="Zgb-Uj-73M" secondAttribute="leadingMargin" id="oSp-IH-lVa"/>
|
||||
|
@ -1349,17 +1395,23 @@ Lorem ipsum : Quick explanation of Fingerprints</string>
|
|||
<exclude reference="PHu-da-Fan"/>
|
||||
<exclude reference="IVn-LE-fmp"/>
|
||||
<exclude reference="HYX-Cr-u0w"/>
|
||||
<exclude reference="2I5-tm-rMi"/>
|
||||
<exclude reference="80G-wF-Ki5"/>
|
||||
</mask>
|
||||
<mask key="constraints">
|
||||
<exclude reference="601-ZF-xlq"/>
|
||||
<exclude reference="JFF-KZ-h6I"/>
|
||||
<exclude reference="dP3-9o-eNP"/>
|
||||
<exclude reference="oSp-IH-lVa"/>
|
||||
<exclude reference="9Ob-8g-gcU"/>
|
||||
<exclude reference="eco-TD-FoN"/>
|
||||
<exclude reference="StQ-SP-FMd"/>
|
||||
<exclude reference="AIw-5F-Lfj"/>
|
||||
<exclude reference="LsW-Pq-PRZ"/>
|
||||
<exclude reference="c47-uE-awH"/>
|
||||
<exclude reference="yuF-1t-XeW"/>
|
||||
<exclude reference="Wkv-S5-yMl"/>
|
||||
<exclude reference="cJz-3Q-q4i"/>
|
||||
<exclude reference="J0Z-pe-1GZ"/>
|
||||
<exclude reference="oPh-8d-yYT"/>
|
||||
<exclude reference="rmZ-rb-JoP"/>
|
||||
|
@ -1379,17 +1431,23 @@ Lorem ipsum : Quick explanation of Fingerprints</string>
|
|||
<include reference="PHu-da-Fan"/>
|
||||
<include reference="IVn-LE-fmp"/>
|
||||
<include reference="HYX-Cr-u0w"/>
|
||||
<include reference="2I5-tm-rMi"/>
|
||||
<include reference="80G-wF-Ki5"/>
|
||||
</mask>
|
||||
<mask key="constraints">
|
||||
<include reference="601-ZF-xlq"/>
|
||||
<include reference="JFF-KZ-h6I"/>
|
||||
<include reference="dP3-9o-eNP"/>
|
||||
<include reference="oSp-IH-lVa"/>
|
||||
<include reference="9Ob-8g-gcU"/>
|
||||
<include reference="eco-TD-FoN"/>
|
||||
<include reference="StQ-SP-FMd"/>
|
||||
<include reference="AIw-5F-Lfj"/>
|
||||
<include reference="LsW-Pq-PRZ"/>
|
||||
<include reference="c47-uE-awH"/>
|
||||
<include reference="yuF-1t-XeW"/>
|
||||
<include reference="Wkv-S5-yMl"/>
|
||||
<include reference="cJz-3Q-q4i"/>
|
||||
<include reference="J0Z-pe-1GZ"/>
|
||||
<include reference="oPh-8d-yYT"/>
|
||||
<include reference="rmZ-rb-JoP"/>
|
||||
|
@ -1406,6 +1464,10 @@ Lorem ipsum : Quick explanation of Fingerprints</string>
|
|||
<connections>
|
||||
<outlet property="challengeButton" destination="PHu-da-Fan" id="hd0-4C-XqL"/>
|
||||
<outlet property="challengeTextField" destination="yK6-ad-ihc" id="cnh-li-Z6O"/>
|
||||
<outlet property="phoneNumberEntered" destination="80G-wF-Ki5" id="rRv-vj-0Eo"/>
|
||||
<outlet property="sendCodeViaSMSAgainButton" destination="HYX-Cr-u0w" id="80C-tQ-khX"/>
|
||||
<outlet property="sendCodeViaVoiceButton" destination="2I5-tm-rMi" id="h8C-UP-pj7"/>
|
||||
<segue destination="QKN-cj-wuH" kind="show" identifier="verifiedSegue" id="Wd2-mW-FfR"/>
|
||||
</connections>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="WLS-Zq-ncm" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
|
@ -1470,7 +1532,7 @@ Lorem ipsum : Quick explanation of Fingerprints</string>
|
|||
<objects>
|
||||
<tableViewController id="0XE-hu-8cu" customClass="ContactDetailTableViewController" sceneMemberID="viewController">
|
||||
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" dataMode="prototypes" style="plain" separatorStyle="default" showsSelectionImmediatelyOnTouchBegin="NO" rowHeight="150" sectionHeaderHeight="22" sectionFooterHeight="22" id="RoU-YO-d5P">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="551"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" red="0.94901960780000005" green="0.94901960780000005" blue="0.94901960780000005" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<inset key="separatorInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
|
||||
|
@ -2875,7 +2937,8 @@ Licensed under the GPLv3</string>
|
|||
<exclude reference="ZIm-Uq-bM8"/>
|
||||
</mask>
|
||||
</variation>
|
||||
<variation key="heightClass=regular-widthClass=compact">
|
||||
<variation key="heightClass=regular-widthClass=compact" misplaced="YES">
|
||||
<rect key="frame" x="0.0" y="20" width="400" height="100"/>
|
||||
<mask key="subviews">
|
||||
<include reference="gbm-B5-gCc"/>
|
||||
<include reference="Ul8-NY-i4c"/>
|
||||
|
@ -2929,6 +2992,9 @@ Licensed under the GPLv3</string>
|
|||
</tableViewCellContentView>
|
||||
</tableViewCell>
|
||||
</prototypes>
|
||||
<variation key="heightClass=regular-widthClass=compact" misplaced="YES">
|
||||
<rect key="frame" x="0.0" y="128" width="400" height="672"/>
|
||||
</variation>
|
||||
<connections>
|
||||
<outlet property="dataSource" destination="bDi-2Q-XOC" id="VPO-ms-bH1"/>
|
||||
<outlet property="delegate" destination="bDi-2Q-XOC" id="rKM-jX-C39"/>
|
||||
|
|
|
@ -5,15 +5,33 @@
|
|||
// Created by Dylan Bourgeois on 13/11/14.
|
||||
// Copyright (c) 2014 Open Whisper Systems. All rights reserved.
|
||||
//
|
||||
// This class allows the user to send the server their verification code and request new codes to be sent via SMS or voice.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface CodeVerificationViewController : UIViewController
|
||||
|
||||
// Where the user enters the verification code they wish to document
|
||||
@property(nonatomic, strong) IBOutlet UITextField* challengeTextField;
|
||||
|
||||
// User action buttons
|
||||
@property(nonatomic, strong) IBOutlet UIButton* challengeButton;
|
||||
@property(nonatomic, strong) IBOutlet UIButton* sendCodeViaSMSAgainButton;
|
||||
@property(nonatomic, strong) IBOutlet UIButton* sendCodeViaVoiceButton;
|
||||
|
||||
// Displays phone number entered in previous step. There is a UI option (segue) which allows the user to go back and edit this.
|
||||
@property (nonatomic, strong) IBOutlet UILabel* phoneNumberEntered;
|
||||
|
||||
|
||||
// User verifies code
|
||||
- (IBAction)verifyChallengeAction:(id)sender;
|
||||
// User requests new code via SMS
|
||||
- (IBAction)sendCodeSMSAction:(id)sender;
|
||||
// User requests new code via voice phone call
|
||||
- (IBAction)sendCodeVoiceAction:(id)sender;
|
||||
|
||||
// This ensures the user doesn't keep creating server requests before the server has responded for all buttons that result in server requests
|
||||
-(void)enableServerActions:(BOOL)enabled;
|
||||
|
||||
@end
|
||||
|
|
|
@ -31,7 +31,8 @@
|
|||
-(void)viewWillAppear:(BOOL)animated
|
||||
{
|
||||
[super viewWillAppear:animated];
|
||||
[_challengeButton setEnabled:YES];
|
||||
[self enableServerActions:YES];
|
||||
[_phoneNumberEntered setText:[SignalKeyingStorage.localNumber toE164]];
|
||||
}
|
||||
|
||||
- (void)didReceiveMemoryWarning {
|
||||
|
@ -41,7 +42,7 @@
|
|||
|
||||
- (IBAction)verifyChallengeAction:(id)sender {
|
||||
|
||||
[_challengeButton setEnabled:NO];
|
||||
[self enableServerActions:NO];
|
||||
[_challengeTextField resignFirstResponder];
|
||||
|
||||
[self registerWithSuccess:^{
|
||||
|
@ -49,7 +50,7 @@
|
|||
[self.navigationController dismissViewControllerAnimated:YES completion:nil];
|
||||
} failure:^(NSError *error) {
|
||||
[self showAlertForError:error];
|
||||
[_challengeButton setEnabled:YES];
|
||||
[self enableServerActions:YES];
|
||||
}];
|
||||
}
|
||||
|
||||
|
@ -124,6 +125,61 @@
|
|||
return error;
|
||||
}
|
||||
|
||||
#pragma mark - Send codes again
|
||||
- (IBAction)sendCodeSMSAction:(id)sender {
|
||||
|
||||
[self enableServerActions:NO];
|
||||
|
||||
|
||||
[[RPServerRequestsManager sharedInstance]performRequest:[RPAPICall requestVerificationCode] success:^(NSURLSessionDataTask *task, id responseObject) {
|
||||
|
||||
[self enableServerActions:YES];
|
||||
} failure:^(NSURLSessionDataTask *task, NSError *error) {
|
||||
|
||||
DDLogError(@"Registration failed with information %@", error.description);
|
||||
|
||||
UIAlertView *registrationErrorAV = [[UIAlertView alloc]initWithTitle:REGISTER_ERROR_ALERT_VIEW_TITLE
|
||||
message:REGISTER_ERROR_ALERT_VIEW_BODY
|
||||
delegate:nil
|
||||
cancelButtonTitle:REGISTER_ERROR_ALERT_VIEW_DISMISS
|
||||
otherButtonTitles:nil, nil];
|
||||
|
||||
[registrationErrorAV show];
|
||||
|
||||
[self enableServerActions:YES];
|
||||
}];
|
||||
}
|
||||
|
||||
- (IBAction)sendCodeVoiceAction:(id)sender {
|
||||
|
||||
[self enableServerActions:NO];
|
||||
|
||||
|
||||
[[RPServerRequestsManager sharedInstance]performRequest:[RPAPICall requestVerificationCodeWithVoice] success:^(NSURLSessionDataTask *task, id responseObject) {
|
||||
|
||||
[self enableServerActions:YES];
|
||||
} failure:^(NSURLSessionDataTask *task, NSError *error) {
|
||||
|
||||
DDLogError(@"Registration failed with information %@", error.description);
|
||||
|
||||
UIAlertView *registrationErrorAV = [[UIAlertView alloc]initWithTitle:REGISTER_ERROR_ALERT_VIEW_TITLE
|
||||
message:REGISTER_ERROR_ALERT_VIEW_BODY
|
||||
delegate:nil
|
||||
cancelButtonTitle:REGISTER_ERROR_ALERT_VIEW_DISMISS
|
||||
otherButtonTitles:nil, nil];
|
||||
|
||||
[registrationErrorAV show];
|
||||
|
||||
[self enableServerActions:YES];
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)enableServerActions:(BOOL)enabled {
|
||||
[_challengeButton setEnabled:enabled];
|
||||
[_sendCodeViaSMSAgainButton setEnabled:enabled];
|
||||
[_sendCodeViaVoiceButton setEnabled:enabled];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - Keyboard notifications
|
||||
|
||||
|
|
|
@ -24,10 +24,6 @@
|
|||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
|
||||
if (![TSAccountManager isRegistered]){
|
||||
[self performSegueWithIdentifier:@"showSignupFlow" sender:self];
|
||||
}
|
||||
|
||||
self.dbConnection = [TSStorageManager sharedManager].newDatabaseConnection;
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
|
@ -36,6 +32,12 @@
|
|||
object:nil];
|
||||
}
|
||||
|
||||
- (void)viewDidAppear:(BOOL)animated{
|
||||
if (![TSAccountManager isRegistered]){
|
||||
[self performSegueWithIdentifier:@"showSignupFlow" sender:self];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)yapDatabaseModified:(NSNotification *)notification {
|
||||
__block NSUInteger numberOfItems;
|
||||
[self.dbConnection readWithBlock:^(YapDatabaseReadTransaction *transaction) {
|
||||
|
|
Loading…
Reference in New Issue