katzer / cordova-plugin-local-notifications

Cordova Local-Notification Plugin
Apache License 2.0
2.57k stars 1.75k forks source link

App crash when notification is launched #1838

Closed felipegonzalez1994 closed 2 weeks ago

felipegonzalez1994 commented 5 years ago

install the plugin and try to launch a notification with a button, but the application closes, I have installed the geolocation-background plugin , it will be a problem of compatibility of plugins?

apparently it is an ionic update error, create a blank project and install and configure the plugin and re-crashe the app.

Your Environment

Expected Behavior

App send notification when button is activated

Actual Behavior

when button is activated app is closed(crashed).

Steps to Reproduce

-in appmodule.ts import { LocalNotifications } from '@ionic-native/local-notifications/ngx'; ... providers: [ BackgroundGeolocation, LocalNotifications ... ]

-in home.ts import { LocalNotifications } from '@ionic-native/local-notifications/ngx'; ... constructor(private backgroundGeolocation: BackgroundGeolocation, public plt: Platform, private localNotifications: LocalNotifications) ... notificationTest(){ this.localNotifications.schedule({ id: 1, text: 'Notificacion', data: { secret: 'secret' } }); }

matamune94 commented 5 years ago

me too, someone can help ?

matamune94 commented 5 years ago

it worked with this

      cordova.plugins.notification.local.schedule({
        text: 'Delayed ILocalNotification',
        led: 'FF0000',
        smallIcon: 'res://mipmap-ldpi/ic_launcher.png'
      })
PsionicAlch commented 5 years ago

What is the android version of the device you tested on?

matamune94 commented 5 years ago

What is the android version of the device you tested on?

7 > 9.0

PsionicAlch commented 5 years ago

What is the android version of the device you tested on?

7 > 9.0

There is a known issue with the cordova local notifications package that causes the app to crash if you don't implicitly stipulate smallIcon

chengda commented 4 years ago

config.xml

<config-file target="AndroidManifest.xml" parent="/manifest">
            <uses-permission android:name="android.permission.WAKE_LOCK"/>
</config-file>
hpp-hash commented 4 years ago

it worked with this

      cordova.plugins.notification.local.schedule({
        text: 'Delayed ILocalNotification',
        led: 'FF0000',
        smallIcon: 'res://mipmap-ldpi/ic_launcher.png'
      })

Thank you. You save my life

seunexplicit commented 4 years ago

Thanks to this thread, it helps after so many month of experiencing the same issue