mirror of https://github.com/oxen-io/session-ios
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.0 KiB
Objective-C
34 lines
1.0 KiB
Objective-C
//
|
|
// TSRegisterWithTokenRequest.m
|
|
// TextSecureKit
|
|
//
|
|
// Created by Frederic Jacobs on 14/11/14.
|
|
// Copyright (c) 2014 Open Whisper Systems. All rights reserved.
|
|
//
|
|
|
|
#import "TSConstants.h"
|
|
#import "TSAccountManager.h"
|
|
#import "TSRegisterWithTokenRequest.h"
|
|
|
|
@implementation TSRegisterWithTokenRequest
|
|
|
|
- (TSRequest*) initWithVerificationToken:(NSString*)verificationCode
|
|
signalingKey:(NSString*)signalingKey
|
|
authKey:(NSString*)authKey
|
|
number:(NSString*)number
|
|
{
|
|
self = [super initWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@/token/%@", textSecureAccountsAPI, verificationCode]]];
|
|
|
|
self.numberToValidate = number;
|
|
|
|
[self.parameters addEntriesFromDictionary:@{@"signalingKey": signalingKey, @"AuthKey": authKey, @"supportsSMS": @FALSE, @"registrationId": [NSString stringWithFormat:@"%i",[TSAccountManager getOrGenerateRegistrationId]]}];
|
|
|
|
[self setHTTPMethod:@"PUT"];
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
@end
|
|
|