-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feature/268-do-not-let-screen-sleep-when-t…
…imer-running
- Loading branch information
Showing
18 changed files
with
255 additions
and
221 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// | ||
// DeeplinkGenerator.swift | ||
// BeeSwift | ||
// | ||
// Created by krugerk on 2024-11-29. | ||
// | ||
|
||
|
||
struct DeeplinkGenerator { | ||
public static func generateDeepLinkToGoalCommitment(username: String, goalName: String) -> URL { | ||
URL(string: "https://www.beeminder.com/\(username)/\(goalName)#commitment")! | ||
} | ||
|
||
public static func generateDeepLinkToGoalStop(username: String, goalName: String) -> URL { | ||
URL(string: "https://www.beeminder.com/\(username)/\(goalName)#stop")! | ||
} | ||
|
||
public static func generateDeepLinkToGoalData(username: String, goalName: String) -> URL { | ||
URL(string: "https://www.beeminder.com/\(username)/\(goalName)#data")! | ||
} | ||
|
||
public static func generateDeepLinkToGoalStatistics(username: String, goalName: String) -> URL { | ||
URL(string: "https://www.beeminder.com/\(username)/\(goalName)#statistics")! | ||
} | ||
|
||
public static func generateDeepLinkToGoalSettings(username: String, goalName: String) -> URL { | ||
URL(string: "https://www.beeminder.com/\(username)/\(goalName)#settings")! | ||
} | ||
|
||
public static func generateDeepLinkToUrl(accessToken: String, username: String, url: URL) -> URL { | ||
let baseUrlString = "https://www.beeminder.com/api/v1/users/\(username).json" | ||
|
||
var components = URLComponents(string: baseUrlString)! | ||
|
||
components.queryItems = [ | ||
URLQueryItem(name: "access_token", value: accessToken), | ||
URLQueryItem(name: "redirect_to_url", value: url.absoluteString) | ||
] | ||
|
||
return components.url! | ||
} | ||
} |
Oops, something went wrong.