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.
cordova -v): 9.0.0 ([email protected])cordova platform ls): android 8.0.0App send notification when button is activated
when button is activated app is closed(crashed).
-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' }
});
}
me too, someone can help ?
it worked with this
cordova.plugins.notification.local.schedule({
text: 'Delayed ILocalNotification',
led: 'FF0000',
smallIcon: 'res://mipmap-ldpi/ic_launcher.png'
})
What is the android version of the device you tested on?
What is the android version of the device you tested on?
7 > 9.0
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
config.xml
<config-file target="AndroidManifest.xml" parent="/manifest">
<uses-permission android:name="android.permission.WAKE_LOCK"/>
</config-file>
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
Thanks to this thread, it helps after so many month of experiencing the same issue
Most helpful comment
it worked with this