A library to ask and remind users to rate the app on Android 4.0 (API 14) and above.
It uses AndroidX so, first migrate your project to AndroidX. It is dependent on Java 8 due to the dependency on Dynamic Utils. Since v1.1.0, it is targeting Java 17 to provide maximum compatibility. Since v1.2.0, the minimum SDK is Android 4.4 (API 19) to comply with the latest policies.
It can be installed by adding the following dependency to your build.gradle
file:
dependencies {
// For AndroidX enabled projects.
implementation 'com.pranavpandey.android:dynamic-rating:1.2.0'
}
It has various conditions
that must be met to ask for the rating from the user.
For a complete reference, please read the documentation.
DynamicRating
instance must be used to access its methods.
// Get instance with application context.
DynamicRating.getInstance(applicationContext);
After that, its various public methods can be accessed via the returned instance.
It should be initialized
to set the first launch timestamp
and to increase the counter when
required.
// Initialize with default values.
DynamicRating.getInstance(applicationContext).initialize();
Call the shouldRate()
method to check whether we can show the rating dialog to the user
according to the set conditions.
// Get instance and then check if we should ask to rate.
// Returns `true` if all the rating conditions are met.
DynamicRating.getInstance(context).initialize().shouldRate();
Please become a sponsor to get a detailed guide and priority support.
It depends on the dynamic-utils and dynamic-preferences to perform various internal operations. So, their functions can also be used to perform other useful operations.
Pranav Pandey
Copyright 2022-2024 Pranav Pandey
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.