如何在phonegap应用程序中实现"评价我们"功能

xus*_*xus 17 html5 app-store ios cordova

我希望在我的应用中添加某种"写评论"或"评价我们"功能,以便我的客户可以轻松评价和评论我的应用.

问题是应用程序是使用手机间隙实现的.是否可以使用html5-phone差距实现此功能?

谢谢!

wil*_*ell 26

我使用navigator.notification.confirm并在用户到达某个点或使用你的应用程序时调用它.当然,您需要添加自己的链接.

请注意,此代码段会引用我应用的其他部分,以便根据您的需求进行自定义.

if (settings.core.rate_app_counter === 10) {
    navigator.notification.confirm(
    'If you enjoy using domainsicle, whould you mind taking a moment to rate it? It won\'t take more than a minute. Thanks for your support!',
    function(button) {
        // yes = 1, no = 2, later = 3
        if (button == '1') {    // Rate Now
            if (device_ios) {
                window.open('itms-apps://itunes.apple.com/us/app/domainsicle-domain-name-search/id511364723?ls=1&mt=8'); // or itms://
            } else if (device_android) {
                window.open('market://details?id=<package_name>');
            } else if (device_bb){
                window.open('http://appworld.blackberry.com/webstore/content/<applicationid>');
            }

            this.core.rate_app = false;
        } else if (button == '2') { // Later
            this.core.rate_app_counter = 0;
        } else if (button == '3') { // No
            this.core.rate_app = false;
        }
    }, 'Rate domainsicle', ['Rate domainsicle', 'Remind me later', 'No Thanks']);
}
Run Code Online (Sandbox Code Playgroud)