Tôi sử dụng navigator.notification.confirm và gọi nó khi người dùng đạt đến một điểm nhất định hoặc sử dụng ứng dụng của bạn rất nhiều. Tất nhiên bạn cần phải thêm liên kết của riêng bạn vào.
Lưu ý đoạn mã này tham chiếu các phần khác của ứng dụng để tùy chỉnh để đáp ứng nhu cầu của bạn.
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']);
}
Nguồn
2012-03-22 21:13:18
Ai đang thay đổi liên kết hợp lệ của tôi, xin vui lòng dừng lại. – logancautrell
Đó là một trình gửi thư rác đại diện, anh ấy đã bị treo trong một tuần. Chúc mừng cho quay trở lại, thời gian tiếp theo bạn cũng có thể gắn cờ cho sự chú ý mod để có spammer xử lý trước đó. –
Cảm ơn bạn đã cập nhật và sẽ thực hiện trong tương lai! – logancautrell