Skip to content

Instantly share code, notes, and snippets.

@dennda
Created March 13, 2019 14:31
Show Gist options
  • Save dennda/4baa72e8ac56f108d8b08ac7699aa380 to your computer and use it in GitHub Desktop.
Save dennda/4baa72e8ac56f108d8b08ac7699aa380 to your computer and use it in GitHub Desktop.
diff --git a/DuolingoMobile/Sources/Library/Networking/DUOWebManager.m b/DuolingoMobile/Sources/Library/Networking/DUOWebManager.m
index 04d2b210aa..112584a9b5 100644
--- a/DuolingoMobile/Sources/Library/Networking/DUOWebManager.m
+++ b/DuolingoMobile/Sources/Library/Networking/DUOWebManager.m
@@ -287,26 +287,28 @@ - (BOOL)internetIsReachableForceCheck:(BOOL)forceCheck
- (NSString *)baseAPIURLString
{
- // Check if a custom API URL command line argument is present.
- NSString *testHostURLString = DUOCommandLineCustomAPIURL();
- if (!testHostURLString) {
- testHostURLString = self.testAPIHost;
- }
+ return @"https://next-34.duolingo.com";
- self.usingTestHost = testHostURLString != nil;
- NSString *APIHostString = self.usingTestHost ? testHostURLString : nil;
-
- if (APIHostString) {
- return APIHostString;
- } else if (self.shouldUseSecondaryChinaEndpoint && DUOAppIsInChina()) {
- // XXX: To speed up network calls from China, we are proxying through a different endpoint. When we hit the
- // server through that proxy, the server's location check will fail (it will be think it's from the US, because
- // of the proxy). So we can't have the server return a different URL for China. Instead, we hardcode this.
- return kDUOChinaSecondaryBaseURLString;
- } else {
- NSString *defaultString = DUOAppIsInChina() ? kDUOChinaBaseURLString : kDUODefaultBaseURLString;
- return [[NSUserDefaults standardUserDefaults] objectForKey:kDUOCachedAPIDomainKey] ?: defaultString;
- }
+// // Check if a custom API URL command line argument is present.
+// NSString *testHostURLString = DUOCommandLineCustomAPIURL();
+// if (!testHostURLString) {
+// testHostURLString = self.testAPIHost;
+// }
+//
+// self.usingTestHost = testHostURLString != nil;
+// NSString *APIHostString = self.usingTestHost ? testHostURLString : nil;
+//
+// if (APIHostString) {
+// return APIHostString;
+// } else if (self.shouldUseSecondaryChinaEndpoint && DUOAppIsInChina()) {
+// // XXX: To speed up network calls from China, we are proxying through a different endpoint. When we hit the
+// // server through that proxy, the server's location check will fail (it will be think it's from the US, because
+// // of the proxy). So we can't have the server return a different URL for China. Instead, we hardcode this.
+// return kDUOChinaSecondaryBaseURLString;
+// } else {
+// NSString *defaultString = DUOAppIsInChina() ? kDUOChinaBaseURLString : kDUODefaultBaseURLString;
+// return [[NSUserDefaults standardUserDefaults] objectForKey:kDUOCachedAPIDomainKey] ?: defaultString;
+// }
}
- (void)setBaseAPIURLString:(NSString *)baseAPIURLString
diff --git a/DuolingoMobile/Sources/Sessions/Network/Session Loading/BundleClient.swift b/DuolingoMobile/Sources/Sessions/Network/Session Loading/BundleClient.swift
index b305f05650..16392b3212 100644
--- a/DuolingoMobile/Sources/Sessions/Network/Session Loading/BundleClient.swift
+++ b/DuolingoMobile/Sources/Sessions/Network/Session Loading/BundleClient.swift
@@ -138,7 +138,7 @@ final class DUOBundleClient: NSObject, ContentLoaderDelegate, ItemDownloader, Co
// would require an incompatible format change, we can bump this accordingly.
let supportedSmartTipsVersion = 1
if determineCondition(.requestSmartTipsRules, context: "session_create") == .control {
- return nil
+ return 0
} else {
return supportedSmartTipsVersion
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment