how to kick someone from videocall agora with flutter - 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.

Related

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

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

Swift 3 - having a user send a message to other users in a certain radius

I am learning swift at the moment and was wondering whether it was possible to have a user send a message to all other users in a certain radius. Where would i start?
Anything is appreciated.
You will need more than swift.
The most simple solution (not the best for performance reason) is to create your REST server o PHP server. Your app will be upload the position of the user to the server and send to the server the message.
The server will send the message to all the user in a certain radius (or it can save the message in a database or buffer and the app will ask sometimes if there are new messages for the current user).
You can also you Firebase like server or something similar.

User status message for iOS chat app

I am developing an iPhone chat application using robbiehanson/XMPPFramework and I am using OpenFire on the server side. I want to implement the user status feature on my app like the whatsapp status concept.
How can I achieve this, is there any default support on the openfire server for storing the user status messages ?
Thanks in advance
I am not sure what you call 'user status'. You can add information about the presence of the user in presence packets. This is purely transient information and is generally not stored in XMPP server.
You can also decide to publish status information in a more persistent way using Personal Eventing Protocol (PEP). The last status is generally stored by server to be resend / retrieved at a later time.
Reference: http://xmpp.org/extensions/xep-0163.html

"Ask for gift" Facebook request without server

I want to implement "ask for help" feature in my game (Facebook Unity SDK). If user A asks user B for help, and user B accepts, user A will get a gift.
My game is a single player experience right now so we have not created a server. Is there anyway to know if user B has accepted the request when User A logs in again next?
The solution here involves storing information in a database:
send Facebook request and get a gift FB API
Not really, you must delete your request on accepting, so request can only be in pending state.
You can remember ID when you send request to a player, and check what pending requests exist, and if you don't find your ID there, you know request was either accepted or rejected, but that probably doesn't help.
You will need to store request data somewhere. You can use service like parse.com, where you can just push data from client without having to do much work server-side. Parse is free until your game gets big and after that 200$ should not be too much.

How to check if a person in your iPhone contact list has an app installed?

I want to allow people to privately share data with each other using their contacts list to select people to share with. I'm planning on using Push Notifications to notify others that they have been shared with, but how can I handle those that do not have the app installed?
The cases are that I have their phone # and/or email. I can simply send them a message saying "X wants to share Y with you", but how can I determine if I need to send a Push Notification or an email/text?
If you're looking for API then you're out of luck. You can always collect this personal data server-side with agreement of your users. There you can also manage groups and other community relations.
Check here:
https://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/ApplePushService/ApplePushService.html
The crux of it though will be that you will need to store a token when the device is registered anyway to be able to send notifications to them, so you can use that.
And using The Feedback Service alluded to in the documentation, you can remove the token, should it fail too often.
But, as rokjarc said, if you're expecting a third-party API to exist, you're pretty much out of luck. Apple ahs done most of the work for you already anyway.
When the app registeres for push notifications you need to pass additional data to your server. The user could input their own email/phone which will be sent to the server so that users can find each other. The email/phone can be stored alongside with the push token. When someone wants to share something, you would search the corresponding push token in the database and send the notification through APNS. Note there can be multiple push tokens for one email or phone i.e. when a user has multiple devices.
The users of your app should be aware of the data which is stored on your server and should have the option to delete it. Also use the APNS feedback service to detect and remove invalid push tokens.