We are experimenting with the Twilio video call SDK for iOS and we are able to establish a call between two users but now we would like to send events from one user to another. For example, one user would tap a button on his device and the event would be sent to the other device to display a sound or animation. Basically we are looking for a way to establish a data channel between both callers that we can use to send events, much like a websocket.
Thanks for your input! Regards,
Enrique
Twilio recently announced a State Syncronisation API which you can use to solve your problem , have a look : https://www.twilio.com/sync
For your case, you could setup up a "Map" item ( a map of event to device identity ) on Twilio sync which could be used by a device to push their events to Cloud to which any subscribed devices can get the info pushed to .
Related
I use Twilio API to create video between two users. It works good if one of the users clicks on "Disconnect". But when user terminates his app, the picture "freezes". How can I disconnect user if he terminates his app (turns off internet connection, ...) ?
Twilio developer evangelist here.
I would implement the TVIRoomDelegate methods didDisconnectWithError and participantDidDisconnect so that you can clear up video connections when a disconnection is detected.
I am trying to record incoming and outgoing calls in iPhone... Is it possible to record calls in iOS ?
Please let me know. Thanks in advance.
Yes you can.
With the use of AudioToolbox and libkern/OSAtomic.h
First of all you need to trigger when an incoming call coming.
Fire an event when ever there is Incoming and Outgoing call in iphone?
Recording the call this is what you exactly looking for.
SO post
Note:
Apple allows these hooks only when your application in foreground.
Conditions that allow your app runs in background:
For tasks that require more execution time to implement, you must request specific permissions to run them in the background without their being suspended.
In iOS, only specific app types are allowed to run in the background:
Apps that record audio content while in the background
Apps that keep users informed of their location at all times, such as a navigation app
Apps that support Voice over Internet Protocol (VoIP)
Apps that need to download and process new content regularly
Apps that receive regular updates from external accessories
Reference link
You can go through this link below:
Record the conversation of phone - ios
There is no public API for recording the calls made (or received) by the built-in Phone app.
You will have to implement your own phone calling mechanism. You'll probably want to use VoIP. (That is what Google Voice uses, for example.) You'll need to run your own server on the Internet, or contract with an existing VoIP service. You'll want to use in-app purchase to let the user buy minutes, because it costs money to run your own server or use a third-party service.
Im developing an iOS app that has a feature of Push notifications. Its a sports app where a user can add players to their favorites list. Each player has 3 kinds of events.
Like,
score a Goal
got a red car from referee
got a yellow car from referee
Now in this scenario,
User X has configured player A for all 3 types
User Y has configured player A for first 2 types
User Z has configured player B for last 2 types
Now Server receives an update for Player A scores a Goal(1st type).
What exactly should be the payload?
I have tried the following
{"aps": {"badge": "+1", "alert": "Player A scored a Goal 10K", "participantID":["A"],"tags":["score a Goal"]}, "aliases": ["sportEvent2013"]}
At present im broadcasting the update, that is every device configured with APNS receive the push and only the one which matches the tag and participantID is displayed.
It does work, but i think this is not appropriate like every device receive the updates which can be in thousands, (im not using device token) because i can not tell who has configured for which events?
Please help me with the right approach.
Thanks
I can give more details if you give more details about your setup (all client, server component, etc). However the general idea should be to use the 'Tags' feature by urban airship (you can use alias too.. but that's not as flexible):
UAirship Tags
The general concept is to 'subscribe' a user and their device token to a tag such as "PlayerAGoalScored". And then when that update comes through you can just tell urban airship to send a push to everyone subscribed to the tag 'PlayerAGoalscored"
You could set it up so that when a user configures a player to receive a particular type of notification, the app updates your database. Then, when the server receives an update for a player, query your database for those who have that flag set and send the notification only to them.
im stuck in a situation
SITUATION : I have a situation wherein i answer some questions and get points according to the answered questions. if my points become say 10 i win some gift using a QRCode. (there is a qr code that is generated to the user, and when the qrcode is scanned from someother device which has a scanner app or any other scanner, it gives a link to that online store. This link can be opened from any browser.) The gift is accessed from some online store by scanning the QRCode which gives a link to that online store with some unique id and when the gift is accessed/taken the server is notified that the gift is accessed/taken from that online gift store and the QRCode status is updated to invalid on the server database. Now once the server gets the notification that the gift is being accessed/taken, the server should immediately notify my iphone app that the gift is received so that i can immediately show another congratulations image or something.
POSSIBLE SOLUTION : i thought of one possible solution wherein i check upon the qrcode access status change on the server every say 60 secs and display the image accordingly. I dont know how efficient/correct this way would be though.
ISSUE : but before i refuge to the above solution, i want to know, can this notification happen from the server without my app trying to call or fetch the update from the server? I mean, my app comes into the picture only after the server sends a notification in the form of a msg or some xml or something..
Any help would be deeply appreciated.
You can open a connection to your server using CFReadStream, add the stream to your runloop and set up a callback function. Whenever the server writes data to the open connection, your callback will fire and you can then read from the stream to get the data the server sent
More info here: https://developer.apple.com/library/mac/#documentation/Networking/Conceptual/CFNetwork/CFStreamTasks/CFStreamTasks.html
You could try to check Push Notifications. But it's impossible to determine on server side if notification was received on client side or not (if you won't implement it by yourself, but you'll probably wont cover all the possible situations, like when your app is not launched and notification came).
you can try to use XMPP protocol, which is most commonly used for chats/mails, where the changes in the server is notified to the clients.
Apple Push Notification Service is meant to solve these types of situations.
Hope it helps:
Apple Docs: http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/ApplePushService/ApplePushService.html#//apple_ref/doc/uid/TP40008194-CH100-SW9
There is a nice tutorial: http://www.raywenderlich.com/3443/apple-push-notification-services-tutorial-part-12
Video tutorial: http://www.youtube.com/watch?v=cKV5csbueHA&feature=relmfu
I am trying to make a chat on my website looking like google talk. I
want to manage the disconnect event. A user can disconnect on several
way :
By clicking the disconnect button (easy to push the event to his
friends)
By close his windows (I can send the event to windows close
javascript event but if the user has many windows open on my website,
i don't want to disconnect him.)
So, how can i detect when my connection on a channel is closed? Each
user has his own channel build with his id.
Thank you for help.
You can check out the meta events, /meta/unsubscribe and /meta/disconnect.
More info here: Faye Monitoring