Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do Web Push Notifications work in an Apache Cordova Android app?

I'm working on a progressive web app (PWA) that will also get embedded into an Android app with Apache Cordova. Will Web Push Notifications work for an Apache Cordovo Android app like native push notfications or do I need to use a plugin for that?

like image 836
Tom Avatar asked Oct 28 '25 07:10

Tom


2 Answers

PWA will be just a SPA which will render on web-view and Cordova will provide the bridging between native and PWA.

Now the point, is Cordova support PWA?

In general, Cordova has little to do with PWAs. Yes, there is a Cordova browser platform . But that does not matter much, because very few plugins support it. You need to check the docs of each plugin you are using, to see if they support the browser platform.

As far as your requirement looks you can use use phonegap-plugin-push which also support browser platform.

Reference:

1. https://github.com/phonegap/phonegap-plugin-push/blob/master/docs/PLATFORM_SUPPORT.md

2. https://github.com/phonegap/phonegap-roadmap/issues/180

like image 186
NullPointer Avatar answered Oct 31 '25 07:10

NullPointer


I would like to add an update to this question. As of 2021, Phonegap is no longer maintained and has been discontinued by Apache.

On their website

Adobe has discontinued PhoneGap Build and ended investment in PhoneGap and Apache Cordova.

On August 2020 Apache wrote this article on their blog

In the context of these developments and declining PhoneGap usage, Adobe is focusing on providing a platform that enables developers to build, extend, customize and integrate with Adobe products. Today, we are announcing the end of development for PhoneGap and PhoneGap Build and the end of our investment in Apache Cordova. The PhoneGap Build service will be discontinued on October 1, 2020.

If you are developing a PWA or Hybrid app, you are better off utilizing Ionic or BEST case scenario the Cordova Cli. Phonegap and any phonegap components and/or plugins should not be a solution of choice if you want to avoid smashing your head up against a wall further down the line.

New solutions (2021)

  1. Ionic Framework with Push Notifications
  • https://ionicframework.com/docs/native/push/
  1. Cordova Cli Push Plugin
  • https://github.com/havesource/cordova-plugin-push
like image 31
Grogu Avatar answered Oct 31 '25 06:10

Grogu