'Can i send push notification to specific application with rest api?

I can send specific or topic user to push notification with rest api.

But i need to send push notifcation to all of the user in a specific application using rest api. Like i have dev applicaiton also production application. So if i need to send notification to all dev user. how can i send it by rest api?

Can anyone give me the payload?

i have single user one.

{ 
                "to": "cyZTpu4xRVifkeTcPHGaOF:APA91bHWsKJU-81B8ZZubdJujmEJKIFcDy8lVM4XhXbliLTIFmOLR14ceqxWTYD5gj2L26yKSLyISkaV6NerQRKI-YoCgQMkeb_2Rw93a5EviKIJEuN-7O1M5vejzr0tSAzgf7IGUZoe",
                "notification": {
                    "title": "Rest api test",
                    "body": "Notification sent",
                    "sound": "Tri-tone"
                }
            }


Solution 1:[1]

A relatively simple solution, depending on your workflow, could be to subscribe each application to a dedicated topic, that reflects the app id (com.apps.dev to topic dev, com.apps.prod to topic prod).

You can then use the topic field in your REST request to target all of the devices running a specific application id.

If you need to target a specific topic and app id, you can use the condition field as described in the documentation. The following example will send the notification to all development apps subscribed to 'target-topic':

{
    "condition": "'dev' in topics && 'target-topic' in topics"
}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 alesdi