Skip to content
Snippets Groups Projects
Commit 97eef41c authored by Bruno Muniz's avatar Bruno Muniz :apple:
Browse files

Merge branch 'new-universal-link' into 'development'

Update universal link

See merge request elixxir/client-ios!63
parents baf022c3 7d227690
No related branches found
No related tags found
3 merge requests!71Releasing v1.1.5 (214),!67v1.1.5 b(203),!63Update universal link
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<string>development</string> <string>development</string>
<key>com.apple.developer.associated-domains</key> <key>com.apple.developer.associated-domains</key>
<array> <array>
<string>applinks:xx.network</string> <string>applinks:elixxir.io</string>
</array> </array>
<key>com.apple.developer.icloud-container-identifiers</key> <key>com.apple.developer.icloud-container-identifiers</key>
<array> <array>
......
...@@ -165,8 +165,8 @@ public class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -165,8 +165,8 @@ public class AppDelegate: UIResponder, UIApplicationDelegate {
func getUsernameFromInvitationDeepLink(_ url: URL) -> String? { func getUsernameFromInvitationDeepLink(_ url: URL) -> String? {
if let components = URLComponents(url: url, resolvingAgainstBaseURL: false), if let components = URLComponents(url: url, resolvingAgainstBaseURL: false),
components.scheme == "https", components.scheme == "https",
components.host == "xx.network", components.host == "elixxir.io",
components.path == "/messenger/invitation", components.path == "/connect",
let queryItem = components.queryItems?.first(where: { $0.name == "username" }), let queryItem = components.queryItems?.first(where: { $0.name == "username" }),
let username = queryItem.value { let username = queryItem.value {
return username return username
......
...@@ -42,6 +42,6 @@ final class MenuViewModel { ...@@ -42,6 +42,6 @@ final class MenuViewModel {
} }
var referralDeeplink: String { var referralDeeplink: String {
"https://xx.network/messenger/invitation?username=\(username)" "https://elixxir.io/connect?username=\(username)"
} }
} }
...@@ -5,31 +5,31 @@ import XCTest ...@@ -5,31 +5,31 @@ import XCTest
final class AppDelegateTests: XCTestCase { final class AppDelegateTests: XCTestCase {
func test_invitationUniversalLink() { func test_invitationUniversalLink() {
XCTAssertNil(getUsernameFromInvitationDeepLink( XCTAssertNil(getUsernameFromInvitationDeepLink(
URL(string: "https://xx.network/messenger/invite?username=some")! URL(string: "https://elixxir.io/connecting?username=some")!
)) ))
XCTAssertNil(getUsernameFromInvitationDeepLink( XCTAssertNil(getUsernameFromInvitationDeepLink(
URL(string: "http://xx.network/messenger/invitation?username=some")! URL(string: "http://elixxir.io/connect?username=some")!
)) ))
XCTAssertNil(getUsernameFromInvitationDeepLink( XCTAssertNil(getUsernameFromInvitationDeepLink(
URL(string: "https://network.xx/messenger/invitation?username=some")! URL(string: "https://io.elixxir/connect?username=some")!
)) ))
XCTAssertEqual(getUsernameFromInvitationDeepLink( XCTAssertEqual(getUsernameFromInvitationDeepLink(
URL(string: "https://xx.network/messenger/invitation?username=brad")! URL(string: "https://elixxir.io/connect?username=brad")!
), "brad") ), "brad")
XCTAssertNil(getUsernameFromInvitationDeepLink( XCTAssertNil(getUsernameFromInvitationDeepLink(
URL(string: "https://xx.network/messenger/invitation?password=value")! URL(string: "https://elixxir.io/connect?password=value")!
)) ))
XCTAssertNil(getUsernameFromInvitationDeepLink( XCTAssertNil(getUsernameFromInvitationDeepLink(
URL(string: "https://xx.network/xxmessenger/invitation?username=some")! URL(string: "https://elixxir.io/connect?usernamer=some")!
)) ))
XCTAssertNotEqual(getUsernameFromInvitationDeepLink( XCTAssertNotEqual(getUsernameFromInvitationDeepLink(
URL(string: "https://xx.network/messenger/invitation?username=anderson")! URL(string: "https://elixxir.io/connect?username=anderson")!
), "silva") ), "silva")
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment