You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Added IS_PENDING_RELEASE source detection for iOS/macOS.
Updated documentation to reflect new [IS_PENDING_RELEASE](https://github.com/Navideck/store_checker/pull/1/commits/c3a12dac89c8865648e856732f56f33e7d02d8ec) feature.
Minor updates to macOS project configuration and example files.
Use HTTPS instead of HTTP for the iTunes API request. Apple's App Store Connect API requires secure connections, and using HTTP may fail in production environments or when App Transport Security is enforced.
static Future<String?> fetchAppStoreVersion(String bundleId) async {
try {
- String url = 'http://itunes.apple.com/lookup?bundleId=$bundleId';+ String url = 'https://itunes.apple.com/lookup?bundleId=$bundleId';
final response = await http.get(Uri.parse(url));
if (response.statusCode == 200) {
final data = jsonDecode(response.body);
if (data['resultCount'] > 0) {
return data['results'][0]['version'];
}
}
} catch (e) {
print("Error fetching App Store version: $e");
}
return null;
}
[To ensure code accuracy, apply this suggestion manually]
Suggestion importance[1-10]: 9
__
Why: Using HTTP instead of HTTPS for API requests is a security vulnerability. Apple's App Store Connect API requires secure connections, and HTTP requests may fail in production environments or when App Transport Security is enforced.
High
Possible issue
Fix semantic version comparison
The version comparison logic might not handle semantic versioning correctly. The string comparison with compareTo may not work as expected for versions like "1.10.0" vs "1.2.0". Consider using a semantic version comparison package or implementing proper semantic version parsing.
} else if (appStoreVersion != null &&
- currentVersion.compareTo(appStoreVersion) > 0) {+ _isNewerVersion(currentVersion, appStoreVersion)) {
return Source.IS_IN_REVIEW;
+// Add this helper method elsewhere in the class+// static bool _isNewerVersion(String current, String appStore) {+// // TODO: Implement proper semantic version comparison+// // or use a package like 'version' for this purpose+// return current.compareTo(appStore) > 0;+// }+
Apply this suggestion
Suggestion importance[1-10]: 7
__
Why: The current string comparison approach for version numbers can lead to incorrect results with semantic versioning (e.g., "1.10.0" would be considered less than "1.2.0"). This could cause incorrect detection of review status, which is a significant functional issue.
Medium
General
Use proper logging mechanism
Replace direct print statements with a proper logging mechanism. According to Effective Dart guidelines, production code should avoid using print for logging errors as it doesn't provide control over log levels and can't be easily disabled in production.
} catch (e) {
+ // TODO: Replace with proper logging+ // Consider using a logging package or custom logger+ // that can be configured for different environments
print("Error fetching App Store version: $e");
}
Apply this suggestion
Suggestion importance[1-10]: 3
__
Why: While the suggestion correctly identifies that using print statements for error logging isn't ideal, it only adds a TODO comment rather than providing a concrete implementation. The impact is relatively minor in this context.
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Type
Enhancement, Documentation
Description
Added
IS_PENDING_RELEASEsource detection for iOS/macOS.Updated documentation to reflect new
[IS_PENDING_RELEASE](https://github.com/Navideck/store_checker/pull/1/commits/c3a12dac89c8865648e856732f56f33e7d02d8ec)feature.Minor updates to macOS project configuration and example files.
Changes walkthrough 📝
GeneratedPluginRegistrant.swift
Register `package_info_plus` plugin for macOS.example/macos/Flutter/GeneratedPluginRegistrant.swift
package_info_plusplugin registration.AppDelegate.swift
Update macOS AppDelegate for secure state support.example/macos/Runner/AppDelegate.swift
@NSApplicationMainto@main.main.dart
Handle `IS_IN_REVIEW` source in main app.example/lib/main.dart
IS_IN_REVIEWcase handling in source detection.store_checker.dart
Add `IS_IN_REVIEW` detection logic and version checks.lib/store_checker.dart
IS_IN_REVIEWtoSourceenum.package_info_plusfor app version retrieval.fetchAppStoreVersionmethod for App Store version checks.IS_IN_REVIEWsource.README.md
Update README for `IS_IN_REVIEW` feature.README.md
IS_IN_REVIEWsource detection feature.IS_IN_REVIEW.Runner.xcscheme
Enable GPU validation mode in macOS scheme.example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
pubspec.yaml
Add new dependencies for version checks.pubspec.yaml
package_info_plusandhttpdependencies.