I was using a simple javascript confirm() dialog in my app when I discovered that on an iOS device, the confirm dialog title says “index.html”. So I’m going to switch to the cordova native dialogs plugin. My only problem now is that when I do a ionic serve it throws a runtime error “Uncaught (in promise): cordova_not_available”
I get that ionic serve can’t use native plugins, but is there any way that I can use the Dialogs plugin and have it fallback to a javascript confirm when the plugin isn’t available? or is there a different approach I could use? This is just a simple confirmation that the user wants to delete something.
And then in my page (after injecting the dialog service):
this.dialogService.confirmDialog("Are you sure you want to delete this message?", "Confirm").then(
(confirmation) => {
if (confirmation) {
// do deletion here
}
}
);
This seems to work, albeit I feel like it’s a little much just for a simple dialog…But it works on devices and when serving to browser