Twilio Disconnection event not firing on IOS - objective-c

I'm creating mobile app based on Twilio and Cordova (https://github.com/jefflinwood/twilio_client_phonegap), it works well, but I seem to have a problem with connection events.
The problem is ConnectionDelegate callback connectionDidDisconnect doesnt seem to be fired in some situations. For example:
User 1 is calling from browser
User 2 anwsers on iPhone/Android/Browser
They talk
User 1 hangs up in browser
User 2 will get disconnection event on every other device than iPhone. On iPhone callback connectionDidDisconnect is not called at all.
Another situation:
User 1 is calling from browser
User 2 anwsers on iPhone/Android/Browser
They talk
User 2 hangs up
User 2 will get disconnection event on every other device than iPhone. On iPhone callback connectionDidDisconnect is not called at all.
Could you tell me where I'm making mistake?
UPDATE:
When user anwsered incoming call on iPhone and caller hangs up I get [ERROR TCMetricsPublisher] Failed to push call stats, status code: 403 error.
When user anwsered incoming call on iPhone and he hangs up, nothing happends.

From others experience using the same plugin, it seems you can solve the issue by using the status callback that Twilio handles when the call ends. Modify the call from parameters and set the status to "completed" for this call.
Doing this should allow the call to disconnect properly on iOS.
Please let me know if this helps at all.

Related

Expo/React Native : A Continuous Alarm or Sound Notification (like receiving a call ) triggered by remote server

I am using Expo to build an app that will pop up a notification with custom sound and vibration when triggered remotely. The alarm/vibration would play until its dismissed by the user or it times out (say after 1-2 mins) .
Example use case would be when a partner needs my immediate help with baby, they can press a button the app and that would send signal to backend server which would then trigger the notification with alarm on the app at the other end. When the notification is dismissed, an acknowledgement message is sent with Yes or No type message. If the notification times out, then another message is sent like "no response".
Key point to note is that when the app is fully closed, the notification should still be able to pop up.
From my limited understanding , expo notification or push notifications in general cannot achieve this as they don't allow us to create notifications that directly open the app. Even a solution which works like phone or video calling apps (which open when someone calls you ) could work.
Any help would be much appreciated.
Many Thanks!
I looked up expo push notifications but they are limited in terms of customising the notifications.

How to continue a network request when user moves app to the background during the request?

I am building a messaging app in react-native.
I have a problem where if the user is sending a message, then puts the app into the background before my redux (thunk) action containing all the network logic finishes, the message doesn't get created on the backend. However, I am still seeing the SUCCESS action come back from the action.
Does anyone know why this is happening? Thank you!

Quickblox--placing/receiving a call while chat page is loaded--- Cordova

we are building an application for chatting and audio/video calling using code for cordova.
In your (quickblox) video call sample, both users have to be in the video page to receive call from each other,
which means that if user1 leaves video page and user2 wants to call him so user 1 wont receive the call.
But in our app we need to allow user to receice call even if he is in chat page, so that we customize your sample to achieve this goal but when we add javascript files related to video call to those related to chat, the app stops loading chat history.
(i think that the problem is in "retrieveChatMessages(dialog, beforeDateSent)" function under "message.js" file )
How we can fix this issue?
Thank you
Regards
I think that the problem is in "retrieveChatMessages(dialog,beforeDateSent)" function under "message.js" file - in the logs sould be an error.
The video-chat sample just for show the possibilities of video and audio calls.
You can call to your opponent with extension like dialog_id, which user from or other params that your need (or look in session object, may be it has all parameters which you need). And opponent recieve your call in onCallListener with this extension object and session (https://quickblox.com/developers/Sample-webrtc-web#Make_a_call).
So the next logic:
user1 call to user2 - session.call(extension, function(error) {...})
user2 has incoming call to QB.webrtc.onCallListener = function(session, extension) {...}
and user2 show for himself popup about incoming call (for example), if he accept call then he open dialog (that he took from parameters), build UI for call and send accept to user1 session.accept(extension)(https://quickblox.com/developers/Sample-webrtc-web#Accept_a_call);
If I don't understand correctly, show errors from the console and we will continue...

get url event on app open in objective c (Mac OSX)

I'm writing a very lightweight app for OSX 10.6+ which will respond to a user clicking on a URL, pass that URL to another application via TCP and then exit.
So far it has registered fine to launch when a user clicks the custom url scheme. However the event seems to get lost if the app is not already running. So the users clicks the link, the app loads, but nothing happens. Once the app is running, if the user clicks the link then it grabs the event and processes it as normal.
What do I need to do to catch that initial event that causes the app to open in the first place?
Currently I'm creating the NSAppleEventManager in the applicationDidFinishLaunching method, and this works for all events created AFTER the initial load, just not for the one that actually opened the app itself.
Any advice would be brilliant!
Thanks!
You should be creating your AppleEvent handlers in -applicationWillFinishLaunching: instead.
The idea is to have your handlers ready to go before your application begins processing AppleEvents.

how to delay application quit time in iphone sdk?

I want to register my app for push notification when my application terminates so i think if i delay my app quitting time it could be possible.Does someone knows how to delay application quitting time? I think this method
[self performSelector:(SEL)aSelector onThread:(NSThread *)thr withObject:(id)arg waitUntilDone:(BOOL)wait];
will do my job but i don't know how to use this method if someone knows please tell.I need to send some data to a server along with registering for Push Notification when my app quits.
I can't imagine why you would want to do this. If it were even possible it would be extremely annoying for a user to tap the home button and the app to take x amount of time to shut down. This time 'x' being dependent on the server connection creates even more user headache.
Apple have the home button exit apps immediately for a reason.
If you want to register the Push Notifications like you suggest, do it while the app is running. If your worrying that they won't be properly set if the user exits prematurely... don't.
As users, we all know there are sometimes consequences of exiting a program without giving it time to save your settings.
For push notification it is better to register when the app first starts and then send the push token to your server in the background. However, if you have a good reason why you need to do the registration just as the app terminates, I believe you can do this if you are using iOS 4. iOS 4 has a new feature called "task finishing" that allows an app to stay running for a few minutes after the user closes it so that it may finish up any tasks it was in the middle of (such as saving data).