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

Update universal link

parent baf022c3
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 @@
<string>development</string>
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:xx.network</string>
<string>applinks:elixxir.io</string>
</array>
<key>com.apple.developer.icloud-container-identifiers</key>
<array>
......
......@@ -165,8 +165,8 @@ public class AppDelegate: UIResponder, UIApplicationDelegate {
func getUsernameFromInvitationDeepLink(_ url: URL) -> String? {
if let components = URLComponents(url: url, resolvingAgainstBaseURL: false),
components.scheme == "https",
components.host == "xx.network",
components.path == "/messenger/invitation",
components.host == "elixxir.io",
components.path == "/connect",
let queryItem = components.queryItems?.first(where: { $0.name == "username" }),
let username = queryItem.value {
return username
......
......@@ -42,6 +42,6 @@ final class MenuViewModel {
}
var referralDeeplink: String {
"https://xx.network/messenger/invitation?username=\(username)"
"https://elixxir.io/connect?username=\(username)"
}
}
......@@ -5,31 +5,31 @@ import XCTest
final class AppDelegateTests: XCTestCase {
func test_invitationUniversalLink() {
XCTAssertNil(getUsernameFromInvitationDeepLink(
URL(string: "https://xx.network/messenger/invite?username=some")!
URL(string: "https://elixxir.io/connecting?username=some")!
))
XCTAssertNil(getUsernameFromInvitationDeepLink(
URL(string: "http://xx.network/messenger/invitation?username=some")!
URL(string: "http://elixxir.io/connect?username=some")!
))
XCTAssertNil(getUsernameFromInvitationDeepLink(
URL(string: "https://network.xx/messenger/invitation?username=some")!
URL(string: "https://io.elixxir/connect?username=some")!
))
XCTAssertEqual(getUsernameFromInvitationDeepLink(
URL(string: "https://xx.network/messenger/invitation?username=brad")!
URL(string: "https://elixxir.io/connect?username=brad")!
), "brad")
XCTAssertNil(getUsernameFromInvitationDeepLink(
URL(string: "https://xx.network/messenger/invitation?password=value")!
URL(string: "https://elixxir.io/connect?password=value")!
))
XCTAssertNil(getUsernameFromInvitationDeepLink(
URL(string: "https://xx.network/xxmessenger/invitation?username=some")!
URL(string: "https://elixxir.io/connect?usernamer=some")!
))
XCTAssertNotEqual(getUsernameFromInvitationDeepLink(
URL(string: "https://xx.network/messenger/invitation?username=anderson")!
URL(string: "https://elixxir.io/connect?username=anderson")!
), "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