Closes #2903: Fixed crash when trying to rate the app on a devices without

the play store app.
nightly-build-test
Arturo Mejia 5 years ago committed by Sawyer Blatz
parent 540b0939d2
commit b2e27d26dc

@ -52,6 +52,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- #2390 - Adds Onboarding for Fenix
- #2531 - Adds link to privacy policy in settings
- #225 - Adds the ability to delete all browsing data
- #2903 - Fixed crash when trying to rate the app on a devices without the play store app.
### Changed
- #2673 - Fixed can't upload files using third party apps from the file manager.

@ -4,6 +4,7 @@
package org.mozilla.fenix.settings
import android.content.ActivityNotFoundException
import android.content.Intent
import android.net.Uri
import android.os.Bundle
@ -154,7 +155,17 @@ class SettingsFragment : PreferenceFragmentCompat(), CoroutineScope, AccountObse
)
}
resources.getString(pref_key_rate) -> {
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(SupportUtils.RATE_APP_URL)))
try {
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(SupportUtils.RATE_APP_URL)))
} catch (e: ActivityNotFoundException) {
// Device without the play store installed.
// Opening the play store website.
(activity as HomeActivity).openToBrowserAndLoad(
searchTermOrURL = SupportUtils.FENIX_PLAY_STORE_URL,
newTab = true,
from = BrowserDirection.FromSettings
)
}
}
resources.getString(pref_key_about) -> {
navigateToAbout()

@ -17,6 +17,7 @@ import java.util.Locale
object SupportUtils {
const val RATE_APP_URL = "market://details?id=" + BuildConfig.APPLICATION_ID
const val MOZILLA_MANIFESTO_URL = "https://www.mozilla.org/en-GB/about/manifesto/"
const val FENIX_PLAY_STORE_URL = "https://play.google.com/store/apps/details?id=${BuildConfig.APPLICATION_ID}"
val PRIVACY_NOTICE_URL: String
get() = "https://www.mozilla.org/${getLanguageTag(Locale.getDefault())}/privacy/firefox/"

Loading…
Cancel
Save