pushandplay / cordova-plugin-apprate

This plugin provide the "rate this app" functionality into your Cordova/Phonegap application
Apache License 2.0
300 stars 190 forks source link

Incorrect logic in AppRate.showDialog method when customize the reviewType #287

Closed Joe-song-77 closed 3 years ago

Joe-song-77 commented 3 years ago

With 1.60 version, the rating dialog will not be shown if there are the customized reviewType. E,g, AppRate.preferences = { displayAppName: 'Fiori Client', simpleMode: true, reviewType: { ios: 'InAppBrowser', android: 'InAppBrowser' }, }

To check the code logic in method showDialog of AppRate.js, I think there is wrong logic here. See below code snippet: _if (isNativePromptAvailable && AppRate.preferences.reviewType) { if ((IS_IOS && AppRate.preferences.reviewType.ios === 'InAppReview') || (ISANDROID && AppRate.preferences.reviewType.android === 'InAppReview')) { updateCounter('stop'); AppRate.navigateToAppStore(); } } else if(AppRate.preferences.simpleMode) {**}

The code logic will not go into else if block if there is customized reviewType. Probably, I think the code logic should be: _if (isNativePromptAvailable && AppRate.preferences.reviewType && ((IS_IOS && AppRate.preferences.reviewType.ios === 'InAppReview') || (ISANDROID && AppRate.preferences.reviewType.android === 'InAppReview'))) { updateCounter('stop'); AppRate.navigateToAppStore(); } else if(AppRate.preferences.simpleMode) {***}

Could you please double check this? Thanks!

westonganger commented 3 years ago

v1.6.1 is now released which fixes this