phonegap / phonegap-plugin-push

Register and receive push notifications
MIT License
1.94k stars 1.91k forks source link

Wished: dynamic sound notification #2007

Closed aagaardmorten closed 7 years ago

aagaardmorten commented 7 years ago

Thanks for a great plugin! Currently, the sound notification can be 1) standard OS sounds, 2) native app files.

I am keen on designing an app that has a expressive sounddesign. That mean, I want to play a sound that reflect the stage of a treatment(health). E.g. do a patient have to do 50 exercises/50 notifications. The sound design should include a audiolisation of the progress of the treatment. The wish is that the PUSH plugin are able to call an javascript library with an json paramenter.

It might sound as a odd request, but Notifications is used more heavily and the most important ones has to have a unique design that persuade/nudges them to the right behaviour.

fredgalvao commented 7 years ago

At the moment of the notification arrival and display, there is no javascript or cordova context guaranteed to be alive, so I'm afraid our current design doesn't allow for such a feature to exist properly. Waking up your whole app on notification arrival just to have a webview to call a function on seems like overkill, and opens up a lot of gates from hell.

However, keep in mind that neither cordova nor this plugin are closed source, or even try to block you from additional native code (java/kotlin), so there's actually nothing preventing you from forking this plugin and making it do whatever it is you need when the notification arrives/displays, if it ever comes to that.

macdonst commented 7 years ago

@aagaardmorten your idea sounds cool but it's way out of scope of this project.

lock[bot] commented 6 years ago

This thread has been automatically locked.