Skip to content

Commit 50e27ef

Browse files
authored
brb: Disable universal links in BRBConnectionHandler (#319)
* brb: Disable universal links in BRBConnectionHandler * Bump version to 2.12
1 parent 7510747 commit 50e27ef

File tree

4 files changed

+66
-25
lines changed

4 files changed

+66
-25
lines changed

Eatery.xcodeproj/project.pbxproj

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1360,6 +1360,7 @@
13601360
};
13611361
5DCE4A012533E6F90025D7BE /* [SwiftLint] */ = {
13621362
isa = PBXShellScriptBuildPhase;
1363+
alwaysOutOfDate = 1;
13631364
buildActionMask = 2147483647;
13641365
files = (
13651366
);
@@ -1374,7 +1375,7 @@
13741375
);
13751376
runOnlyForDeploymentPostprocessing = 0;
13761377
shellPath = /bin/sh;
1377-
shellScript = "# Type a script or drag a script file from your workspace to insert its path.\nswiftlint lint\n";
1378+
shellScript = "# Type a script or drag a script file from your workspace to insert its path.\n\n# Adds support for Apple Silicon brew directory\nexport PATH=\"$PATH:/opt/homebrew/bin\"\n\nswiftlint lint\n";
13781379
};
13791380
9DEA07504979C55F42669623 /* [CP] Check Pods Manifest.lock */ = {
13801381
isa = PBXShellScriptBuildPhase;
@@ -1634,7 +1635,7 @@
16341635
"@executable_path/Frameworks",
16351636
"@executable_path/../../Frameworks",
16361637
);
1637-
MARKETING_VERSION = 2.11;
1638+
MARKETING_VERSION = 2.12;
16381639
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
16391640
MTL_FAST_MATH = YES;
16401641
PRODUCT_BUNDLE_IDENTIFIER = org.cuappdev.eatery.debug.watchkitapp.watchkitextension;
@@ -1709,7 +1710,7 @@
17091710
"@executable_path/Frameworks",
17101711
"@executable_path/../../Frameworks",
17111712
);
1712-
MARKETING_VERSION = 2.11;
1713+
MARKETING_VERSION = 2.12;
17131714
MTL_ENABLE_DEBUG_INFO = NO;
17141715
MTL_FAST_MATH = YES;
17151716
PRODUCT_BUNDLE_IDENTIFIER = org.cuappdev.eatery.watchkitapp.watchkitextension;
@@ -1753,7 +1754,7 @@
17531754
);
17541755
IBSC_MODULE = Eatery_Watch_App_Extension;
17551756
INFOPLIST_FILE = "Eatery Watch App/Info.plist";
1756-
MARKETING_VERSION = 2.11;
1757+
MARKETING_VERSION = 2.12;
17571758
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
17581759
MTL_FAST_MATH = YES;
17591760
PRODUCT_BUNDLE_IDENTIFIER = org.cuappdev.eatery.debug.watchkitapp;
@@ -1824,7 +1825,7 @@
18241825
GCC_WARN_UNUSED_VARIABLE = YES;
18251826
IBSC_MODULE = Eatery_Watch_App_Extension;
18261827
INFOPLIST_FILE = "Eatery Watch App/Info.plist";
1827-
MARKETING_VERSION = 2.11;
1828+
MARKETING_VERSION = 2.12;
18281829
MTL_ENABLE_DEBUG_INFO = NO;
18291830
MTL_FAST_MATH = YES;
18301831
PRODUCT_BUNDLE_IDENTIFIER = org.cuappdev.eatery.watchkitapp;
@@ -1908,7 +1909,7 @@
19081909
CODE_SIGN_STYLE = Automatic;
19091910
COPY_PHASE_STRIP = NO;
19101911
CURRENT_PROJECT_VERSION = 1;
1911-
DEVELOPMENT_TEAM = N85YZLFRGD;
1912+
DEVELOPMENT_TEAM = ZGMCXU7X3U;
19121913
EXCLUDED_ARCHS = "";
19131914
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
19141915
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
@@ -1918,7 +1919,7 @@
19181919
"$(inherited)",
19191920
"@executable_path/Frameworks",
19201921
);
1921-
MARKETING_VERSION = 2.11;
1922+
MARKETING_VERSION = 2.12;
19221923
OTHER_LDFLAGS = "$(inherited)";
19231924
OTHER_SWIFT_FLAGS = "$(inherited) -DDEBUG";
19241925
PRODUCT_BUNDLE_IDENTIFIER = org.cuappdev.eatery.testflight;
@@ -1958,7 +1959,7 @@
19581959
);
19591960
IBSC_MODULE = Eatery_Watch_App_Extension;
19601961
INFOPLIST_FILE = "Eatery Watch App/Info.plist";
1961-
MARKETING_VERSION = 2.11;
1962+
MARKETING_VERSION = 2.12;
19621963
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
19631964
MTL_FAST_MATH = YES;
19641965
PRODUCT_BUNDLE_IDENTIFIER = org.cuappdev.eatery.testflight.watchkitapp;
@@ -2004,7 +2005,7 @@
20042005
"@executable_path/Frameworks",
20052006
"@executable_path/../../Frameworks",
20062007
);
2007-
MARKETING_VERSION = 2.11;
2008+
MARKETING_VERSION = 2.12;
20082009
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
20092010
MTL_FAST_MATH = YES;
20102011
PRODUCT_BUNDLE_IDENTIFIER = org.cuappdev.eatery.testflight.watchkitapp.watchkitextension;
@@ -2086,7 +2087,7 @@
20862087
CODE_SIGN_STYLE = Automatic;
20872088
COPY_PHASE_STRIP = NO;
20882089
CURRENT_PROJECT_VERSION = 1;
2089-
DEVELOPMENT_TEAM = N85YZLFRGD;
2090+
DEVELOPMENT_TEAM = ZGMCXU7X3U;
20902091
EXCLUDED_ARCHS = "";
20912092
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
20922093
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
@@ -2096,7 +2097,7 @@
20962097
"$(inherited)",
20972098
"@executable_path/Frameworks",
20982099
);
2099-
MARKETING_VERSION = 2.11;
2100+
MARKETING_VERSION = 2.12;
21002101
OTHER_LDFLAGS = "$(inherited)";
21012102
OTHER_SWIFT_FLAGS = "$(inherited) -DDEBUG";
21022103
PRODUCT_BUNDLE_IDENTIFIER = org.cuappdev.eatery.debug;
@@ -2171,7 +2172,7 @@
21712172
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
21722173
COPY_PHASE_STRIP = NO;
21732174
CURRENT_PROJECT_VERSION = 1;
2174-
DEVELOPMENT_TEAM = N85YZLFRGD;
2175+
DEVELOPMENT_TEAM = ZGMCXU7X3U;
21752176
EXCLUDED_ARCHS = "";
21762177
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
21772178
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
@@ -2181,7 +2182,7 @@
21812182
"$(inherited)",
21822183
"@executable_path/Frameworks",
21832184
);
2184-
MARKETING_VERSION = 2.11;
2185+
MARKETING_VERSION = 2.12;
21852186
OTHER_LDFLAGS = "$(inherited)";
21862187
PRODUCT_BUNDLE_IDENTIFIER = org.cuappdev.eatery;
21872188
PRODUCT_NAME = "$(TARGET_NAME)";

