Search code examples
androidionic-frameworkpush-notificationcapacitor

Error in implementing push notification on Android


I am creating an ionic-angular app. I tried to use push notification with the capacitor plugin. But I got an error like this. Can anyone help me?

**"ERROR Error: Uncaught (in promise): Error: "PushNotifications" plugin is not implemented on android
Error: "PushNotifications" plugin is not implemented on android"**

Solution

  • Check your MainActivity.java within your project. In the last version of Capacitor you have to remove the code "onCreate".

    See: https://capacitorjs.com/docs/updating/3-0#switch-to-automatic-android-plugin-loading