I'm writing a simple mini-chat with custom User model and authentication via omniauth. The chat uses web-socket faye-rails to send and display messages instantly without refreshing the page. The matter is that I'd like to add private messages - I mean, that I can choose an user and start our own dialog in a secondary chat window. I've looked for the solutions, but everything I found was about e-mailing - with inbox messages, trash cans and so on. So I wonder if there's any solution easy to implement.
The source code of my chat is here
Welcome to push technology and active web design!
When someone logs in, present them with a list of friended accounts and logged in state. For logged in friends, they can select a friend from the list and start a chat session in a new window. For logged out friends, they can send a message that's delivered the next time the recipient logs in.
You'll then have to create a friending mechanism that allows a user to request a connection to a prospective friend, be notified of pending connection requests, approve friend requests, and an unfriend feature. Hopefully that one won't be used too often.
I've worked with Faye & I like Faye but also take a quick look at the beta release of Rails 5. Action Cable will do the same thing and the framework support is better.
Related
I have a LogicApp that, in some cases, can decide to send a notification to a user via Teams (provided that the target user has installed the associated Teams App).
I was successful in doing so by using the approach presented here.
However, I got stucked when it comes to localize the message.
My first idea was to retrieve somehow the user language settings, but it seems that this info is not available through the Graph API.
Any other idea on how to implement this feature?
Objective: I want to send notifications to my customers in certain operations, such as when they loged in. To say in more detail, i wanna show the notification to employer that says {{x}} employe just loged in and clearly all the Authorisation codes are ready and works.
Current State: I opened another asp.net mvc web project(let say signal project) in my solutions and inside signal project i wrote my signalr codes that send notification to users according to their authorizations.(ClassName : Hub)
My client/signalr work flow
List item
user logs in, i check his/her authorizations.
To her/his authorizations i assign them in to groups
and send notifications to employers(which they have they own group)
At this state every thing is fine and works.
But i want to convert this signal project to a windows service.So i created one.
Problem: Windows Service is working but the notifications that should be send to certain groups won't go(in my case employers won t see any notifications).
Analyze:So i review my codes and debuged with log4net library and checked the windows event log
Tested/Debuged/Confirmed Steps
Groups Creating works
Loged in Customer assigning to groups works
Send notification to employers group WON'T work(code below)
Clients.Group("Employers", Context.ConnectionId).Send("Some Context");
So i created a method that sends notification to ALL loged in users and strangely it works
all my users including employers and employees are sees notifications.
In brief, using signalr inside asp.net mvc project, i can send notification to my users which in a specific group but while using windows service i can send notification to all my users but i can t send notification to my users which in a specific group.
I can share code if needed?
Any insights, thoughts, ideas are appreciated.
Revising -
In the method are you setting the hub context?
IHubContext hubContext = GlobalHost.ConnectionManager.GetHubContext<Hub>();
(do some stuff)
hubContext.Clients.Group("Employers").Send("Some Context");
If you are can you show some code?
I am implementing a chat application for iOS. Here is the scenario:
Two QBUUsers engaged in an active exchange of chat messages.
User1 goes offline for some reason (disconnects or app goes to background). Lets assume that the app called logout on the QBChat instance.
User2 sends a ChatMessage to User1 because he thinks User1 is still online.
I should send a Push Notification to User1 instead, but how do I detect that User1 is no longer available to receive a ChatMessage?
I saw that on StackOverflow someone recommended checking the "last_request_at" property on a QBUUser, but that seems heavy-handed since I have to query the server every time I send a ChatMessage. Also that will not tell me when they logged out of the QBChat instance.
My fallback plan is to track user login/logout on our own app server (not rely on QuickBlox server). Any elegant solution here using the QuickBlox SDK?
You have 2 ways what to do:
1) Use contact list http://quickblox.com/developers/SimpleSample-chat_users-ios#Contact_list
With contact list you can track online status of user for your contact list. Contact list is similar to common friends list like in Facebook.
2) send Push Notifications for every message. If user is offline - he will receive it. If user is online - just ignore this push.
I am developing an mobile app for iPhone. The app will primary used by people who are on holiday in a different country and will be offline most of the time, due to high costs for internet traffic.
However, the company for which I am developing the app wants to users to be able to use the "Facebook Share" functionality also when people are not connected to the internet.
It should work on a way that they click the SHARE link button in the app, but then get a message that they are offline and the link will get shared as soon as they are online again.
I am trying to figure out how to do this. Can I pass the link I want to share to the official FB App via fb:// protocol (or whatever) and the FB App handles the post/share as soon as it is online again?
Or do I have to do it on my own, put the links I want to share in a internal database and then post them to the wall when I am online again?
Or any other ways??
Any suggestions would be welcome, I would prefer a very quick solution and hope someone maybe has an idea how to do this. I was hoping I can pass the share-link to the official FB App and this one handles everything when it goes online again !?
Thanks for your ideas!
Your approach should be to make your link-sharing code automatically cache requests until they are sent. The app then doesn't need to concern itself with the details - it can just post the link and get a 'failed', 'success', or 'postponed' response from your API and notify the user accordingly.
Your link-sharing code can then internally check if it can currently post to FB and if not (either because the user is currently offline or perhaps the Facebook token is expired) it will store it for later. This class will then re-check periodically (for example when the app comes to the foreground or when the class is initialised the next time the app starts) for connectivity and then it will check if the token is still valid and perform FB login if required. Once it has a valid token it can then iterate through the pending requests and act upon them.
If you really want to make it nice and clean, you can separate out the code that accepts incoming requests to do something, checks if it can be performed now, does it or stores it for later, and periodically checks any requests in the pending queue. This class will not have any idea what the requests do or how they are performed, it will work with another class that implements a protocol to do the actual work and knows about facebook, etc. There may even be an existing design pattern for such a setup, but I don't know what it's called if there is.
Update: I did some research and found this is very similar to the "Fire-and-Forget Pattern".
Let me start by saying facebook's developer documentation sucks. Bad.
I'm using the facebooker plugin in rails to let users sign up through facebook connect. Now when certain things occur I want to send notifications to certain users through facebook. I heard some say that notifications must go from one user to another, but I've seen evidence otherwise. I signed up at the site http://www.meetingwave.com/ through fb connect, and now they send me (annoyingly) daily notifications of new things on their site. Also, using the comments widget on my own site www.tmatthew.net, when an anonymous user leaves a comment I get notified of that as well.
So uh, how do you do that? I've been googling all week long and can't seem to find anything. It seems like I should be able to send a notification from my app to one of it's users.
The api call you are looking for is called Notifications.send. The only thing is that they will be disabling it very soon so there is probably no point in implementing it into your application.