Agora. How can I listen for an user joining or leaving a Video Call Agora - flutter

I am making a Flutter application using Agora.
The app has the ability to make a video call through Agora. To connect to Video Call, rtcToken, appId and ChannelName are used from the console of Agora from the server (Generate comes from the server.). For now, 2 users can make a video call with each other through these 3 fields.
Question: is it possible to know the users who joined and left videoCall without sending a request to our server from mobile?
If this is not possible, then how can I tell the server from the mobile that users have joined or left?
Of course, it can be done via Rest api or socket. but the request to the Rest API may not go through (For example, the phone may be turned off). I wonder if the socket will hurt the server. It would be nice to have other solutions.
Thanks a lot for the answer
How did I solve the problem?
Agora itself could not solve the problem. Had to use web-socket. To know if the user is in the channel:
client.sessionController.value.isInChannel
This is what I used in web-socket.

check this agora documentation.
it shows channel methods for joining and leaving channel by the user.
https://api-ref.agora.io/en/video-sdk/flutter/6.x/API/rtc_api_overview_ng.html

Related

how to kick someone from videocall agora with flutter

I'm creating an app for video or voice call with flutter for Android / iOS. And I want to enable someone to kick another from a call. Is there anyone who knows how? any idea?
There are lots of functions in RtcEngine() and I don't know which one would remove another users.
There's a couple of ways that I can think of to do this:
RTM (new name: Signalling)
Using RTM, you could send a message to the user you want to kick, which reacts to logic on the device that then restricts it from rejoining the room. For example, send a plain text message such as "kicked_from:channel-id-here", or a json string if you want to add more complex messages that are decoded by your application:
"{\"action\":\"kick\",\"channel-id\",\"reason\":\"abuse\"}"
This is then saved into a map for example, which then is checked whenever they try to rejoin a channel.
RTM can be found here.
Via Token Server
When kicking someone from your room, you could send a message to your token server with a specific user's ID.
The token server could then revoke that token from joining the channel, resulting in them then leaving the channel. You'd have to then add some logic to either the token server or the client to prevent that user to request a new token and rejoining.

In which format I should send http POST to Bot Builder?

I was trying to built a bot which interacts with multiple users.
The Microsoft Bot Builder seems nice to me.
I followed their examples and tried them out.
Bot Builder Restify and so on
There are few things which are not clear to me.
How can I post a message to bot rest endpoint?
The emulator seems to have been taking care of such details. But in a real application, in which format i should sent a message?
How does the bot interacts with multiple users? In the emulator, there is only one user, what happens if there are several persons talk to the bot at the same time in a real application?
I think "chatconnector" somehow doing the job, but I am not sure.
I hope someone could point out examples or give answers below to clarify these to me.
Thanks in advance!
1) Messages are sent using industry-standard REST and JSON over HTTPS. Although you can call the bot's endpoint directly, this would bypass channels and security. In the Microsoft Bot Framework architecture, clients communicate with a channel connector and the channel connector calls the bot. When the bot responds, it sends a message to the channel connector and the connector calls the client. The channel connectors transform messages from the channel's specific schema to the Bot Framework's generic activity schema and back. They also verify that callers are authorized using JWT tokens.
This documentation on Authentication might help clear things up some: https://learn.microsoft.com/en-us/bot-framework/rest-api/bot-framework-rest-connector-authentication
2) Group conversations are handled differently, depending on the channel. This sample demonstrates some of the group conversation features in the Bot Builder Node sdk: https://github.com/Microsoft/BotBuilder-Samples/tree/master/Node/core-GetConversationMembers

GAE channel API chat

Currently im trouble shooting some code that I wrote to create a chat room. I will include the code if necessary but for now I just wanted to hear some possibilities for the problem im having. So basically I have client1 that is listening to a channel and then when clien2 sends a message to the server the message is then sent from the server to all available users. What is happening is that client 2 will send the message and it will be displayed on his browser but client 1 will not receive the message until he refreshes the page or types in a message of his own. So I would think that user presence is being detected fine since the message eventually gets sent to all available users but im not sure? Thoughts?
The Google App Engine blog has a nice case study that talks about how to do this.
They store a list of channel ID's in memcache and send update messages to each of them. They mention that race conditions make memcache not ideal, but it worked well enough for their demo.

Retrieve and save all Apple Push Notification Device Tokens in our server for APNS?

Am trying to integrate Apple Push Notification in my app. I have studied the Apple Document and other tutorials for my understanding. But, still i have a doubt to create a server and store all Apple Push Notification devicetokens in the database. Am not going to work on Server side but, i need to explain the approach to my client. I need to understand to create a APNS server provider and save all the apple push notification device tokens and retrieve all devicetoken and retrieve a single devicetoken to send notificaions. Can you please suggest me any sample code to save all apn devicetokens and retrieve from the server? I suggest my client to create a server in C#.net platform is this correct? Thanks in advance.
Essentially, you just need to decide on a way for your app to let your servers know the device tokens. So, there are many ways to achieve this.
If your server side already involves a website, the easiest way would be to use HTTPS to do a POST request from your app. Then, the server-side code can be written as if it is handling form request from browsers. I can't really give you sample code since I don't know any C#, but this should be familiar to any web developer.

Google Channel API - How to test it locally?

I want to test my application which share messages between two users using google channel api, but I manage to see messages going only from one side to the other.
is it because I'm opening 2 channels on the same machine? I am running the application on different browsers (Chrome and IE) and each one logged in with a different user name? shouldn't that be enough?
Any suggestion on how to test my application on a single PC, or must I connect another PC for such application?
Thanks
Muky.
You surely can test Google Channel API on a single machine. (I've done it, it works). Note that, when I run it on my local machine, I see the browser makes continuous requests (polling) although, when I upload it to Google App Engine, I only see push notifications. (You can check out the requests using Firebug in Firefox - in the NET tab). As far as I understand, Channel API is simulated in local mode using polling whereas, when uploaded to Google App Engine, they make use of Comet (not polling, rather long-lived requests).
I don't think your case was a browser issue. Each logged in user should open one channel. Then when you want to send a message to every users, you should send a message to each id that's logged in.