Eatery.xcodeproj/xcshareddata/xcschemes/Eatery Watch App (Notification).xcscheme

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,18 @@
5656
allowLocationSimulation = "YES"
5757
launchAutomaticallySubstyle = "8"
5858
notificationPayloadFile = "Eatery Watch App Extension/PushNotificationPayload.apns">
59-
<BuildableProductRunnable
60-
runnableDebuggingMode = "0">
59+
<RemoteRunnable
60+
runnableDebuggingMode = "2"
61+
BundleIdentifier = "com.apple.Carousel"
62+
RemotePath = "/Eatery">
6163
<BuildableReference
6264
BuildableIdentifier = "primary"
6365
BlueprintIdentifier = "5D05FF3123C2C14400EF8CC9"
6466
BuildableName = "Eatery Watch App.app"
6567
BlueprintName = "Eatery Watch App"
6668
ReferencedContainer = "container:Eatery.xcodeproj">
6769
</BuildableReference>
68-
</BuildableProductRunnable>
70+
</RemoteRunnable>
6971
</LaunchAction>
7072
<ProfileAction
7173
buildConfiguration = "Debug"
@@ -75,16 +77,27 @@
7577
debugDocumentVersioning = "YES"
7678
launchAutomaticallySubstyle = "8"
7779
notificationPayloadFile = "Eatery Watch App Extension/PushNotificationPayload.apns">
78-
<BuildableProductRunnable
79-
runnableDebuggingMode = "0">
80+
<RemoteRunnable
81+
runnableDebuggingMode = "2"
82+
BundleIdentifier = "com.apple.Carousel"
83+
RemotePath = "/Eatery">
8084
<BuildableReference
8185
BuildableIdentifier = "primary"
8286
BlueprintIdentifier = "5D05FF3123C2C14400EF8CC9"
8387
BuildableName = "Eatery Watch App.app"
8488
BlueprintName = "Eatery Watch App"
8589
ReferencedContainer = "container:Eatery.xcodeproj">
8690
</BuildableReference>
87-
</BuildableProductRunnable>
91+
</RemoteRunnable>
92+
<MacroExpansion>
93+
<BuildableReference
94+
BuildableIdentifier = "primary"
95+
BlueprintIdentifier = "5D05FF3123C2C14400EF8CC9"
96+
BuildableName = "Eatery Watch App.app"
97+
BlueprintName = "Eatery Watch App"
98+
ReferencedContainer = "container:Eatery.xcodeproj">
99+
</BuildableReference>
100+
</MacroExpansion>
88101
</ProfileAction>
89102
<AnalyzeAction
90103
buildConfiguration = "Debug">

