I have a page that displays all of the user's notifications. I want to highlight notifications that has not yet been read by the user.
However, when I use
$notifications = tap(auth()->user()->notifications)->markAsRead();
It automatically marks all the notifications as read and I am unable to tell the blade file which notifications are those that have already been read and which notifications are those that the user has not yet seen since he/she last visited the notifications page. Any help would be appreciated. Thanks!
You should just use unreadNotifications instead of notifications, therefore you'll mark them as read but you'll know that everyone of them was unread.
Related
I'm maintaining a group on Telegram. There is one user who keeps joining and leaving the group, I'm not even sure this is an account or what it is. I can't even send any personal messages. I'm using below-mentioned code to see the new chat participant data.
if ($message['new_chat_participant']) {
}
Here is the link of a screenshot when I try to Personal Message this person:
Like the client clearly says it's a deleted account... you can't send messages to it, because it basically doesn't exist (anymore). also they shouldn't join groups...
your question is here clearly out of place and we can't help you here, you should ask the Telegram Support (Telegram Settings > Ask a Question).
I'm creating an app which will allow all users to initiate conversation with page owner using Chat-to-SMS service.
Problem is that I'm not sure how to track conversations since there would be one conversation chain from SMS Provider <-> page owner. When owner clicks reply, it needs to know which session user it needs to send the message to.
Basically, I need to do opposite what is being explained here: https://www.twilio.com/docs/quickstart/php/sms/tracking-conversations
How should I accomplish this? I can't quite wrap my head around this.
Twilio developer evangelist here.
If you are sending all the chat messages to just one SMS number then there is no easy way to tie replies back to the original message. (As a quick experiment, if you open an SMS conversation in your own phone and try to reply to any message that wasn't the latest one, you'll see it's not possible.)
There are workarounds though.
You could, when forwarding the message, generate an ID for it. Then get your page owner to include that ID when responding to that message, that way you can route the message back to the original sender and strip out the ID.
Alternatively, when replying you could always respond to the last message that came in. This relies on there not being much traffic, allowing the page owner to respond before the next message arrives. This is error prone though.
Another alternative is purchasing a new number for each new conversation. You could expire the number after a predetermined amount of time. This is made much easier with Twilio Proxy, which was announced recently and is currently in preview.
Let me know if that helps at all.
i have a problem.
i have an android application ( based on Corona).
i am sending GCM notifications to my users when their out of the game.
the major problem is that the number of notifications will be very much and they annoy user.
so what i want is an ability to squeeze notifications to single one with multiple records that each record shows a single notification of my application , instead of have many notifications.
i read the Google GCM references and i found the "tag" and "collapse_key" options but they replace previous notification by the new one but i want that new notifs append at the last notif box instead of replacing it or creating a new notif instance.
thanks for your help
http://developer.android.com/training/notify-user/managing.html
I can't just submit a link, so here's also a quote for you
When you need to issue a notification multiple times for the same type of event, you should avoid making a completely new notification. Instead, you should consider updating a previous notification, either by changing some of its values or by adding to it, or both.
The following section describes how to update notifications and also
how to remove them.
I am making a website that will have a notification system that is like Facebook.
Each notification would redirect the user to a page, and on that page, I would mark any unread notification as 'read' as follows:
UPDATE notification SET status AS 'READ' WHERE ...
It is working well but the problem is every time when a user go to a page, even if there is no unread notification for the user, the query would still run. Though it does not make any difference to the end users, I wonder if it will create any performance issues.
I am thinking if I should update the database based on the click event on the notification dropdown. I want to listen to others about it first before implementing it. I want to know what's the normal practice when dealing with the notification system. Thanks!
I am finding it very difficult to find any information on how to retrieve the count of all currently unread notifications of the current session user. Ideally i would just like to return a number via php to html of all unread notifications. What i would like to do is pool for notifications every minite or so and if there is a new one i would like to be alerted and the status updated. I have tried this via the array from getNotifications but no luck. Is counting the current unread notifications even possible ?????. Basically i am asking how current smartphones are getting the count and alerting users to when there is a new notification etc.
Any help is greatly appreciated
Thanks
Did you check that : http://developers.facebook.com/docs/reference/fql/notification/ ?
I guess you can check every minute the unread notification of a user, record them in the database, and if a new one appear (ie wasn't present in the previous request), you update the status of the user