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.
Related
I'm implementing an app with an internal calendar, fetched from a remote web service. I want to send a local notification to the user when an event of interest is scheduled in the calendar, at a specific time chosen by him. Just like the iOS calendar app, when you can create an event and ask to be notified X hours/days before it happens. The main difference is that you can't create events: they are downloaded from a pre-populated remote calendar.
In Android I've solved the problem by using AlarmManager, while in iOS with Swift 3 the closest I've got to porting the same solution was via opportunistic background data fetch. The main difference between the two solutions is that background data fetch doesn't work when the app has been killed.
It would be really important for me that local notifications worked even when the app is killed. I think users expect apps notifications to work even when the app is closed, like it happens with WhatsApp or Facebook. I know that those notifications are triggered by someone writing something and therefore they are Push Notifications, but the average user just expects notifications to keep working even when the app is closed.
What would be the most elegant solution to "emulate" the behaviour of Android's AlarmManager in iOS?
Scheduling a bunch of notifications in advance hoping that the user will eventually open the app before all of them are dequeued looks a badly designed solution.
Also, delegating all the work to the server and push the notifications to the subscribed devices looks quite bad too as it requires much more work on the server side. Plus it requires a server which is able to awake itself to send push notifications, which is something that I don't have. I only have a simple webserver which answers to HTTP requests.
EDIT : The ideal solution I'm looking for isn't any of the previous 2 options, since I find them more like workarounds than actual elegant solutions to what I perceive being a fairly common problem. There has to be a third option...
In iOS there is no way to achieve this. Looking at the documentation of application(_:didReceiveRemoteNotification:fetchCompletionHandler:), it states that
the system does not automatically launch your app if the user has force-quit it. In that situation, the user must relaunch your app or restart the device before the system attempts to launch your app automatically again.
You can receive push notifications, but no code will be executed until the user launches your app. So unless you are sending remote push notifications from a server, you cannot set up new local notifications until the user opens your app.
I am struggling with android services. The purpose of app is to send text message using native system text application. The phone recieves phone numbers from Firebase and sends a message to all the numbers from the list via smsManager.sendTextMessage. I realized that few minutes after screen is locked the app stops running for no reason..
As I already said I tried to keep my app running in background with android services but it is not working. Is there any simple way to achieve this?
There are a number of way to make a Service work even when the device is in sleep mode. This depends on the feature you want to implement. As far as I have understood, mobile numbers will come from server and app will send messages to these numbers.
If you want to do it in a repeating manner, You can use AlarmManager to start the service from time to time, and fetch the numbers and send messages.
You can also use wacklock to keep the service running all the time, but this will be more battery draining.
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?
I am attempting to make an Android app which will allow a user on a queue system to be notified if it's near his turn.
I would like to know if it's possible to make an Android App, that would upon connecting to the internet, connect to a server and then get assigned an ID, which would compare it to other IDs and check it's position on a queue. If it's"for examnple" less then 10 people in front of the user, to send a push notification, even if the app is closed, saying it's almost the users turn.
If it is possible, is there any tutorial available on the matter? I searched a while, and nothing of what i found appeared to be my solution.
Wrong choice of words perhaps.
EDIT: What i am asking for, isn't a tutorial to build the whole app itself, only a tutorial to make automatic push notifications upon connecting to the internet basically
I always thought WhatsApp uses c2dm for message delivery. But when I see running apps MessageService is always running. You don't need a service to be run to receive c2dm.
Why keep the service running all the time?
Facebook is even more strange they have 3 services running. One of them is for uploads. Did they start stealing my photos?
Like cached background proccess say - this is an old application proccess that is being kept for better speed in case it is needed again. I suppose, same thing happening with services
WhatsApp uses something like XMPP
WhatsApp uses a customized version of the open standard Extensible Messaging and Presence Protocol (XMPP).
See: http://en.wikipedia.org/wiki/WhatsApp
I'm using GCM myself for a chat application for Android. It's still not working properly if the device is idle for a long time.