kopia lustrzana https://github.com/meshtastic/Meshtastic-Android
make autobug in appRate non fatal
rodzic
73a5789bd0
commit
90d2a9cde4
|
@ -332,25 +332,28 @@ class MainActivity : AppCompatActivity(), Logging,
|
||||||
|
|
||||||
/// Ask user to rate in play store
|
/// Ask user to rate in play store
|
||||||
private fun askToRate() {
|
private fun askToRate() {
|
||||||
AppRate.with(this)
|
exceptionReporter { // Got one IllegalArgumentException from inside this lib, but we don't want to crash our app because of bugs in this optional feature
|
||||||
.setInstallDays(10.toByte()) // default is 10, 0 means install day, 10 means app is launched 10 or more days later than installation
|
|
||||||
.setLaunchTimes(10.toByte()) // default is 10, 3 means app is launched 3 or more times
|
AppRate.with(this)
|
||||||
.setRemindInterval(1.toByte()) // default is 1, 1 means app is launched 1 or more days after neutral button clicked
|
.setInstallDays(10.toByte()) // default is 10, 0 means install day, 10 means app is launched 10 or more days later than installation
|
||||||
.setRemindLaunchesNumber(1.toByte()) // default is 0, 1 means app is launched 1 or more times after neutral button clicked
|
.setLaunchTimes(10.toByte()) // default is 10, 3 means app is launched 3 or more times
|
||||||
.monitor() // Monitors the app launch times
|
.setRemindInterval(1.toByte()) // default is 1, 1 means app is launched 1 or more days after neutral button clicked
|
||||||
|
.setRemindLaunchesNumber(1.toByte()) // default is 0, 1 means app is launched 1 or more times after neutral button clicked
|
||||||
|
.monitor() // Monitors the app launch times
|
||||||
|
|
||||||
// Only ask to rate if the user has a suitable store
|
// Only ask to rate if the user has a suitable store
|
||||||
if (AppRate.with(this).storeType == StoreType.GOOGLEPLAY) { // Checks that current app store type from library options is StoreType.GOOGLEPLAY
|
if (AppRate.with(this).storeType == StoreType.GOOGLEPLAY) { // Checks that current app store type from library options is StoreType.GOOGLEPLAY
|
||||||
if (GoogleApiAvailability.getInstance()
|
if (GoogleApiAvailability.getInstance()
|
||||||
.isGooglePlayServicesAvailable(this) != ConnectionResult.SERVICE_MISSING
|
.isGooglePlayServicesAvailable(this) != ConnectionResult.SERVICE_MISSING
|
||||||
) { // Checks that Google Play is available
|
) { // Checks that Google Play is available
|
||||||
AppRate.showRateDialogIfMeetsConditions(this) // Shows the Rate Dialog when conditions are met
|
AppRate.showRateDialogIfMeetsConditions(this) // Shows the Rate Dialog when conditions are met
|
||||||
|
|
||||||
// Force the dialog - for testing
|
// Force the dialog - for testing
|
||||||
// AppRate.with(this).showRateDialog(this)
|
// AppRate.with(this).showRateDialog(this)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
AppRate.showRateDialogIfMeetsConditions(this); // Shows the Rate Dialog when conditions are met
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
AppRate.showRateDialogIfMeetsConditions(this); // Shows the Rate Dialog when conditions are met
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue