Skip to content

Conversation

@aaravgarg
Copy link
Collaborator

Summary

  • Fixes crash when Safari View Controller fails to load URLs in the app detail page
  • Adds _launchUrlSafely helper that catches PlatformException and falls back to external browser
  • Shows user-friendly error message if both in-app and external browser fail
  • Adds couldNotOpenUrl localization key for error message

Test plan

  • Open an app with external integration that requires URL launch
  • Test with network disabled to verify graceful error handling
  • Verify snackbar appears when URL fails to open
  • Verify fallback to external Safari works when in-app browser fails

🤖 Generated with Claude Code

Wrap launchUrl calls with inAppBrowserView in try-catch to prevent
crashes when Safari View Controller fails to load. Falls back to
external browser mode, then shows user-friendly error message.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request effectively fixes a crash related to URL launching by implementing a robust _launchUrlSafely helper with fallback mechanisms and error handling. The refactoring to use this helper throughout the code is clean. However, there's a significant localization issue: the new error message string couldNotOpenUrl has been added to all language files with an English value, instead of being translated. This needs to be corrected to ensure a consistent user experience across all supported languages.

"applyFilters": "تطبيق الفلاتر",
"mostInstalls": "الأكثر تثبيتاً"
"mostInstalls": "الأكثر تثبيتاً",
"couldNotOpenUrl": "Could not open URL. Please try again."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The new localization key couldNotOpenUrl has an English value. This needs to be translated into Arabic. This issue is present across all the non-English .arb files updated in this pull request, and they should all be updated with their respective translations.

@mdmohsin7 mdmohsin7 self-requested a review January 28, 2026 18:50
@mdmohsin7 mdmohsin7 merged commit 6d8bdaa into main Jan 28, 2026
1 check passed
@mdmohsin7 mdmohsin7 deleted the fix/url-launcher-crash-handling branch January 28, 2026 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants