Setting the number of vibrations when receiving a notification.
Hello Congratulations and thank you for this great application. I use this app to receive notifications from a sick person - my father - monitoring system. It works perfectly but I would like to have an additional setting. That is, I would like to be able to set the number of vibrations from 1 to 5 when I receive a notification. Indeed currently there is only one vibration, which is often not enough to wake me up. So if I could adjust the number of vibrations to 3 or 5 for example, I would be sure to wake up so as to treat my father. Thank you in advance and congratulations for your work and sharing.
Hey @steneor thanks for your feedback!
We could add 'vibrations amount' as an extras property (gotify/server#120). It could be under the namespace android::notification::vibration::amount.
Issue requires #50
Hi again, Thanks a lot for your answer. I am looking forward to the next release !
I suggest what we design a schema to describe the notification effect on android.
I suggest that notification is encapsulated in one extra key which describes whether displays a notification on the notification bar, how to vibrate, etc.
{
"extras":{
"android::notification":{
"notification":{
"show":true,
"click":{
"action":"open-url",
"url":"http://example.com/example.html"
}
},
"alarm":{
"vibration":{
"force":true,
"pattern":{
"pattern":[
200,
300,
200,
300
],
"amplitude":[
-1,
-1,
-1,
-1
],
"repeat":3
}
}
}
}
}
}
Maybe we can start with vibration pattern and then add support to other properties.
@eternal-flame-AD Yeah seems good 👍. However I don't like that there is pattern.pattern, maybe there is a better naming for it (:.
Maybe call it "pattern.timing" so it is in accordance with the VibrationEffect API?
Yup, thats better.
I sent it extra data, but not received it on app.

In 'WebSocketService.java' file, extras values are null 'showNotification' function. Is it possible to send extra data on server?
@happymario, please create a new issue, and don't comment on already existing one, which doesn't have exactly your problem.
Like described in https://gotify.net/docs/msgextras extras must be send with a application/json request. You send it with form-data.
Thank you I sent it json request.
curl --location --request POST 'http://192.168.0.135/message?token=AnU.0L_1wm8qV8P' \
--header 'Content-Type: application/json' \
--data-raw '{
"titie":"test",
"message":"test",
"priority":0,
"extras": {
"client::display": {
"contentType": "text/plain"
}
}
}'
It works well.
Closing as not needed as there aren't many upvotes or comments from other users.