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

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...

Related

ArrowDB - how to get event listener of a chat sent to group?

I'm developing a real time chat app using Titanium Appcelerator. I have everything working with ArrowDB and one user can send another user a message through a group.
https://docs.appcelerator.com/arrowdb/latest/#!/api/Chats
However there doesn't seem to be a method or listener to identify when a new message has been sent to the group.
What I'd like to see is when the other user is typing, and as soon as the message is sent it bubbles up on the recipients chat window. Exactly like how iMessage works.
The only way I can pull new messages from the group to the local users device is to have a refresh button or to use a setInterval with a function call to refresh the messages.
obviously this is not a great way to handle the situation as with a few hundred users every month this would make for hundreds of thousands of api calls and probably not good for device performance.
Does anyone have any ideas how to get real time chat working? Is there a method or event listener I am missing that isn't document?
Push notifications only work while the app is in the background, so this is not an option unfortunately.

Open specific conversation on whatsapp from ionic 4

I have tried to call whatsapp from InAppBrowser plugin by passing url "https://api.whatsapp.com/send?phone=+91123456890&text=test".
I have also added config.xml changes as suggested
(access launch-external="yes" origin="whatsapp:*" /)
It opens the browser (when I run this on device) with send button on it to send the message to Whatsapp.
But I am unable to tap the Send button. It is not redirecting me to whatsapp application with given number.
Please can you show me some sample code or the way to achieve this.
Thanks,
i also face this problem. following code fixed my problem
window.open('whatsapp://send?phone=923130601266', '_system');
You should try to call below api in InAppBrowser.
The direct conversation will open with the number you set below the link.
Don't forget to add country code before number.
https://wa.me/your-mobile-number

Twilio Disconnection event not firing on IOS

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.

How do LINE and Viber display incoming call screens on WP?

I couldn't manage to find that piece of API which allows apps to alert the user with a custom screen, like what can be seen on an incoming (network) phone call over services like LINE or Viber, which even works ubder the lock screen.
Do they need similar registrations as push notifications?
What those apps are using is probably the VoIP APIs that are available. There is a full guide on how to implement such functionality here (including that incoming call screen): http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj206983(v=vs.105).aspx
There is also a downloadable sample app available here: http://code.msdn.microsoft.com/wpapps/ChatterBox-VoIP-sample-app-b1e63b8b

Request ID is not available when App Launches after clicking Facebook notification

A Facebook app is setup with iOS native app enabled with bundle id and App Store Id of another app.
Following are possible in the current scenario.
1.Sending an app request to a friend,
2.The request badge appears in the friend's Facebook,
3. And clicking on the request launches my app.
This was the link i referred to implement this.
https://developers.facebook.com/docs/howtos/send-requests-using-ios-sdk/#protip3
I am supposed to get a NSURL from these functions
– application:openURL:sourceApplication:annotation:
OR
– application:handleOpenURL:
and the expected format is as follows.
fb[APP_ID]://authorize#expires_in=[ACCESS_TOKEN_EXPIRATION]
&access_token=[USER_ACCESS_TOKEN]
&target_url=https://apps.facebook.com/[APP_NAME_SPACE]/?request_ids=
[COMMA_SEPARATED_REQUESTIDs]&ref=notif&app_request_type=user_to_user
Here the request_ids contains The id of app request send, and which can be used to get the data attached to the App Request.
Now my issue is that, I am not getting the NSURL in expected form, instead I get the following format. So I am unable to find or use the request_ids.
fb[APP_ID]://authorize#expires_in=[ACCESS_TOKEN_EXPIRATION]
&access_token=[USER_ACCESS_TOKEN]
&target_url=https://apps.facebook.com/application.php?id=442634372448098