Delete event on socket.io - socket.io

I'm wondering when I deleted a message or press a button for make an action, how can I notify to the others clients that event happened and delete the message or that button from them.
I know it is possible with socket.io, actually I'm using Node.js, Express, Socketio and React, but I dont know how to make this logic. I just know how to send a message to everyone and how to receive and emit any event.
I really appreciate any hint or basic code.
Thanks in advance.

Related

Outlook add-in event-based with OfficeRuntime.auth

I'm new to this topic, but I've taken some time to understand some things.
I would like to know how I get a token from an event, I read that OfficeRuntime.auth.getAccessToken() can be used but it doesn't work for me.
Thanks for your help.
I hope get the token when the event onMessageComposeHandler is called.
I am on outlook windows.

How to get a bot to send a message as the program is shutting down

I'm using Heroku to keep my discord bot running, and everything works fine, there's just one thing I want to add, but I've no idea how I can do it. I'd like for whenever the program shuts down, or stops running, for the bot to send a message. Can anyone give me an example of how this is possible? Thx in advance for any help.
Discord.py has a on_disconnect event which, unfortunately, won't let you send a message (as the bot already disconnected), but you can print something (e.g. the time the bot disconnected) when the bot disconnects. Unfortunately, it's impossible to send a message once the bot has disconnected.

How to send a message when the user is leaving the page using SignalR?

I'm working on a chat room program using ASP.NET, I have made a 'user has joined the chatroom' message, but how would I send a message when the user leaves the page? I tried looking through the network logs, but I can't see any extra messages getting sent through the WebSocket.
This will be tough and inaccurate because there is really no guarantee that you will get notified that the user has disconnected. But there is an onDisconnect event that you can listen for, but in all honesty, I would use a disconnect button and use that to do what you need to do, it would be more consistent, as the disconnect is not reliable (at least the last time I used SignalR, which was like version 1.x)
Nevermind, I've found out about window.onbeforeunload using JavaScript. Though it's not 100% consistent, it's more consistent than I expected.

Is there a way to suppress incoming notifications in Xamarin (iOS)

At work I have to modify an existing Application to differentiate incoming push notifications by the language of the news.
In Android I found a way to not send the push notification. So I could easily check for the language and only send the right one.
In iOS it seems a little different. (I'm not the Author of the existing code, so maybe I have overlooked something.)
But I can't find any function where I could intercept the incoming message.
I tried functions like UNUserNotificationCenter.Current.RemoveAllPendingNotificationRequests();
and
UIApplication.SharedApplication.CancelAllLocalNotifications();
But without any success... maybe I put them into the wrong place.
Thanks for hints and help
If I understand your question, the answer is it depends.
If you cannot change the push notification on the server, then no. The system will display it as soon as it arrives as it is formatted as the notification that needs to be displayed.
However, you can change the format of notification payload so that it doesn't display but it is rather processed by the application. Then you can process it in the app similar to what you do on Android.
I don't want to change the notification. I just don't want to show
it...
I don't think it is possible to choose which notification to show when your app is not running.
If your app isn't running then the notification is processed by iOS and your app doesn't get called.
You can have a look at answer in this thread.
Refer: https://learn.microsoft.com/en-us/xamarin/ios/platform/user-notifications/

Problem while Making a Call and SMS in same Process on Windows Phone 7

I am developing a application for Windows Phone 7 in which on a button click I need to first send some text messages and then make a call. But as both process are user dependent so I am not getting how should I make it such a way that unless user first finishes the sending messages my app should not initiate call. Because unless I do so it will give thread abort exception.
Thanks;
nil
With the current SDK there is no way to know if the SMS was actually sent. It could also have been changed by the user before being sent!
Lots of people have asked for this functionality (or similar but for other tasks). Let's hope it comes in a future update.
I believe you can't do it in parallel, because WP7 isn't really multitask.
Do you really need to do it in parallel?
Search for the events deactivated and activated. They are in App.cs.
After you make a call, and back to the program, the activated event will detect it, so you can add code there to send SMS.
Done in reverse way. First make a call and then when user comes back after tombstoning send an Email...but flag manipulation need to be saved in isolated storage.

Resources