Registering by tapping SMS link.

pull/1/head
Frederic Jacobs 10 years ago
parent bf9084a7c8
commit f1c92b229a

@ -24,6 +24,19 @@
<string>2.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>org.whispersystems.signal</string>
<key>CFBundleURLSchemes</key>
<array>
<string>sgnl</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key>
<string>2.0</string>
<key>LOGS_EMAIL</key>

@ -18,7 +18,7 @@
#import "VersionMigrations.h"
#import "InitialViewController.h"
#import "CodeVerificationViewController.h"
#import <PastelogKit/Pastelog.h>
@ -155,6 +155,28 @@
[PushManager.sharedManager.userNotificationFutureSource trySetResult:notificationSettings];
}
-(BOOL) application:(UIApplication*)application openURL:(NSURL*)url sourceApplication:(NSString*)sourceApplication annotation:(id)annotation {
if ([url.scheme isEqualToString:@"sgnl"]) {
if ([url.host hasPrefix:@"verify"] && ![TSAccountManager isRegistered]) {
UIViewController *controller = self.window.rootViewController.presentedViewController.presentedViewController;
if ([controller isKindOfClass:[CodeVerificationViewController class]]) {
CodeVerificationViewController *cvvc = (CodeVerificationViewController*)controller;
NSString *verificationCode = [url.path substringFromIndex:1];
cvvc.challengeTextField.text = verificationCode;
[cvvc verifyChallengeAction:nil];
} else{
DDLogWarn(@"Not the verification view controller we expected. Got %@ instead", NSStringFromClass(controller.class));
}
} else{
DDLogWarn(@"Application opened with an unknown URL action: %@", url.host);
}
} else {
DDLogWarn(@"Application opened with an unknown URL scheme: %@", url.scheme);
}
return NO;
}
-(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
ResponderSessionDescriptor* call;
@try {

@ -51,8 +51,8 @@ static unsigned char DH3K_PRIME[]={
return [Environment environmentWithLogging:logging
andErrorNoter:errorNoter
andServerPort:31337
andMasterServerHostName:@"testing.whispersystems.org"
andDefaultRelayName:@"testing"
andMasterServerHostName:@"master.whispersystems.org"
andDefaultRelayName:@"relay"
andRelayServerHostNameSuffix:@"whispersystems.org"
andCertificate:[Certificate certificateFromResourcePath:@"whisperReal" ofType:@"cer"]
andCurrentRegionCodeForPhoneNumbers:[(NSLocale*)NSLocale.currentLocale objectForKey:NSLocaleCountryCode]

@ -29,9 +29,10 @@ typedef enum {
#define textSecureHTTPTimeOut 10
#define textSecureWebSocketAPI @"wss://textsecure-service-staging.whispersystems.org/v1/websocket/"
//#define textSecureServerURL @"https://textsecure-service.whispersystems.org/"
#define textSecureServerURL @"https://textsecure-service-staging.whispersystems.org/"
#define textSecureWebSocketAPI @"wss://textsecure-service.whispersystems.org/v1/websocket/"
#define textSecureServerURL @"https://textsecure-service.whispersystems.org/"
//#define textSecureServerURL @"https://textsecure-service-staging.whispersystems.org/"
#define textSecureGeneralAPI @"v1"
#define textSecureAccountsAPI @"v1/accounts"

@ -12,4 +12,6 @@
@property(nonatomic, strong) IBOutlet UITextField* challengeTextField;
- (IBAction)verifyChallengeAction:(id)sender;
@end

@ -299,6 +299,7 @@ static NSInteger connectingFlashCounter = 0;
}
-(void) dismissViewWithOptionalDelay:(BOOL) useDelay {
[UIDevice.currentDevice setProximityMonitoringEnabled:NO];
if(useDelay && UIApplicationStateActive == [UIApplication.sharedApplication applicationState]){
[self dismissViewControllerAfterDelay:END_CALL_CLEANUP_DELAY];
}else{

Loading…
Cancel
Save