Eatery.xcodeproj/xcshareddata/xcschemes/Eatery Watch App.xcscheme

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,18 @@
5555
debugServiceExtension = "internal"
5656
allowLocationSimulation = "YES"
5757
notificationPayloadFile = "Eatery Watch App Extension/PushNotificationPayload.apns">
58-
<BuildableProductRunnable
59-
runnableDebuggingMode = "0">
58+
<RemoteRunnable
59+
runnableDebuggingMode = "2"
60+
BundleIdentifier = "com.apple.Carousel"
61+
RemotePath = "/Eatery">
6062
<BuildableReference
6163
BuildableIdentifier = "primary"
6264
BlueprintIdentifier = "5D05FF3123C2C14400EF8CC9"
6365
BuildableName = "Eatery Watch App.app"
6466
BlueprintName = "Eatery Watch App"
6567
ReferencedContainer = "container:Eatery.xcodeproj">
6668
</BuildableReference>
67-
</BuildableProductRunnable>
69+
</RemoteRunnable>
6870
<LocationScenarioReference
6971
identifier = "New York, NY, USA"
7072
referenceType = "1">
@@ -76,16 +78,27 @@
7678
savedToolIdentifier = ""
7779
useCustomWorkingDirectory = "NO"
7880
debugDocumentVersioning = "YES">
79-
<BuildableProductRunnable
80-
runnableDebuggingMode = "0">
81+
<RemoteRunnable
82+
runnableDebuggingMode = "2"
83+
BundleIdentifier = "com.apple.Carousel"
84+
RemotePath = "/Eatery">
8185
<BuildableReference
8286
BuildableIdentifier = "primary"
8387
BlueprintIdentifier = "5D05FF3123C2C14400EF8CC9"
8488
BuildableName = "Eatery Watch App.app"
8589
BlueprintName = "Eatery Watch App"
8690
ReferencedContainer = "container:Eatery.xcodeproj">
8791
</BuildableReference>
88-
</BuildableProductRunnable>
92+
</RemoteRunnable>
93+
<MacroExpansion>
94+
<BuildableReference
95+
BuildableIdentifier = "primary"
96+
BlueprintIdentifier = "5D05FF3123C2C14400EF8CC9"
97+
BuildableName = "Eatery Watch App.app"
98+
BlueprintName = "Eatery Watch App"
99+
ReferencedContainer = "container:Eatery.xcodeproj">
100+
</BuildableReference>
101+
</MacroExpansion>
89102
</ProfileAction>
90103
<AnalyzeAction
91104
buildConfiguration = "Debug">

Eatery/Controllers/BRB/BRBAccountManager.swift

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,20 @@ private class BRBConnectionHandler: WKWebView, WKNavigationDelegate {
176176
block()
177177
})
178178
}
179+
180+
func webView(
181+
_ webView: WKWebView,
182+
decidePolicyFor navigationAction: WKNavigationAction,
183+
decisionHandler: @escaping (WKNavigationActionPolicy) -> Void
184+
) {
185+
// https://stackoverflow.com/questions/38450586/prevent-universal-links-from-opening-in-wkwebview-uiwebview?rq=1
186+
if let policy = WKNavigationActionPolicy(rawValue: WKNavigationActionPolicy.allow.rawValue + 2) {
187+
decisionHandler(policy)
188+
} else {
189+
decisionHandler(.allow)
190+
}
191+
}
192+
179193
}
180194

181195
// MARK: - Account Manager

0 commit comments

Comments
 (0)