navigator.notification.confirm(
'Do you agree with our privacy policy?', // message
onConfirm, // callback to invoke with index of button pressed
'Privacy Policy', // title
['Agree','Disagree'] // buttonLabels
);
function onConfirm(buttonIndex) {
if(buttonIndex == 1) {
// User agreed with the privacy policy
} else {
// User disagreed with the privacy policy
}
}
官方有一个插件:cordova-plugin-dialogs
不过隐私同意的内容要你自己写