Skip to content

Commit

Permalink
Merge pull request #37 from E-know/dev/universalLink
Browse files Browse the repository at this point in the history
[HotFix] Miss TabView Selection
  • Loading branch information
unnnyong authored Sep 19, 2022
2 parents 3484872 + c019d2f commit 6142771
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 21 deletions.
Binary file added .DS_Store
Binary file not shown.
11 changes: 11 additions & 0 deletions .well-known/apple-app-site-association
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"applinks": {
"apps": [],
"details": [
{
"appID": "76AJ433CP5.com.kim.AsyncSwift",
"paths": [ "*" ]
}
]
}
}
10 changes: 10 additions & 0 deletions AsyncSwift/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@
<string>com.googleusercontent.apps.388113408677-32e2k6kqi1ags2n6bmompvpuu196ci0k</string>
</array>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>Deep Link</string>
<key>CFBundleURLSchemes</key>
<array>
<string>asyncswift</string>
</array>
</dict>
</array>
<key>FirebaseAppDelegateProxyEnabled</key>
<false/>
Expand Down
7 changes: 4 additions & 3 deletions AsyncSwift/Observed/AppData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ final class AppData: ObservableObject {
}

func checkLink(url: URL) -> Bool {
// URL Example = https://www.asyncswift.info?tab=ticketing
// URL Example = https://www.asyncswift.info?tab=event
// URL Example = https://asyncswift.info?tab=stamp
// URL Example = https://asyncswift.info?tab=event
guard URLComponents(url: url, resolvingAgainstBaseURL: true)?.host != nil else { return false }

print(url)
var queries = [String: String]()
for item in URLComponents(url: url, resolvingAgainstBaseURL: true)?.queryItems ?? [] {
queries[item.name] = item.value
Expand Down Expand Up @@ -64,6 +64,7 @@ final class AppData: ObservableObject {
DispatchQueue.main.async { [weak self] in
guard let self = self else {return }
do {
print(data)
let stamp = try JSONDecoder().decode(Stamp.self, from: data)
self.currentStamp = stamp
} catch {
Expand Down
2 changes: 1 addition & 1 deletion AsyncSwift/Views/MainTabView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import SwiftUI
struct MainTabView: View {
@EnvironmentObject var appData: AppData
var body: some View {
TabView {
TabView(selection: $appData.currentTab) {
ForEach(Tab.allCases, id: \.self) { tab in
tab.view.tabItem {
Image(systemName: tab.systemImageName)
Expand Down
17 changes: 0 additions & 17 deletions apple-app-site-association

This file was deleted.

0 comments on commit 6142771

Please sign in to comment.