Why are so many ionic native plugins in Ionic not usable especially the local-notification plugins?
I tried baidu-push and phonegap local notification (Both didnt show anything) . Then i tried local-notification from Katzer. After i added the plugin my build crashed when executing the subprocess: processReleaseManifest
Errormessage appears: AndroidManifest.xml:28:13-35 Error:
Attribute meta-data#android.support.VERSION@value value=(25.4.0) from [com.android.support:appcompat-v7:25.4.0] AndroidManifest.xml:28:13-35
is also present at [com.android.support:support-v4:26.1.0] AndroidManifest.xml:28:13-35 value=(26.1.0).
Suggestion: add âtools:replace=âandroid:valueââ to element at AndroidManifest.xml:26:9-28:38 to override.
Manifest merger failed : Attribute meta-data#android.support.VERSION@value value=(25.4.0) from [com.android.support:appcompat-v7:25.4.0] AndroidManifest.xml:28:13-35
After that i saw somewhere the tip to update build.gradle file with this code piece:
The next time i tried to execute the build process i received following error:
\Builder.java:32: error: package android.support.v4.media.app.NotificationCompat does not exist
import android.support.v4.media.app.NotificationCompat.MediaStyle;
Builder.java:130: error: cannot find symbol
.setChannelId(options.getChannel())
^
symbol: method setChannelId(String)
\Builder.java:296: error: cannot find symbol
MediaStyle style;
^
Builder.java:298: error: cannot find symbol
style = new MediaStyle(builder)
^
I followed the documentation how to implement everything. When i remove the Katzer local-notification plugin my build works again. After the last error message i have the conclusion that all Ionic notification plugins i needed and were looking for are deprecated.
Its very sad for me, that i m not able to show a simple notification for my app.
Thank you for your tip. I tried capacitor, but i received now transpile problems. And i followed documentation when adding it to my apps repository: node_modules/@capacitor/core/dist/esm/global.d.ts, line: 3
Property âPluginRegistryâ does not exist on type â"./core-plugin-definitions"â.
Okay, node_modules@capacitor\core\dist\esm\global.d.ts was wrong and transpile works now after i updated global.d.ts with this code piece:
import { Capacitor as _Capacitor } from â./definitionsâ;
import * as _Plugins from â./core-plugin-definitionsâ;
declare const Capacitor: _Capacitor;
@aaronksaunders, I cannot run the app. Currently I only tested it on android. Here the short summary : my app is stable and runs but without any local-notification plugin of Cordova added and without using capacitor. My first goal was using ionic native plug-ins for local-notification but nothing works. Then @netkow gave me the tip with capacitor, but this doesnât work too. Here the build works but I have a frozen white screen after splash screen when running the app. And the big problem is, I really like to have some notification shown when app is closed in the background. Itâs really depressing that itâs so hard to find something ionic cordova based for such a minor feature. But thx for your help anyway.
So @netkow and @aaronksaunders, i didnt continue to work with capacitor but started from the beginning to integrate this plugin and searched the whole web for solutions of my problems. And i managed to get Local-Plugin working. But it was lots of work: big research, configuration changes and one javascript version of local-notification plugin was not working. Through debugging i found out this error:
Uncaught TypeError: Object(âŚ) is not a function at LocalNotifications.schedule (index.js:49) at HomePage.webpackJsonp.76.HomePage.launchNotification (home.ts:76) at home.ts:49 at PrivateChannel.Dispatcher.emit (pusher.js:1596) at PrivateChannel.Channel.handleEvent (pusher.js:3238) at pusher.js:136 at ConnectionManager.Dispatcher.emit (pusher.js:1596) at message (pusher.js:8168) at Connection.Dispatcher.emit (pusher.js:1596) at message (pusher.js:2984) I tried to update @ionic-native and i got the same error, but at the startup of the application.
Then i saw the tip, that user of this plugin should use an version of the module @ionic-native/local-notifications : 4.7.0 ,to access cordova local-notification plugin from Katzer. My version was > 5.0.0 , which didnt work. So i changed the version to 4.7.0. And thats it.