使用FCM全局发送通知

I want to send notification to my iOS application from server side. I am using PHP at server side and FCM to send notifications. I have the server_key for my firebase project.

I sent the following to FCM

{
  "to": "red_id",
  "data": {
    "message": "This is a Firebase Cloud Messaging Topic Message!",
   }
}

But I want to send notification globally without using "to" clause. Need help

Firebase Cloud Messaging always send messages to specific targets. While those targets can be broad, there is no way to send untargeted messages.

If you want to send a message to all users of your app, the easiest way is to have your app subscribe to a topic (e.g. all on startup. That way you can target all users of your app, by sending a message to topic /topic/all.