Daily check in Trigger.io mobile application - trigger.io

I want to write a feature in my app that checks local data daily (at a specified time eg. 12:00pm), and alert if needed. Really, I want something kind of like setTimeout() in Node.js.
Does Trigger.io's API give me a way to 'background' a small check, or fire an event at a specific time? Something via the OS,so that the app doesn't have to be running all the time?
I've searched through the API, but might be using the wrong terminology (as a non-mobile dev).

This isn't something currently supported, mainly because its difficult to provide a consistent experience across Android and iOS.
A common solution to this kind of problem is to have the check performed on a remote server, then use a push notification to notify the user if required. (see http://docs.trigger.io/en/v1.4/partners/parse.html#partner-parse)
The reason doing this on the device is difficult is that on iOS you cannot just run code in the background, it is possible to send a notification to the user at a specific time but this notification has to be set in advance.

Related

Best way to push iOS notification after calculating result from its input received for a network call?

I'm working on something where my iOS app will give 2 input parameters to some server side setup. The server side will periodically run a google API network call and get its result response X. When this X is the right answer, I want the server side to send my iOS app a push notification. This needs to happen for every app user individually.
I know the iOS coding part, and also know how to setup a iOS push notification.
But what’s the best way to setup this server side code? Are there some free cloud instances that I could use?
I’ve looked into Firebase and Google Cloud console that I can combine with a cron job to make regular network calls, but they seem to have a fair bit of complexity involved (especially since it’ll be inputs from per app install so it'll become one cron job per app install).
Is there a better way to achieve this?
figured it out.
for future visitors, i’m writing how i achieved it -
the client sends inputs to the firebase DB, and a firebase cloud function scheduler periodically reads those values to calculate output from google api call. when the output is right, the firebase cloud function sends notification to the client

Is it possible to create a call tracking app on iOS?

From all I have read here, creating a call tracking app on iOS seems impossible. However, after some investigation, I have found a couple of workarounds and would like to know if they are legal and would work at all.
So, at least, I will need one of these features:
access call log history. I've read that's impossible, but also I know that on many devices where iCloud backup is turned on, call history data is saved there, so using some API, for example, this, I can access it. Am I right?
receive notifications when the call is ended. I've read this is possible only in foreground, therefore makes no sense. But following this question, I see that you can initiate calls from the application, which allows at least to track outgoing calls.
Would this be enough or I am wasting time?
Unless you're running on a jailbroken device, the answer is no because there is no publicly available API that provides access to the call list and that is a good thing from a privacy point of view.
A quick search shows that CallKit is for integrating VOIP into the call list, so again the answer is no, CallKit will not be of any use to you.
The notifications are there so that your app can respond properly to calls that take place while it is active.

How do social networking apps update their UI in real-time?

I was wondering how social networking apps, such as Twitter, Facebook and WhatsApp update their user interface in real-time when another user interacts with the user of the app. To use the best example I can think of: when you have a chat window open in WhatsApp, the UI updates automatically (without any user actions required) when the user you're chatting with interacts with you. Messages appear on your screen without refreshing and the "last seen" status at the top of the screen updates automatically when your chat partner either goes offline or comes back online. I can think of two ways to achieve this:
Remote push notifications: this approach strikes me as the 'cleanest' way to do this, but it's probably also the riskiest way. Using silent notifications (content-available) to pass data to another device at the moment a user does something, would probably save you a lot of HTTP requests and therefore would make your app consume a lot less data and CPU usage. The risk of this approach is that a user can easily disable ALL push notifications to save battery power (including silent notifications) and then your app wouldn't be able to get notified on events remotely.
Local UI refreshing: This approach is obviously the safest, but I think it's really 'nasty' and eventually everyone would feel the downside of it. Constantly refreshing the UI and re-retrieving data from the database to make sure the latest messages and statuses are displayed to the user would be safe in the way that your app doesn't have to rely on the device's battery and background mode settings, but the downside is that this will make your app consume a lot of data and battery power, which would be bad for the user's data plan and his device. I also don't think Apple would approve of an app that's consuming so much data and power.
I've just implemented a chat function into my own app, and I want to enable the same real-time UI updating that WhatsApp uses. What would be the best way to do this? Should I use one of the two methods above or can someone think of another way to do this? By the way, I'm a relatively new programmer who just recently learned how to develop iOS apps (Swift). I'm very far from being a pro, so please go easy on the explanations and work method capabilities. Thanks!
The chat apps make use of WebSockets to create a constant connection with the client and a backend server.
This article on Appcoda can help you start learning about Socket.io. It answers your questions and also helps you to create a demo app.

Detecting outgoing emergency call vs Developing custom dialer app

My goal is to listen only and not modify the outgoing call event and send GPS coordinates to server from background. I'm not even interested in phone number being dialed, what I only need to know is whether the current call is Emergency call.
I've accomplished this easily in android, by following this tutorial.
However some googling showed that, this is a big pain in the ios world.
The only solution I think is to write dialer app from scratch and manage all the events by myself (if that's even possible), but I think it's too overcomplicated
I'm completely new to ios and please let me know, how would you solve this problem guys?
There is no way this will be possible on iOS unless you were planning to release and app for jailbroken phones (and even then I'm not sure it is). The Core Telphony framework has the methods you can use: https://developer.apple.com/library/ios/documentation/NetworkingInternet/Reference/CoreTelephonyFrameworkReference/index.html

How can my iPad app subscribe to a RESTful web service so it would update automatically?

I am looking for ways where my RESTful web service can let my iPad app know to update its cached data when the server's data has been updated. The server is running on Tomcat & Apache Jersey.
Is this doable? And not using Apple Push Notification (APN)?
There are essentially two options: heartbeat check from the app to the server (on a timer) or something that keeps the line of communication open, such as web sockets. Here is an open source web socket for iOS, but I have not personally experimented with it:
http://code.google.com/p/unitt/wiki/UnittWebSocketClient
I'm not sure why you want to avoid APN, but this really sounds like what it's made for.
If you want to update only when your app is running, there are other options (straight forward polling comes to mind), but if you want the user to be notified even when the application isn't running, there isn't really any other Apple approved way to do it.
Can reverse the design around and make your device a client and pull data from a REST service at a regular interval?? With all the support one gets from REST, it might be helpful to know you will have complete control of when data is being pulled by the device from server and exactly the data that might goto device.
I'm curious to know your thoughts, Thanks.
I'll be building a web-syncing iOS application soon, and we're going to use RestKit. Take a look, it might be a big help.

Resources