Five-Star-Me
Five-Star-Me is a library to help you promote your android app by prompting users to rate the app after using it for a few days.
It uses Android's In-App Review API and is based upon @hotchemi's Android-Rate library.
Note: In order to test, the API requires that the app be uploaded to the play store - It connot be tested locally. Read the testing guide here.
Install
You can download from jitpack.
Step 1:
Add this to project (root) build.gradle.
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Step 2:
Add the following dependency to your module (app) level build.gradle.
dependencies {
implementation 'com.github.numerative:Five-Star-Me:{latest.version}'
}
Usage
Configuration
Android-Rate provides methods to configure its behavior.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
FiveStarMe.with(this)
.setInstallDays(0) // default 10, 0 means install day.
.setLaunchTimes(3) // default 10
.setDebug(false) // default false
.monitor();
// Show a dialog if meets conditions
FiveStarMe.showRateDialogIfMeetsConditions(this);
}
The default conditions to show rate dialog is as below:
- App is launched more than 10 days later than installation. Change via
FiveStarMe#setInstallDays(int)
. - App is launched more than 10 times. Change via
FiveStarMe#setLaunchTimes(int)
. - Setting
FiveStarMe#setDebug(boolean)
will ensure that the rating request is shown each time the app is launched. This feature is only development!.
Clear show dialog flag
When you want to show the dialog again, call FiveStarMe#clearAgreeShowDialog()
.
FiveStarMe.with(this).clearAgreeShowDialog();
When the button presses on
call FiveStarMe#showRateDialog(Activity)
.
FiveStarMe.with(this).showRateDialog(this);
Support
Five-Star-Me supports API level 21 and up.
Sample
Please try the sample app.
To test, provide applicationId
to sample module's build.gradle
and upload it to one of your test tracks on google play store.
android {
defaultConfig {
applicationId "com.exmaple.yourappid"
...
}
Contribute
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
License
The MIT License (MIT)
Copyright (c) 2015 Shintaro Katafuchi
Copyright (c) 2020 Michael Hathi
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.