Skip to content

Commit 664a5f2

Browse files
Andrei0105ps2
authored andcommitted
Fix custom share server functionality (#9)
1 parent 2f6f280 commit 664a5f2

File tree

3 files changed

+14
-18
lines changed

3 files changed

+14
-18
lines changed

ShareClient/ShareClient.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,18 @@ public enum ShareError: Error {
3030
public enum KnownShareServers: String {
3131
case US="https://share1.dexcom.com"
3232
case NON_US="https://shareous1.dexcom.com"
33+
/*
34+
To enable Loop to use a custom share server:
35+
- remove the comment marker on line 44 and change the value of CUSTOM
36+
- remove the comment markers on lines 34 and 35 in ShareClientUI/ShareService+UI.swift
3337

38+
Note: The URL in CUSTOM must start with 'https://' (NOT 'http://')
39+
40+
You can find installation instructions for one such custom share server at
41+
https://github.com/dabear/NightscoutShareServer
42+
*/
43+
44+
// case CUSTOM="https://yourusernameshareserver.herokuapp.com"
3445
}
3546

3647
// From the Dexcom Share iOS app, via @bewest and @shanselman:

ShareClient/ShareService.swift

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,6 @@ public class ShareService: ServiceAuthentication {
2323
url?.absoluteString
2424
]
2525

26-
/*
27-
To enable Loop to use a custom share server, change the value of customServer
28-
and remove the comment markers on line 55 and 62.
29-
30-
You can find installation instructions for one such custom share server at
31-
https://github.com/dabear/NightscoutShareServer
32-
*/
33-
34-
/*
35-
let customServer = "https://REPLACEME"
36-
let customServerTitle = "Custom"
37-
38-
credentials[2].options?.append(
39-
(title: LocalizedString(customServerTitle, comment: "Custom share server option title"),
40-
value: customServer))
41-
*/
42-
4326
if let username = username, let password = password, let url = url {
4427
isAuthorized = true
4528
client = ShareClient(username: username, password: password, shareServer: url.absoluteString)

ShareClientUI/ShareService+UI.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ extension ShareService: ServiceAuthenticationUI {
3030
value: KnownShareServers.US.rawValue),
3131
(title: LocalizedString("Outside US", comment: "Outside US share server option title"),
3232
value: KnownShareServers.NON_US.rawValue)
33-
33+
// remove the comment markers on lines 34 and 35 to use a custom share server
34+
// ,(title: LocalizedString("Custom", comment: "Custom share server option title"),
35+
// value: KnownShareServers.CUSTOM.rawValue)
3436
]
3537
)
3638
]

0 commit comments

Comments
 (0)