Callbacks when events happen such as new comments or new tasks - asana

Is there a way using the Asana API for my program to receive some sort of notification when items change or are added (such as new tasks, or comments)? I want to make a realtime app that integrates with Asana. For example, using the comments on an item in a way that it's a realtime chat between people. I imagine if Asana API can support this by sockets or long polling, that would be great.

(I work at Asana.) Not yet, but requests for a notification system are common and we are already designing a solution for it. While we are targeting real- or near-real-time responsiveness, I can't say for certain whether it will be appropriate to support "real-time chat" via comments, nor can I give any details on the timeline, but we'll definitely announce it when we launch.

They have recently implemented Events in asana api.

Related

How to send Notification in iOS when using firebase cloud functions?

I have been looking around many different places for how to implement notification sending using cloud functions. And the best I have found is the following: Push notifications using Firebase Cloud Function iOS
But I believe it would benefit many people as well as me, if this fragmentation were fixed with one set of instructions from start to finish.
Thus I ask: How can I implement notification sending when a user creates something at a certain spot in firebase realtime DB?
From start to finish, a very clear explanation for someone doing this for the FIRST TIME.
This is in the documentation for Firebase. This is a specific part of the documentation that uses Node.js as an example to send a message.
I believe this does the trick: https://github.com/onmyway133/blog/issues/64

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.

Real time syncing

I want to develop application same as UBER in which I need to show available taxis in the selected region and update as the taxis are hired, available, unavailable. Kind of auto refresh.
Calling the web service in the background after regular time interval is not a good option.
Can any one suggest me better and fast way to achieve this.
Thanks
Push
Use sockets when the app is running. This will give you immediate updates.
Use Push notifications when the app is not running (use notifications for critical changes), and ignore these notifications when the app is already running, in favor of sockets.
Pull
Use NSURLSession to refresh your local DB with some regularity. This is very resilient to network failure.
Use a combination of approaches, since speed and robustness are mutually exclusive. Ultimately, your objective is to keep your local DB in sync with your server's DB, and fire internal messages as data changes. No small task, hence the Firebase answer.
The Most Simple way is to work with Firebase . Its No sql database and you will have instant update as you change anything .
This Video will guide you how speedy you can get update without any loop for refreshing data in application .
Ask me any help you need regarding Firebase .
You can use silent push notifications to update your map with updated taxi locations.
I would suggest you take a look at CloudKit. There are several reasons.
If you decide to just build one app and somehow have driver
functionality that is different from users (maybe by having drivers
register and sign-in) then the app can post shared data to a public
online database accessible to all users. You could use information
in this scenario to post local notifications as the need arises.
As iOS updates you will not be dependent on third party libraries
If you decide to create a driver app and a separate user app,
CloudKit will allow you to share data across these apps.
Apple deals with the security and availability.
Overall the process is very easy to implement.
You can combine the local notifications with the public database to
schedule reminders, alert users etc.
CloudKit when done correctly will be essentially free. Just transfer
CKAssets rather than raw data and your transfer/storage limits
become negligible.
You can also access your CloudKit databases from external web
services/websites if you want to extend the data further.
You can use CloudKit subscriptions to sync up user information
automatically
NB - As pointed out in comments this is new technology. It is in the
second generation and I prefer it because if one uses it creatively
then you can simulate the external push notification behavior together
with background support. CloudKit removes the need for a third party web server from which to push the external notifications (as the real notifications take place by writing to the shared database).
Check out my detailed answer on SO for sharing the data between apps with CloudKit. Here is a link to some CloudKit videos that further describe how CloudKit works. Apple has lots of documentation and sample projects available. You can review the developer website for more info on CloudKit.
CloudKit Quick Start

Daily check in Trigger.io mobile application

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.

real time messaging for multi player game on ios

Building a multi player iOS game where players compete one against the other. Nature of the game is synchronous. Basically, players either invite each other through facebook, email, etc and then start playing.
We debate what is the best strategy for facilitating the real time communication between players (sending events, etc). Coming from web development, we used comet and long polling which worked great. However, it's not clear what's the best way to achieve that on iOS.
Seems like APN (Apple Push Notifications) is not suitable in our case for two reasons: the delay can be pretty significant, up to few seconds, as far as we understand. Also, using APN requires the user to authorize notifications. If the user doesn't authorize this then it won't be possible to play the game.
Also, we understand Apple's Game Kit (Game Center) can be of value in our case however it's not clear how it interacts with invites through facebook etc. Also, not clear if we need to get into bed with Apple's Game Center and how it'll affect the user experience.
Any guidance on this matter as well as other options that you might think of would be greatly appreciated.
Thanks for your help.
Before you read the rest, a disclaimer: I work for Realtime.co but I do believe I can help here so I'm not trying to "pitch a sale".
If you need to have real time updates, you can check out Realtime (www.realtime.co). It's basically a set of tools for developers to use real time technologies on their projects. It uses websockets but does fallback to whatever the user's browser supports (such as long polling, for example) if you are using a browser (which is not your case, but it's always good to know).
Behind Realtime you have a one-to-one/one-to-many/many-to-many messaging system that will transport your messages to and from your users.
There's a iOS API too which you can use in your project. You can download it here: http://www.xrtml.org/downloads_62.html#ios and check the documentation here: http://docs.xrtml.org/getting_started/hello_message.html#ios.
There's also a plus which is the fact that the Realtime framework is actually cross-platform. This means that you can even have your iOS players to communicate with players using Android, Windows Phone, HTML5, Flash, etc. if you decide on expanding your game to other platforms.
I hope that helps!
I'll just provide some insights on the question.
APN should never be used for synchro communication as for iOS at least, you'll never have both way communication (basically the Apple APN servers are pushing an information to the device).
You should probably play with C sockets in order to open a tunnel (depends if your game is real time or not).
Using the Apple Framework GameKit is great! But might take some time to understand all the functionnalities.
Check out Gree
https://developer.gree.net/en/
Parse:
https://www.parse.com/
Sparrow:
http://gamua.com/sparrow/
There are a few things that your talking about, there is the joining/starting of a game, and then the communication between the players. They are not necessarily related.
You can use game-center and at the same time another framework for facebook, they are not mutually exclusive (but it would be more work.)

Resources