Permalimks: Use the beta path of the web app instead of /develop

This commit is contained in:
manuroe 2016-05-09 10:23:46 +02:00
parent 447de39743
commit 7437aa6a9a
5 changed files with 17 additions and 9 deletions

View file

@ -28,9 +28,13 @@
*/
+ (NSString*)presenceText:(MXUser*)user;
#pragma mark - Universal link
/**
The url of the Vector web application.
*/
+ (NSString*)webAppUrl;
/**
Detect if a URL is a universal link for the application.

View file

@ -61,6 +61,13 @@
#pragma mark - Universal link
+ (NSString *)webAppUrl
{
// FIXME: When available, use the prod Vector web app URL
return [[NSUserDefaults standardUserDefaults] objectForKey:@"webAppUrlBeta"];
//return [[NSUserDefaults standardUserDefaults] objectForKey:@"webAppUrlDev"];
}
+ (BOOL)isUniversalLink:(NSURL*)url
{
BOOL isUniversalLink = NO;

View file

@ -16,6 +16,8 @@
<string>matrix.org</string>
<key>webAppUrlDev</key>
<string>https://vector.im/develop</string>
<key>webAppUrlBeta</key>
<string>https://vector.im/beta</string>
<key>apnsDeviceToken</key>
<string></string>
<key>showAllEventsInRoomHistory</key>

View file

@ -1329,11 +1329,8 @@
[strongSelf cancelEventSelection];
// Create a permalink that is common to all Vector.im clients
// FIXME: When available, use the prod Vector web app URL
NSString *webAppUrl = [[NSUserDefaults standardUserDefaults] objectForKey:@"webAppUrlDev"];
NSString *permalink = [NSString stringWithFormat:@"%@/#/room/%@/%@",
webAppUrl,
[Tools webAppUrl],
selectedEvent.roomId,
selectedEvent.eventId];

View file

@ -17,6 +17,7 @@
#import "AuthInputsView.h"
#import "VectorDesignValues.h"
#import "Tools.h"
@interface AuthInputsView ()
{
@ -311,11 +312,8 @@
submittedEmail = [[MXK3PID alloc] initWithMedium:kMX3PIDMediumEmail andAddress:self.emailTextField.text];
// Create the next link that is common to all Vector.im clients
// FIXME: When available, use the prod Vector web app URL
NSString *webAppUrl = [[NSUserDefaults standardUserDefaults] objectForKey:@"webAppUrlDev"];
NSString *nextLink = [NSString stringWithFormat:@"%@/#/register?client_secret=%@&hs_url=%@&is_url=%@&session_id=%@",
webAppUrl,
[Tools webAppUrl],
[submittedEmail.clientSecret stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLHostAllowedCharacterSet]],
[restClient.homeserver stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLHostAllowedCharacterSet]],
[restClient.identityServer stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLHostAllowedCharacterSet]],