Native Dialogs not showing

Hello!
I’m trying to use Native Dialogs in iOS app.

So, I have installed cordova and ionic plugins:

$ ionic cordova plugin add cordova-plugin-dialogs
$ npm install @ionic-native/dialogs

I have imported one to app.module.ts:

providers: [
        ...
        Dialogs,
        ...
],

I have declared it inside page.ts:

import { Dialogs } from '@ionic-native/dialogs/ngx';

constructor(
        ...
        private dialogs: Dialogs,
        ...
) { }

Then I’m trying to call it:

this.dialogs.alert('Hello world')

And nothing happened. Dialog not appeared.
What is the problem?

Any Erros in Console?

Nope.
Even, when I’m trying to call:

this.dialogs.alert('Hello world')
        .then(() => console.log('Dialog dismissed'))
        .catch(e => console.log('Error displaying dialog', e));

There is no any messages in console

you can try to debug the natice code in the xcode project

Have you read this? https://github.com/apache/cordova-plugin-dialogs/issues/112

1 Like

Yeah!
Thank you.

I have added:

<meta http-equiv="Content-Security-Policy" content="default-src 'self' gap://ready file://* *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'">

And everything works fine