Skip to content

Commit

Permalink
Fix custom share server functionality (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrei0105 authored and ps2 committed Dec 31, 2019
1 parent 2f6f280 commit 664a5f2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 18 deletions.
11 changes: 11 additions & 0 deletions ShareClient/ShareClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,18 @@ public enum ShareError: Error {
public enum KnownShareServers: String {
case US="https://share1.dexcom.com"
case NON_US="https://shareous1.dexcom.com"
/*
To enable Loop to use a custom share server:
- remove the comment marker on line 44 and change the value of CUSTOM
- remove the comment markers on lines 34 and 35 in ShareClientUI/ShareService+UI.swift

Note: The URL in CUSTOM must start with 'https://' (NOT 'http://')

You can find installation instructions for one such custom share server at
https://github.com/dabear/NightscoutShareServer
*/

// case CUSTOM="https://yourusernameshareserver.herokuapp.com"
}

// From the Dexcom Share iOS app, via @bewest and @shanselman:
Expand Down
17 changes: 0 additions & 17 deletions ShareClient/ShareService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,6 @@ public class ShareService: ServiceAuthentication {
url?.absoluteString
]

/*
To enable Loop to use a custom share server, change the value of customServer
and remove the comment markers on line 55 and 62.

You can find installation instructions for one such custom share server at
https://github.com/dabear/NightscoutShareServer
*/

/*
let customServer = "https://REPLACEME"
let customServerTitle = "Custom"

credentials[2].options?.append(
(title: LocalizedString(customServerTitle, comment: "Custom share server option title"),
value: customServer))
*/

if let username = username, let password = password, let url = url {
isAuthorized = true
client = ShareClient(username: username, password: password, shareServer: url.absoluteString)
Expand Down
4 changes: 3 additions & 1 deletion ShareClientUI/ShareService+UI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ extension ShareService: ServiceAuthenticationUI {
value: KnownShareServers.US.rawValue),
(title: LocalizedString("Outside US", comment: "Outside US share server option title"),
value: KnownShareServers.NON_US.rawValue)

// remove the comment markers on lines 34 and 35 to use a custom share server
// ,(title: LocalizedString("Custom", comment: "Custom share server option title"),
// value: KnownShareServers.CUSTOM.rawValue)
]
)
]
Expand Down

0 comments on commit 664a5f2

Please sign in to comment.