Skip to content

Commit

Permalink
brb: Disable universal links in BRBConnectionHandler (#319)
Browse files Browse the repository at this point in the history
* brb: Disable universal links in BRBConnectionHandler

* Bump version to 2.12
  • Loading branch information
whoiswillma authored Jan 19, 2022
1 parent 7510747 commit 50e27ef
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 25 deletions.
27 changes: 14 additions & 13 deletions Eatery.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1360,6 +1360,7 @@
};
5DCE4A012533E6F90025D7BE /* [SwiftLint] */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
Expand All @@ -1374,7 +1375,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "# Type a script or drag a script file from your workspace to insert its path.\nswiftlint lint\n";
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";
};
9DEA07504979C55F42669623 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
Expand Down Expand Up @@ -1634,7 +1635,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 2.11;
MARKETING_VERSION = 2.12;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = org.cuappdev.eatery.debug.watchkitapp.watchkitextension;
Expand Down Expand Up @@ -1709,7 +1710,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 2.11;
MARKETING_VERSION = 2.12;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = org.cuappdev.eatery.watchkitapp.watchkitextension;
Expand Down Expand Up @@ -1753,7 +1754,7 @@
);
IBSC_MODULE = Eatery_Watch_App_Extension;
INFOPLIST_FILE = "Eatery Watch App/Info.plist";
MARKETING_VERSION = 2.11;
MARKETING_VERSION = 2.12;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = org.cuappdev.eatery.debug.watchkitapp;
Expand Down Expand Up @@ -1824,7 +1825,7 @@
GCC_WARN_UNUSED_VARIABLE = YES;
IBSC_MODULE = Eatery_Watch_App_Extension;
INFOPLIST_FILE = "Eatery Watch App/Info.plist";
MARKETING_VERSION = 2.11;
MARKETING_VERSION = 2.12;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = org.cuappdev.eatery.watchkitapp;
Expand Down Expand Up @@ -1908,7 +1909,7 @@
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = N85YZLFRGD;
DEVELOPMENT_TEAM = ZGMCXU7X3U;
EXCLUDED_ARCHS = "";
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
Expand All @@ -1918,7 +1919,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.11;
MARKETING_VERSION = 2.12;
OTHER_LDFLAGS = "$(inherited)";
OTHER_SWIFT_FLAGS = "$(inherited) -DDEBUG";
PRODUCT_BUNDLE_IDENTIFIER = org.cuappdev.eatery.testflight;
Expand Down Expand Up @@ -1958,7 +1959,7 @@
);
IBSC_MODULE = Eatery_Watch_App_Extension;
INFOPLIST_FILE = "Eatery Watch App/Info.plist";
MARKETING_VERSION = 2.11;
MARKETING_VERSION = 2.12;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = org.cuappdev.eatery.testflight.watchkitapp;
Expand Down Expand Up @@ -2004,7 +2005,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 2.11;
MARKETING_VERSION = 2.12;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = org.cuappdev.eatery.testflight.watchkitapp.watchkitextension;
Expand Down Expand Up @@ -2086,7 +2087,7 @@
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = N85YZLFRGD;
DEVELOPMENT_TEAM = ZGMCXU7X3U;
EXCLUDED_ARCHS = "";
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
Expand All @@ -2096,7 +2097,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.11;
MARKETING_VERSION = 2.12;
OTHER_LDFLAGS = "$(inherited)";
OTHER_SWIFT_FLAGS = "$(inherited) -DDEBUG";
PRODUCT_BUNDLE_IDENTIFIER = org.cuappdev.eatery.debug;
Expand Down Expand Up @@ -2171,7 +2172,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = N85YZLFRGD;
DEVELOPMENT_TEAM = ZGMCXU7X3U;
EXCLUDED_ARCHS = "";
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
Expand All @@ -2181,7 +2182,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.11;
MARKETING_VERSION = 2.12;
OTHER_LDFLAGS = "$(inherited)";
PRODUCT_BUNDLE_IDENTIFIER = org.cuappdev.eatery;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,18 @@
allowLocationSimulation = "YES"
launchAutomaticallySubstyle = "8"
notificationPayloadFile = "Eatery Watch App Extension/PushNotificationPayload.apns">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<RemoteRunnable
runnableDebuggingMode = "2"
BundleIdentifier = "com.apple.Carousel"
RemotePath = "/Eatery">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5D05FF3123C2C14400EF8CC9"
BuildableName = "Eatery Watch App.app"
BlueprintName = "Eatery Watch App"
ReferencedContainer = "container:Eatery.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</RemoteRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Debug"
Expand All @@ -75,16 +77,27 @@
debugDocumentVersioning = "YES"
launchAutomaticallySubstyle = "8"
notificationPayloadFile = "Eatery Watch App Extension/PushNotificationPayload.apns">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<RemoteRunnable
runnableDebuggingMode = "2"
BundleIdentifier = "com.apple.Carousel"
RemotePath = "/Eatery">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5D05FF3123C2C14400EF8CC9"
BuildableName = "Eatery Watch App.app"
BlueprintName = "Eatery Watch App"
ReferencedContainer = "container:Eatery.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</RemoteRunnable>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5D05FF3123C2C14400EF8CC9"
BuildableName = "Eatery Watch App.app"
BlueprintName = "Eatery Watch App"
ReferencedContainer = "container:Eatery.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
Expand Down
25 changes: 19 additions & 6 deletions Eatery.xcodeproj/xcshareddata/xcschemes/Eatery Watch App.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,18 @@
debugServiceExtension = "internal"
allowLocationSimulation = "YES"
notificationPayloadFile = "Eatery Watch App Extension/PushNotificationPayload.apns">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<RemoteRunnable
runnableDebuggingMode = "2"
BundleIdentifier = "com.apple.Carousel"
RemotePath = "/Eatery">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5D05FF3123C2C14400EF8CC9"
BuildableName = "Eatery Watch App.app"
BlueprintName = "Eatery Watch App"
ReferencedContainer = "container:Eatery.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</RemoteRunnable>
<LocationScenarioReference
identifier = "New York, NY, USA"
referenceType = "1">
Expand All @@ -76,16 +78,27 @@
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<RemoteRunnable
runnableDebuggingMode = "2"
BundleIdentifier = "com.apple.Carousel"
RemotePath = "/Eatery">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5D05FF3123C2C14400EF8CC9"
BuildableName = "Eatery Watch App.app"
BlueprintName = "Eatery Watch App"
ReferencedContainer = "container:Eatery.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</RemoteRunnable>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5D05FF3123C2C14400EF8CC9"
BuildableName = "Eatery Watch App.app"
BlueprintName = "Eatery Watch App"
ReferencedContainer = "container:Eatery.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
Expand Down
14 changes: 14 additions & 0 deletions Eatery/Controllers/BRB/BRBAccountManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,20 @@ private class BRBConnectionHandler: WKWebView, WKNavigationDelegate {
block()
})
}

func webView(
_ webView: WKWebView,
decidePolicyFor navigationAction: WKNavigationAction,
decisionHandler: @escaping (WKNavigationActionPolicy) -> Void
) {
// https://stackoverflow.com/questions/38450586/prevent-universal-links-from-opening-in-wkwebview-uiwebview?rq=1
if let policy = WKNavigationActionPolicy(rawValue: WKNavigationActionPolicy.allow.rawValue + 2) {
decisionHandler(policy)
} else {
decisionHandler(.allow)
}
}

}

// MARK: - Account Manager
Expand Down

0 comments on commit 50e27ef

Please sign in to comment.