react-native-call-detection/android/src/main/java/com/pritesh/calldetection/CallDetectionManagerModule.java
@ReactMethod
    public void shouldShowRequestPermissionRationale(final String permission, final Promise promise) {
        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
            promise.resolve(false);
            return;
        }
        try {
            promise.resolve(getPermissionAwareActivity().shouldShowRequestPermissionRationale(permission));
        } catch (IllegalStateException e) {

            promise.reject("ERROR INVALID ACTIVITY", e);
        }
    }
/**
    * Check whether the app should display a message explaining why a certain permission is needed.
    * successCallback is called with true if the app should display a message, false otherwise.
    * This message is only displayed if the user has revoked this permission once before, and if the
    * permission dialog will be shown to the user (the user can choose to not be shown that dialog
    * again). For devices before Android M, this always returns false.
    * See {@link Activity#shouldShowRequestPermissionRationale}.
    */
Check whether the app should display a message explaining why a certain permission is needed.
successCallback is called with true if the app should display a message, false otherwise.
This message is only displayed if the user has revoked this permission once before, and if the
permission dialog will be shown to the user (the user can choose to not be shown that dialog
again). For devices before Android M, this always returns false.
Check whether the app should display a message explaining why a certain permission is needed . successCallback is called with true if the app should display a message false otherwise . This message is only displayed if the user has revoked this permission once before and if the permission dialog will be shown to the user ( the user can choose to not be shown that dialog again ) . For devices before Android M this always returns false .
@ReactMethod
    public void shouldShowRequestPermissionRationale(final String permission, final Promise promise) {
        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
            promise.resolve(false);
            return;
        }
        try {
            promise.resolve(getPermissionAwareActivity().shouldShowRequestPermissionRationale(permission));
        } catch (IllegalStateException e) {
            promise.reject("ERROR INVALID ACTIVITY", e);
        }
    }
@ ReactMethod public void shouldShowRequestPermissionRationale ( final String permission , final Promise promise ) { if ( Build . VERSION . SDK_INT < Build . VERSION_CODES . M ) { promise . resolve ( false ) ; return ; } try { promise . resolve ( getPermissionAwareActivity ( ) . shouldShowRequestPermissionRationale ( permission ) ) ; } catch ( IllegalStateException e ) { promise . reject ( "ERROR INVALID ACTIVITY" , e ) ; } }
Check whether the app should display a message explaining why a certain permission is needed.
Check whether the app should display a message explaining why a certain permission is needed .