Native notifications

I’ve looked through the ionic source and realized that native notifications using org.apache.cordova.dialogsare not implemented.

Are there any plans for this or are there any reasons I’m not aware of why this doesn’t make sense ?

Any of the cordova plugins can be implemented with ionic, just only a few of them have been included with the CLI. You can add the dialog plugin via cordova’s plugin add command.

$ cordova plugin add org.apache.cordova.dialogs

Then you’ll have access to all of the plugins features.

    'You are the winner!',  // message
    alertDismissed,         // callback
    'Game Over',            // title
    'Done'                  // buttonName

I’m aware of that. I think I didn’t described precislly enough what I meant.

I’m talking about when using $ionicPopup.alertthat this will trigger automatically the native notification alert.

Ahh, alright. No, when you trigger a popup, it is our own implementation of an alert basically.

Yes, I know.
The question was: Are you’re going to implement native notifications or are there reasons against it ?
I think it will result in a better native-like user experience for hybrid apps.

There are somethings in the works for notifications :smile:

@mhartington do you see any disadvantages when using $ionicPopup compared to Cordova Dialogs?

1 Like

Depends oh what you need. If you need something like push notifications from apple or google cloud messages, it’s best off to use cordova notifications.

But if you’re just using them for in app notifications or in place of alerts, and don’t mind if they aren’t native, then ionic’s popup should work just fine

I’ve played with Corda Dialogs for a bit now and they work fine. Except they look like they have the style from Android 2.3. Do you know anything about this? I’m using a Nexus 5 with Android 4.4

They styling of the alerts is set in the plugin itself, android has themes or styles for alerts that can be used when calling the alert so that being said I would think this is plugin specific, ionic is just a framework ( currently )

That being said I don’t know if ionic would bake this into the css framework as it would close it out to only cordova and close it out to people who use or other non-cordova build systems.

I generally prefer to use the ionic pop ups because it has a uniform experience on both apps and is simple JavaScript. Also it can be themed to take apps skin which native cannot offer.
My Advice, use Ionic popus always except u are forced to use native for some reason.

1 Like

You can delete the cordova theme on these dialogs.
In the androidManifest of your project there is:

<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/app_name" android:name="HelloCordova" android:theme="@android:style/Theme.Black.NoTitleBar">

If you delete android:theme="@android:style/Theme.Black.NoTitleBar"
Dialogs will have the native android look

Sorry for the late reply, but that change helped!