Skip to content
This repository was archived by the owner on Sep 15, 2021. It is now read-only.

Commit d814c36

Browse files
author
Phil McCloghry-Laing
committed
$cordovaAppRate sets callbacks correctly (onButtonClicked, onRateDialogShow)
1 parent ce58c66 commit d814c36

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/plugins/appRate.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ angular.module('ngCordova.plugins.appRate', [])
4343
*
4444
* @param {Object} customObj
4545
* @param {string} customObj.title
46+
* @param {string} customObj.message
4647
* @param {string} customObj.cancelButtonLabel
4748
* @param {string} customObj.laterButtonLabel
4849
* @param {string} customObj.rateButtonLabel
@@ -80,13 +81,11 @@ angular.module('ngCordova.plugins.appRate', [])
8081
},
8182

8283
onButtonClicked: function (cb) {
83-
AppRate.onButtonClicked = function (buttonIndex) {
84-
cb.call(this, buttonIndex);
85-
};
84+
AppRate.preferences.callbacks.onButtonClicked = cb.bind(this);
8685
},
8786

8887
onRateDialogShow: function (cb) {
89-
AppRate.onRateDialogShow = cb();
88+
AppRate.preferences.callbacks.onRateDialogShow = cb.bind(this);
9089
}
9190
};
9291
}];

0 commit comments

Comments
 (0)