App Store Reviews
Relevant source files
The following files were used as context for generating this wiki page:
The App Store Reviews module provides a centralized mechanism for managing user feedback and ratings for the put.io iOS application. Its primary responsibility is to facilitate manual review requests by directing users to the appropriate App Store product page via specialized URL schemes.
Within the broader application architecture, this feature is integrated into the Settings module, allowing users to provide ratings voluntarily. It operates as a shared service, ensuring a consistent implementation for invoking the iOS system's review capabilities.
Sources: Putio/Common/Managers/AppStoreReviewManager.swift:6-8, Putio/Features/Settings/SettingsViewModel+Sections.swift:195-202
Architecture and Implementation
The system is built around a singleton manager that handles the construction and execution of external store links. It abstracts the complexities of App Store deep-linking from the UI components.
AppStoreReviewManager
The AppStoreReviewManager is a singleton class responsible for manual review requests. It utilizes a specific URL pattern to open the App Store app directly to the "Write a Review" section for the put.io application.
| Component | Type | Description |
|---|---|---|
sharedInstance | Static Property | The shared singleton instance of the manager. |
requestReviewManually() | Function | Constructs the review URL and requests the system to open it. |
APP_STORE_APP_ID | Constant | The unique identifier for the app in the App Store. |
Sources: Putio/Common/Managers/AppStoreReviewManager.swift:6-15
User Flow for Manual Reviews
The manual review process is triggered from the "Support" section within the application settings. When a user selects the "Rate put.io on App Store" option, the SettingsViewModel invokes the AppStoreReviewManager.
The diagram shows the sequence of events from a user interaction in settings to the redirection to the App Store.
Sources: Putio/Features/Settings/SettingsViewModel+Sections.swift:195-202, Putio/Common/Managers/AppStoreReviewManager.swift:10-15
Integration with Application Settings
The review feature is exposed to the user through the SettingsViewModel. It is categorized under the "Support" section of the settings interface.
Settings Configuration
The settings item is defined as a SectionItem with the following characteristics:
- Title: Localized string "Rate put.io on App Store".
- Icon: Identified by the resource name "iconStar".
- Action: A closure that calls
AppStoreReviewManager.sharedInstance.requestReviewManually().
Sources: Putio/Features/Settings/SettingsViewModel+Sections.swift:195-202
Error Handling and Logging
The module includes basic error handling to manage scenarios where the App Store URL cannot be constructed. In such cases, it utilizes an InternalFailurePresenter to log the diagnostic information.
func requestReviewManually() {
guard let writeReviewURL = URL(string: "https://apps.apple.com/app/\(APP_STORE_APP_ID)?action=write-review") else {
return InternalFailurePresenter.log("Unable to construct App Store review URL")
}
UIApplication.shared.open(writeReviewURL, options: [:], completionHandler: nil)
}
Sources: Putio/Common/Managers/AppStoreReviewManager.swift:10-14
Technical Dependencies
The App Store Review functionality relies on the following project-wide systems:
| Dependency | File Path | Usage |
|---|---|---|
| UIKit | Putio/AppDelegate.swift | Used for UIApplication.shared to open external URLs. |
| Localization | Putio/Common/Helpers/Realm.swift | Ensures titles and prompts are accessible in multiple languages. |
| Internal Logging | Putio/Common/Managers/AppStoreReviewManager.swift | Uses InternalFailurePresenter for debugging failed URL construction. |
| App Identity | Putio/Common/Managers/AppStoreReviewManager.swift | Requires APP_STORE_APP_ID for target URL generation. |
Sources: Putio/Common/Managers/AppStoreReviewManager.swift:10-14, Putio/Features/Settings/SettingsViewModel+Sections.swift:196, Putio/AppDelegate.swift:1
Summary
The App Store Review system in putio-ios is a focused utility designed to encourage user engagement through ratings. By centralizing the logic in AppStoreReviewManager, the application ensures that the deep-linking logic is maintained in a single location while being easily accessible from the user settings interface. It utilizes standard iOS URL schemes to provide a seamless transition from the app to the App Store review page.