iOS Question Long (forever) notification sound

marcick

Well-Known Member
Licensed User
Longtime User
Is there any trick today to produce a notification sound (notification sent via Firebase) that play forever until the user open the app ?
I do it in B4A using Mplayer loop. When I developed the B4i version of the app some years ago, I knew there was not an equivalent, so I've create a custom sound that play for 20 seconds.
20 seconds is not forever but it was a workaround. Now I see that the 20 seconds sound is interrupted quickly (5/6 seconds) and no longer looks like a long sound.
Nothing to do than accept it ?
 

hatzisn

Well-Known Member
Licensed User
Longtime User
You can loop around. Get the push nottification play the sound and in 10 seconds make an MQTT post to an MQTT backend. Modify the software that sends the notification by @Erel to connect to the same MQTT Server and when it receives this Payload, after 10 seconds send a new notification and... "around, around, we go...".
 
Upvote 0

hatzisn

Well-Known Member
Licensed User
Longtime User
You can loop around. Get the push nottification play the sound and in 10 seconds make an MQTT post to an MQTT backend. Modify the software that sends the notification by @Erel to connect to the same MQTT Server and when it receives this Payload, after 10 seconds send a new notification and... "around, around, we go...".

Also make sure that you have understood I did not read your initial message completely before answering, so re-evaluate the times mentioned in my message... 😂😂
 
Upvote 0

marcick

Well-Known Member
Licensed User
Longtime User
Not sure I've understood. I think no code is executed when a notification is received ......
 
Upvote 0

hatzisn

Well-Known Member
Licensed User
Longtime User
Not sure I've understood. I think no code is executed when a notification is received ......

There are the silent push notifications. These bring in the front for a while the app to execute some tasks.

 
Upvote 0

marcick

Well-Known Member
Licensed User
Longtime User
I have read that thread but I see that when the user kill the app they does not work.
If it is not reliable it is unuseful ......
 
Upvote 0

hatzisn

Well-Known Member
Licensed User
Longtime User
I have read that thread but I see that when the user kill the app they does not work.
If it is not reliable it is unuseful ......

Indeed this is a problem. But you can tell your users never to kill your app but keep it in the background (I mean not physically sending it off-screen by swipping).
 
Upvote 0

marcick

Well-Known Member
Licensed User
Longtime User
Indeed this is a problem. But you can tell your users never to kill your app but keep it in the background (I mean not physically sending it off-screen by swipping).

It's a lost battle ... a good app should always work and stop. Standard notifications always arrive. Silent notifications it depends. Not good.
 
Upvote 0

hatzisn

Well-Known Member
Licensed User
Longtime User
Maybe you can check if it is activated from your backend (maybe send a silent notification and wait for an mqtt report "I am ready" in your backend and if you do not receive it sends simple notification reminding them to open the app and put it in the background). This is just a workaround.
 
Last edited:
Upvote 0

marcick

Well-Known Member
Licensed User
Longtime User
Well, this open the door to another issue: when you are not using your device (screen black, device is on the table) after some time it enters in a sort of energy saving mode so that you may encounter delays in receiving notifications. So my server doesn't receive immediatly the "I'm ready" message and an unwanted behaviour is triggered.
But to be honest I never tryed with silent notification , maybe they have a higher priority than standard notifications and your suggestion works.
I'll give it a try, thanks a lot for your support.
 
Upvote 0
Top