Code Monkey home page Code Monkey logo

ncapprating's Introduction

NcAppRating

Release

Android App Rating Library

####Prompts rating dialog when prompting criteria are met.

screenshot1 screenshot2

####Preferred rating to redirect to Google Play can be set.

For example:

4 Star is set as the target rating. If user selects 3 Star or below, a "feedback" callback will be triggered.

screenshot3 screenshot4

How to Use

In onCreate() of MainActivity:

NcAppRatingConfig config = new NcAppRatingConfig(INSTALLED_DAYS, LAUNCHED_TIMES, MINIMUM_TARGET_RATING, ncAppRatingListener);
ncAppRating = new NcAppRating(context, config);
ncAppRating.showRateDialogIfNeeded();

Declare an NcAppRatingListener

protected NcAppRatingListener ncAppRatingListener = new NcAppRatingListener() {
        @Override
        public void onOpenMarket(int rating) {
            Log.d(TAG, "NcAppRating - onOpenMarket() rating: " + String.valueOf(rating));
            
            // opens Google Play
            PlayStoreUtil.rateUs(context);
        }

        @Override
        public void onNoClicked() {
            Log.d(TAG, "NcAppRating - onNoClicked()");
        }

        @Override
        public void onCancelClicked() {
            Log.d(TAG, "NcAppRating - onCancelClicked()");
        }

        @Override
        public void onShowFeedbackDialog(int rating) {
            Log.d(TAG, "NcAppRating - onShowFeedbackDialog() rating: " + String.valueOf(rating));
            // TODO: implement your own feedback mechanism here
        }
    };

Integration

This library is hosted by jitpack.io.

Root level gradle:

allprojects {
 repositories {
    jcenter()
    maven { url "https://jitpack.io" }
 }
}

Application level gradle:

Release

dependencies {
    compile 'com.github.noelchew:NcAppRating:x.y.z'
}

Note: do not add the jitpack.io repository under buildscript

ncapprating's People

Contributors

noelchew avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.