How can I use Onesignal to only inform those users who have received a chat message?

Hello experts

I developed a chat app with Kodular.
Now I would like to use OneSignal to inform the user about a new chat message.

I have set up Onesignal and can send messages. that’s working!
But all users are always informed.

How can I use Onesignal to only inform those users who have received a chat message?
How does the Send.Tag method work? Can i use this for this? How do I assign users to this tag?

1 Like

Every user have unique user ID for onesignal notification.
You can try sending notification to that ID which receives the message.

However, the block image you posted can be used to group user by tag.
For example: if you have pro and free version users in your app and you want to send notification to only free user or pro user then this block may be useful.
You can make a segment for your user by using that block.

On your app if only one user receives the notification then send it by user’s ID and if a group needs to be notified then do make segment for each group by using the block posted.

You can use Onesignal Send extension for more features.


1 Like

Many thanks for your answer.

With the .tag method I managed to assign tags to every user (ID) in Onesignal.

How can I now send a message to users who only contain the tag “chat; 1; 4”.

I can only send the function to segments - but these are the same for all and don’t include the TAGS?

1 Like


I have to answer this evening more detailed.

1 Like

Thank you for your reply.
I know the TAGS.
I want (as with Whatsapp) that every user who is in the chat group receives a message when someone in the chat has sent a new message.

I can send a message to every single user -> PlayerID

I was hoping that it would be easier with Segment and / or TAG.

1 Like

I have now tried the PlayerID and it works! :slight_smile:

I save their OneSignal ID for each user.
When I then click on a chat, I check which users belong to this chat and save the OneSignal ID in a list. Then when I send a chat, I also send the message to the PlayerID.
But my problem now is:
I also get the message when I’m in chat.

I was hoping, with the “Notification Received” method, I can leave the message empty?

What can I do so that the Onesignal message only appears to the recipient when the recipient is not in the chat or the app is closed?

1 Like

Unfortunately I have not yet understood

  1. what are the TAGs useful for?

  2. how can I notify a specific user (PlayerID) in a specific segment?

  3. How can I turn off / prevent the in-APP notification. (don’t want to read the message twice when I’m chatting - just want to be notified when the app is closed)

my head is smoking :hot_face:

@Rene1898 can you help me? gerne auch in Deutsch per pm…

It’s not that easy, I’m not really in it either.

  1. The tags are used to mark users. In the OneSignal dashboard, you can view the tags for the users in the table and create segments accordingly.

  2. A PlayerID already exists, this PlayerID must then be included in the segment via a tag. The segment must then contain “has this tag: xyz” as a condition.

  3. Sending In-App Messages

Thank you Rene,

the discussion here helped me not to give up looking for a solution.
The push notification extension from Kodular cannot be used for my project.

I am sending with the help of the extension

One for each PlayerID of the chat participants
Push notification.

With the help of another extension, I prevent the notification from being displayed when you are currently using the app.

look here:

1 Like

you can disable the push notification for the user who is in the chat, doing this that user will not receive any notification

Yes, but I haven’t figured out how to tell whether someone is still actively using the app or not.

Not everyone logs out. You don’t log out of WhatsApp either?
As a sender, how am I supposed to recognize whether someone is still using the application or not?

1 Like

There is a block called “On App Stop” in block section, when you click screen name. Maybe this could help you. You can disable push notification on screen initialize and enable it using this block. Or you can try some other method.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.