Skip to content

Commit

Permalink
fix(app-rate): add missing types for onButtonClicked callback (#3616)
Browse files Browse the repository at this point in the history
  • Loading branch information
dschwank authored Apr 5, 2021
1 parent 3d7b777 commit 4fb07fa
Showing 1 changed file with 28 additions and 13 deletions.
41 changes: 28 additions & 13 deletions src/@ionic-native/plugins/app-rate/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export enum AppRateReviewTypeIos {
/**
* Open the store using the openUrl preference (defaults to InAppBrowser). Be advised that WKWebView might not open the app store links
*/
InAppBrowser = 'InAppBrowser'
InAppBrowser = 'InAppBrowser',
}

export enum AppRateReviewTypeAndroid {
Expand All @@ -28,6 +28,23 @@ export enum AppRateReviewTypeAndroid {
InAppBrowser = 'InAppBrowser',
}

export enum AppRatePromptType {
/**
* Prompt asking to rate the app.
*/
AppRatingPrompt = 'AppRatingPrompt',

/**
* Prompt asking to rate the app within the store.
*/
StoreRatingPrompt = 'StoreRatingPrompt',

/**
* Prompt asking to give feedback.
*/
FeedbackPrompt = 'FeedbackPrompt',
}

export interface AppRatePreferences {
/**
* Custom BCP 47 language tag
Expand All @@ -54,14 +71,14 @@ export interface AppRatePreferences {
* the type of review display to show the user on iOS
* Default: AppStoreReview
*/
ios?: AppRateReviewTypeIos
ios?: AppRateReviewTypeIos;
/**
* the type of review display to show the user on Android
* Default: InAppBrowser
*/
android?: AppRateReviewTypeAndroid
}
android?: AppRateReviewTypeAndroid;
};

/**
* Simple Mode to display the rate dialog directly and bypass negative feedback filtering flow
*/
Expand All @@ -71,7 +88,7 @@ export interface AppRatePreferences {
* Disabling would skip displaying a rate dialog if in app review is set and available. Defaults to `true`
*/
showPromptForInAppReview?: boolean;

/**
* leave app or no when application page opened in app store (now supported only for iOS). Defaults to `false`
*/
Expand Down Expand Up @@ -139,18 +156,18 @@ export interface AppRateCustomLocale {
}

export interface AppRateLocales {
addLocale(localeObject: AppRateCustomLocale): AppRateCustomLocale
addLocale(localeObject: AppRateCustomLocale): AppRateCustomLocale;

getLocale(language: string, applicationTitle?: string, customLocale?: AppRateCustomLocale)
getLocale(language: string, applicationTitle?: string, customLocale?: AppRateCustomLocale);

getLocalesNames(): { [prop: string]: AppRateCustomLocale; }
getLocalesNames(): { [prop: string]: AppRateCustomLocale };
}

export interface AppRateCallbacks {
/**
* call back function. called when user clicked on rate-dialog buttons
*/
onButtonClicked?: (buttonIndex: number) => void;
onButtonClicked?: (buttonIndex: number, buttonLabel: string, promptType: AppRatePromptType) => void;

/**
* call back function. called when rate-dialog showing
Expand Down Expand Up @@ -284,11 +301,9 @@ export class AppRate extends IonicNativePlugin {
return;
}


/**
* Immediately send the user to the app store rating page
*/
@Cordova()
navigateToAppStore(): void {
}
navigateToAppStore(): void {}
}

0 comments on commit 4fb07fa

Please sign in to comment.