phonegap / phonegap-plugin-push

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

Feature Request: Play sound as alarm sound #1176

Open meisterm opened 8 years ago

meisterm commented 8 years ago

Hi all,

could it be possible to play a sound like an alarmsound. So the sound will be played with the volume of the alarm volume like the alarm clock?

Regards, meisterm

macdonst commented 8 years ago

No, it is not possible. The volume of the sound played when a push notification is received is controlled by the OS as set by the user.

meisterm commented 8 years ago

Yes. But there is definitly the possibility to use a different stream for sound playback. https://developer.android.com/reference/android/media/AudioManager.html STREAM_ALARM is used for Alarmsounds which will be played with a different volume. (It's possible to define different volumes) So you can have a muted Soundvolume or Ringtonevolume and a loud alarmvolume for your alarm clock for example. The plugin should play with the STREAM_ALARM if there is set a special flag in the payload. That's my wish :-)

macdonst commented 8 years ago

@meisterm I spoke too quickly there is a way to set the sound with AudioAttributes that can be used to indicate an alarm.

markterrill commented 8 years ago

I am very very interested in this +1001 ;)