I searched quite a bit on here and can't figure this one out. All the posted questions refer to setting a notification to go off at a certain date/time or on a schedule. This is not what I am trying to do. It might not be possible and might be a system-controlled thing.
The feature I want to emulate/override/extend/whatever is the Notification Reminder in Android. This feature is part of android and can be set to something like "2 min", "10 min", whatever, and if you don't check the notification from an app then the device will give a little notification sound again to remind you that you still have the notification waiting in your notification bar. Do you know the feature I am referring to? (On my S6 I go to 'Accessibility --> Notification Reminder')
Is there a way for me to create this behavior in my app without relying on the system settings?
I want to make the device remind the user every 30 seconds that they have an unread notification from my app, and only from my app. The 2-minute reminder that Android offers is not enough (and also, it isn't working reliably for my users... can't figure out why. Sometimes it reminds, sometimes it doesn't.)
ALLOW ME BE COMPLETELY CLEAR ABOUT SOMETHING:
This app is being created for a government agency and is not being made to 'please the user'. I understand that there are certain things that are considered wrong, but trust me, that doesn't apply here. This app is for emergency notification for an 'on-call-24/7' unit with devices that are owned by the government. For example, I have a feature that allows the alert sender to force the recipient's ringtone on full blast with a preset tone. Obviously this would be terrible in a public app, but here, it is a requirement.
Thank you very much for any help! If you need me to post code, or more information about my specific implementation of the notification builder then let me know.
UPDATE:
Did my question get lost in the ether? lol, any takers?
Related
Several years ago i developed android app that created alarm clock at certain time when some notification was received. Android programming is complicated they keep changing things make it more difficult for apps to run in background ect.
So for sending notifications i use viber bot which works fine for messages. The problem is that sometimes i want to send an alert (ringtone/music) that last at least 30 seconds since I am sleeping at that time and might not hear simple notification. I know i could change ringtone for viber, but i would like to use it for different purposes with normal notifications. What would work is to set custom ringtone only for certain viber bot but from my understanding this doesn't work. Making a voice call would work but from my understanding this is not possible from command line at least not for free.
I found googles function "locate my phone" that start a ringtone but i didnt find if i can do it outside of web browser. So basically i am searching for a way how i can send command from my linux server that would start ringing on my phone and other people's phone that give me permission.
Any idea ?
Finally I manage to solve this by using using Telegram android app and python script https://github.com/alexander-akhmetov/python-telegram to make a call.
I've read a lot about notifications in iOS now and I'm quite confused about how to reliably schedule notifications, actually. Let me explain my scenario:
I created an Android app that holds a fixed list of dates. The user can not add or remove dates, he can only view that list (garbage removal dates for my area). You can, however, configure that you want to be notified the day before. I've made that app so that when the device starts, a notification timer is started that fires at a certain time, checks whether there are pending items for the next day and if so, shows a notification. Then it re-schedules itself for the next day. So normally, the user doesn't need to open the app at all to receive notifications. He only opens the app once to configure his street, which triggers the first scheduled event, or to actually see the list of upcoming dates.
I'm now trying to port this app to iOS and I understand from what I've read that there's no way to replicate the way I'm doing stuff on Android. I understand that I can create up to 64 notifications for certain points of time in advance, but without the user opening the app at all I can not be sure to reliably schedule all the notifications I may need.
Is there a reliable way to simulate the described Android behavior? Or is there a way to force the user to open up the app once every 30 days or so?
In a nutshell no.
If applicable you can make notifications repeating, but if the dates are random and you can't repeat the notification then you can't schedule more than the limit.
You can't schedule your app to run and you can't force the user to do anything. All you can do is post some sort of notification for 30 days or whenever with some message that you hope will compel them to open your app.
If you have a valid use case for it in your app, you can enable a background mode such as a location change on a cell tower transition for example, then when your app runs in the background re-schedule the notifications. Or remote push, or background fetch etc. But even with background modes you cannot guarantee your app will actually run in the background, you can just help to increase the chances that it might and the different background modes have different degrees of usefulness in this sort of area.
How does an Android alarm app or any other time based notifications app like Calendar, Clock, etc work? More specifically, how does it show up the notifications at exactly the time specified by the user? Does it constantly run in the background and as soon as the required time comes up, does it show the notification? Or does it schedule the notification in Android's kernel before exiting? I am working on an app that needs to give the user notifications at times specifies by him. I am not able to figure out how to do that.
Maybe what you mean is to create an alarm, you can see this example.
I'd like my android auto notification to not have any reply mechanism to it. I just want a notification that you can swipe to dismiss, but the only two options i see for android auto are messaging and audio. The messaging makes the notification have a reply to it like this:
notice how there is a microphone for user to reply. I dont want that on my notification. I only want to display info but no reply mechanism. I am not interested in reply, only to notify user of something. i want it to look like this instead but it seems only system has this kinds of notifications.
Android Auto has defined guidelines for Messaging Apps.
It didn't consider normal notifications as a scenario that needs to be addressed now in Auto environment.
We can hope it may be made more flexible on future along with measures to make sure that distraction is avoided by strict certification process.
So the answer to your question is - Not possible now.
I have an app which is on Android and iOS. I have added a local notification to fire every 24 hours at a time specified by the user of the app. In Android, the local notification functionality is exactly what I need, but in iOS it seems to lack the functionality I need, unless maybe I am missing something...
Lets say the user sets the time the notification is to fire to 11:00am. In Android, at 11AM, it will wake up the app, go to the broadcase receiver and I am able to run code in a method that calls out to an API to fetch the latest data. Once it gets the data, it posts the notification to the user.
In iOS, it seems the data being posted to the user has to be pre-scheduled. So I have to create the notification message during scheduling of the notification. What I need is to be able to do something more like the above example.
So the problem is that at the time of when the notification is scheduled to fire, I need to check for fresh data, not the day before...
Any suggestions?
The same functionality doesn't exactly exist on iOS.
You can setup a local notifications using the functionality of a UILocalNotification object. With this you can set fireDate, etc. which is sort of like a push notification without a server. You can send a message, add a badge on the app icon, play a sound, etc.
Now the issue is that the app doesn't get launched by the OS. The app simply registers a notification in the OS, which is then handled at the fireDate time. This means you won't be able to have a chance to check for data and verify whether to continue with the notification, etc.
UILocalNotification Class Reference