-
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.
introduces goal menu with deep links to goal on website (#540)
## Summary The goal screen contained an action button which opened the goal in an in-app browser. This way one could manipulate various aspects of the goal or view data (statistics) from on the website as these features are lacking in the app. This merge request replaces the action button on the goal screen, with single link to the goal page on the website, with a menu with links to all of the main sections of the website's rendition of the goal: commitment, stop/pause, data, statistics, and settings. This makes it easier to more quickly arrive at a particular section. It might also increase feature discoverability. For example, the delta text was removed from the app and the current workaround to check "how much to do to earn x days off" is available on the website in the statistics section under the "Amounts Due By Day" subsection. Also, the app does not support features such as setting the goal's description or title. It also does not allow editing of datapoints of goals with autodata whereas the website does. *For UI changes including screenshots of before and after is great.* ## before Tapping the action button opens beeminder.com/user/goal in an in-app browser after which one can navigate through the sections of the goal on the webpage presented. ## Validation Opened the app in the simulator. Clicked through various goals and the corresponding "open this section of the goal on the website" links.
- Loading branch information
Showing
3 changed files
with
119 additions
and
15 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
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! | ||
} | ||
} |
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