I have Notification Channels set up with custom sounds using the SetSound() method. The sounds are stored as resources in the raw folder. For the most part these notifications work and the custom sound is played correctly.
We allow users to change the notification sound from within our app. To handle this we delete the existing channel and create a new one with the new sound - this means that notification channels may be created, deleted and recreated. (I'm not sure if this related or not.)
However, some of our customers have gotten the app into a state where the notifications no longer plays a sound and the only way to resolve the issue is to uninstall and reinstall the app.
In the device's Settings > App > Notifications all the settings are correct and under Sound 'App Provided Sound' is selected. When debugging a device that is having this issue, I've confirmed that the Notification Channel settings are pointing at the correct resource file. I've also called 'OpenRawResource(resourceId)' in the Notification handler to confirm that the app can open the resource file, but FCM isn't playing the sound file.
Is there any way to resolve this? Or any recommendations on how to debug this further?
Related
how to make the telegram's sound notification like an alarm, so that whenever there is a new post in the channel the phone keeps beeping like an alarm.
One possible solution on the iOS would be to forward messages from the channel (that's not mine, but I am a member) to my phone via SMS, as you can set a constant alarm for SMSes on iPhone.
I do not really have any better ideas on how to do this, so I am open to any clues that you can come up with. Maybe some of you know if there is any other way to achieve the same result on ios, android, windows phone or computer.
Thanks
To set a custom notification sound for any app, do as follows:
Settings : General : Apps & Notifications : App info
Now scroll to the app that you want to customise. In this case, select Telegram by pressing it.
Select "App notifications". Now you can select a default notification, but more particularly, you can pick a group or contact from the list.
The default setting for importance is "medium: no sound". Press that and change it to "Urgent" or "High". Go back one screen. Now you can select the sound, by pressing "Sound". Pick a sound, or add a custom sound by pressing "+" at the top right.
If you want to record something, like a voicetag that says "Telegram from Tom", simply move a recording of that into the "music" folder on your phone, select it as above and when a message comes in from Tom, you'll hear the message played.
These steps were taken on Android 8 on an LG G6, but should be similar for other phones. For older versions of Android this feature may not be available. IOS? Sorry, none around here.
You can also do this in the Telegram app: Screenshots below.
The channel members would need to set a specific alarm sound for the channel. There is no way the sender of a message (not even a bot) could modify the sound of a notification.
I have integrated the latest cast SDK within my Android application. It does play media correctly and I'm able to control the playback via on-screen controls as well as via the status bar notification and lock-screen.
I have received, though, reports from some users saying that after a while listening to the media via cast, when their devices went to sleep/got locked, they were not in sync with the receiver anymore as well as losing the possibility of controlling the playback.
I was not able to consistently reproduce the issue (since forcefully locking the device keeps the connection for a while), but I could see it happening a number of times and was able to catch logs for one of them.
At first, I was suspecting that the receiver's messages were not arriving to the sender (android app), but the Google Home application works flawlessly and updates the metadata and playback controls correctly. So, the pain point must be in my application.
I did notice that, while in that "inconsistent state", I am still able to read logs after a track finishes (so, change of state) as follows:
02-05 00:02:08.958 16642-27384/? W/CastDeviceController: [controller-0335 API] Ignoring message. Namespace 'urn:x-cast:com.google.cast.media' has not been registered.
Do I need to register that protocol within my application? (I do use a custom protocol to send messages - and if I'm not mistaken, the "unregistered protocol" is the default one - shouldn't it be automatically registered?). If so, how can I perform that registration?
Any help will be appreciated.
I have an app (NFC Sniffer) which allows users to read NFC tags. When a user attempts to read a tag, 1 of 3 things happens:
Nothing, the tag was not brought close enough
Detected NFC, but fails to read card, in which case a notification tone is played.
Reads tag, in which case a different notification sound is played.
Lots of new users are confused about these notification sounds. I want my program to have a help screen, with buttons to play these two sounds.
But how do I locate and play these two notifications from my code?
You can get these sounds from the sources of the AOSP project and include them in your own app. The sounds are part of the NFC system service app:
https://android.googlesource.com/platform/packages/apps/Nfc/+/master/res/raw/
Btw. starting with Android 4.4, you can disable the sounds while your activity is in the foreground by using the reader mode API with the flag NfcAdapter.FLAG_READER_NO_PLATFORM_SOUNDS.
My app is using the new VoicemailContract functionality in ICS to insert voicemails that show up in the stock call log. I've got it working perfectly, but I can't figure out how to control the new Voicemail notification that pops up when the new voicemails are added. The notifications seem to be controlled by the Phone app, and even if I manually update the voicemail's IS_READ attribute, the notification doesn't go away. In fact, I can delete the voicemail altogether, and the notification doesn't go away. The only way that it goes away is if that notification is clicked, or if I manually go into the call log and open one of the new voicemails.
Does anyone have any idea on how to control that programmatically from my app?
Unfortunately you can't. Status bar notifications can only be cleared by the app that placed them there. The phone app is the app that placed it there and this is why only that app is able to clear it.
I wish there was a way to do this myself, but currently, there is not :(
Basically what the title is saying. I'm trying to make a small app that can determine what audio file was just played for a notification, and react based on that. Is there a way to monitor all incoming notifications on android to get this effect?
I ended up going with the "Accessibility Service" as a way to read all incoming system notifications, and then handled them appropriately depending on what type of even was happening. I discovered that this is also how applications like Tasker handle similar functionality.
More information is available here:
http://developer.android.com/reference/android/accessibilityservice/AccessibilityService.html
No, the stream of notifications is not available to applications. (It would be a security hole, allowing any installed app to read your email, for example.)